> > 
> > > > #!/usr/bin/perl
> > > >
> > > > use strict;
> > > > use warnings;
> > > >
> > > > my $plaintext = do { local $/ = undef; <> };
> > > > my $pad = "X" x length $plaintext;
> > > >
> > > > my $encryptedtext = $plaintext      ^ $pad;
> > > > my $decryptedtext = $encryptedtext  ^ $pad;
> > > > print
> > >
> >
>
"plaintext:\n$plaintext\n\nencryptedtext:\n$encryptedtext\n\n",
> > > >         "decryptedtext:\n$decryptedtext\n";
> > > >
> > > 
> > > I like it! I just need a simple way to encypt
> text
> > > to store in a text
> > > file. To protect sensitive info.
> > > Thanks
> > > 
> 
> Please ignore last message and read this one.
> So you are using the binary ^ to encrypt with XORED
> together bit by bit?  Please explain?
> 
> thank you.
> 
> 
> $/etc/skel
> $ perl -le 'print "hello" ^ "XXXXX";'
> 0=447
> 
> $ perl encrypt.plx file2
> plaintext:
> hello
> 
> encryptedtext:
> 0=447R
> 
> decryptedtext:
> hello


Also noticed I could use binary & and |

$ perl -le 'print "hello" & "XXXXX";'
[EMAIL PROTECTED]

$ perl -le 'print "hello" | "XXXXX";'
x}||&#8962;

but these were not decrypted.  Why not?


       
____________________________________________________________________________________
Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to