I'm looking to make a 'backend' attribute encrypted, just like the Magento password. How doesn't magento handle the encryption and what's the best way to decypte as well for the php to run logic against it?



The password is hashed, not encrypted. It's a one way algorithm. So there's no way to get the value back.

You could create a new attribute with a custom backend type, and hook it up into openssl_encrypt and the respective decrypt in the before save and after load functions. Possibly using your encryption key pulled out of the local xml.

Don't forget to use a massive text field to store your data, as the ciphertext takes up more space than the plain text.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.