Implementing Cryptography

The QCryptography class is used to implement cryptography for your site and back-end. It primarly serves as a cohesive wrapper around the libmcrypt library, which must also be installed. (According to the PHP documentation, you must have libmcrypt v2.5.6 or greater for PHP 5)

By default, QCryptography will use the TripleDES cipher in Electronic Codebook mode. It will also conveniently do base64 conversion (similar to MIME-based Base64 encoding) so that the resulting encrypted data can be used in text-based streams, GET/POST data, URLs, etc.

However, note that any of these options can be changed at any time. Through the libmcrypt library, QCryptography supports most of the industry accepted ciphers, including DES, ARC4, Blowfish, Rijndael, RC2, RC4, RC6, etc.

You can statically specify a "default" cipher, mode, base64 flag and key by modifying the appropriate static member variable on the class, or you can specify these fields explicitly when constructing a new instance of QCryptography.

QCryptography also supports the encryption and decryption of entire files.

For more information about the libmcrypt library, please refer to the PHP Documentation.

TripleDES, Electronic Codebook Encryption

Cannot run the sample code because libmcrypt PHP module is not installed

TripleDES, Electronic Codebook Encryption (with Base64 encoding)

Cannot run the sample code because libmcrypt PHP module is not installed