Re: crypt and decrypt a string
| From: | Andrey Hristov | Date: | Fri, 05 Oct 2001 15:12:07 +0000 |
| Subject: | Re: crypt and decrypt a string | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70093@lists.php.net to get a copy of this message | ||
On Friday 05 October 2001 18:10, you wrote:
> Use crypt()/decrypt() couple.
>
> Andrey Hristov
> IcyGEN Corporation
> BUILDING SOLUTIONS
> http://www.icygen.com
>
> On Friday 05 October 2001 17:53, you wrote:
> > Here are some simple xor encoding functions that I wrote. This will keep
> > the average joe from peaking at your data.
> >
> > function decode($data){
> > $data = base64_decode($data);
> > /* XOR data */
> > for($i = 0; $i < strlen($data); $i++){
> > $data[$i] = ~ $data[$i];
> > }
> > return $data;
> > }
> >
> > function encode($data){
> > /* XOR data */
> > for($i = 0; $i < strlen($data); $i++){
> > $data[$i] = ~ $data[$i];
> > }
> > $data = base64_encode($data);
> > return $data;
> > }
> >
> > -----Original Message-----
> > From: Joel Ricker [mailto:joejava@dragoncat.net]
> > Sent: Friday, October 05, 2001 7:20 AM
> > To: php-general@lists.php.net
> > Subject: [PHP] crypt and decrypt a string
> >
> >
> > Does anybody have an easy way to crypt and decrypt a string? I see the
> > Mcrypt Encryption module but thats a little more gung-ho than I'm
> > looking for. I'm not trying to encrypt sensitive data rather I'm more
> > trying obfuscate it a variable for a hidden tag.
> >
> > Thought I remember seeing something using XOR? Any ideas?
> >
> > Thanks
> > Joel