use strict; use warnings; my $string = 'hello world!!'; my $passphrase = 'my passphrase'; my $encrypted_string = $string ^ $passphrase; print $encrypted_string, "\n"; my $decrypted_string = $encrypted_string ^ $passphrase; print $decrypted_string, "\n";