Does anyone have experience storing encrypted data in MySQL with PHP?
I'm having some difficulties... here's my routine.
And I get back data which I can't decrypt... if I strip out the insert/retrieve to database portion it runs just fine. And I'm storing this as a blob... I'm guessing this is a problem with character encodings?
Not certain, would love any suggestions, or ear flicks if I've just made a silly mistake.
-Rob
I'm having some difficulties... here's my routine.
Code:
$store_data = @mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $data, MCRYPT_MODE_ECB);
$store_data = addslashes($store_data);
//Insert into database
//Retrieve from database
$store_data = stripslashes($store_data);
$stored_data= mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $store_data, MCRYPT_MODE_ECB);
And I get back data which I can't decrypt... if I strip out the insert/retrieve to database portion it runs just fine. And I'm storing this as a blob... I'm guessing this is a problem with character encodings?
Not certain, would love any suggestions, or ear flicks if I've just made a silly mistake.
-Rob