PHP provides several functions to encrypt data.
Symmetrical encryption edit
Storing passwords in clear (unencrypted), in a file or a database, constitutes a security breach. To be able to encrypt and decrypt them, a symmetrical encryption can be done by:
Asymmetrical encryption edit
The asymmetrical encryption est used to check an identity, via a public and a private key. In PHP, it's done with: