#!/usr/bin/perl use strict; use Crypt::Twofish; use Crypt::CBC; # You'll need to use the same key that you used to encrypt the file. # my $key = "Super Secret Handshake"; my $cipher = new Crypt::CBC ($key, 'Twofish'); my $ciphertext; my $plaintext; { open(CIPHERTEXT, "Plain"); local $/; $ciphertext = ; close(CIPHERTEXT); } $ciphertext = pack("B*", $ciphertext); # convert a string of "0"s and "1"s into the binary encrypted string $plaintext = $cipher->decrypt($ciphertext); chomp($plaintext); my ($server, $username, $password) = split(/\|/, $plaintext); print STDOUT "Server: " . $server . "\n"; print STDOUT "Username: " . $username . "\n"; print STDOUT "Password: " . $password . "\n";