note 11991 deleted from function.md5 by jimw

From: Date: Sat, 03 Nov 2001 02:32:52 +0000
Subject: note 11991 deleted from function.md5 by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-20333@lists.php.net to get a copy of this message
Beware that you do not want to send R-MD5-encrypted strings to a database. After a day debugging very strange problems, it became clear that Postgres (which I've never had any problems with) was very confused and needed a cold boot or two. So if you're going to store the encrypted value to a db, use base64 encoding. That is, replace the first line of decrypt() with $txt = keyED(base64_decode($txt)); and the last line of encrypt() with return base64_encode(keyED($tmp)); (For some reason i didn't get to the bottom of, using addslashes() and stripcslashes() instead, eg, return addcslashes(keyED($tmp),"\0..\57\72..\377"); didn't work.)

« previous php.notes (#20333) next »