We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Question about Encrypt and Hashing


I'm new on phalcon and have a question about two features, the Crypt and Security...I was reading and got the Crypt service working on a Cli projet to encrypt files and decrypt them. But when I will use the Encrypt service and when I will use the Hashing service?

Because on Vokuro app use the Encrypt service to store passwords, and I was thinking for password is not to store then with hash and not crypt? Is there any difference or is the same thing?


Crypt is often used when you want to hide some information from user, but want to be able to decrypt. Example - cookies.

Hash when you don't need to decrypt information like passwords. There is mechanism how to check is hashed information is equal to the hash. More information here: https://olddocs.phalcon.io/en/3.0.1/reference/security.html