Err…. like the question says.
How do I go about encrypting and then decrypting data that is being stored and retrieved from the database.
By the way it’s not just for storing a password which has been md5ed, I need to retrieve the data too.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’d do this in the various before methods in my models, or better still create a before method in my app controller which encrypted and decrypted data.
Would be the methods that I would choose.
PS, I should mention Behaviours here also really, as that’s the ideal ‘Cake way’ to achieve this kind of thing, http://book.cakephp.org/view/595/Creating-Behaviors