> -----Original Message----- > From: david [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 26, 2002 8:41 PM > To: [EMAIL PROTECTED] > Subject: Re: Hide a string while saving it to file > > > Nyimi Jose wrote: > > > I have a string (ascii). > > I would like to apply a rule on it before saving it to a file -> > > coding ... And apply the same rule to get the original string while > > reading from the file -> decoding ... > > > > Any Idea ? > > there are ency/decy modules in CPAN that you should check out. for a > brain-dead appoach try: > > #!/usr/bin/perl -w > use strict; > > my $i = "abcd"; > > my $j = mess_it($i); > print "$j\n"; > print fix_it($j),"\n"; > > sub fix_it{ > my $s = shift; > $s =~ s#(.)#chr(ord($1)/2)#ge; > return $s; > } > > sub mess_it{ > my $s = shift; > $s =~ s/(.)/chr(ord($1)*2)/ge; > return $s; > } > > __END__ > > anyone who knows a little Perl can easily figure out a way to > decode the > mess-ed string. it's not secure at all. but if you just want > to prevent > users from looking at your data, that might help.
That's ok for what I want. Thanks a lot ... José. **** DISCLAIMER **** "This e-mail and any attachment thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the recipient(s) named above. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication or distribution in any form) by other persons than the designated recipient(s) is prohibited. If you have received this e-mail in error, please notify the sender either by telephone or by e-mail and delete the material from any computer". Thank you for your cooperation. For further information about Proximus mobile phone services please see our website at http://www.proximus.be or refer to any Proximus agent. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]