RE: [PHP] crypt and decrypt a string

From: Date: Fri, 05 Oct 2001 14:53:13 +0000
Subject: RE: [PHP] crypt and decrypt a string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70091@lists.php.net to get a copy of this message
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

« previous php.general (#70091) next »