12.5. Encryption

Encryption is the process of transforming information to and from an unreadable format. Some algorithms simply scramble text; others allow for reversing the process. PHP offers a wrapper to C's crypt function plus an extension that wraps the mcrypt library.

The mcrypt functions rely on a library of the same name written by Nikos Mavroyanopoulos, which provides an advanced system for encrypting data. The URI for the project is <http://mcrypt.hellug.gr/>. Sascha Schumann added mycrypt functionality to PHP. Derick Rethans added support for the new API introduced in mcrypt 2.4.4.

Cryptography is a topic beyond the scope of this text. Some concepts discussed in this section require familiarity with advanced cryptographic theories. ...

Get Core PHP Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.