Hi ya,
ok i have taken another tack following on from another post and am now using
public function decryptedPassword($toDecrypt) {
$member = '10$6d10497550ed7b1cf62600';
return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($member), base64_decode($toDecrypt), MCRYPT_MODE_CBC, md5(md5($member))), "\0");
}
public function encryptPassword($password) {
$key = '10$6d10497550ed7b1cf62600';
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $password, MCRYPT_MODE_CBC, md5(md5($key))));
}
this all works fine, hooorahh :o) a slight issue i'm now having is that the data i'm encrypting (names and some details) will then need to be edited and i need to be able to display the data in the form unencypted then re-encrypt without encrypting it twice incase it's not edited, do we think this needs to extra fields in the form to display the decrypted data and then on form submission that field is then encryted and replaces the original data?
did any of that make sense??
Mick
Posted to: Encrypting Data using OnBeforeWrite | Show Thread | Post Reply