Class QCryptography
Class QCryptography: Helps in encrypting and decrypting data It depends on the mcrypt module.
While this module IS serializeable, the information it contains in serialized form is not secure and can be used to decrypt encrypted items. So, make sure you either encrypt the serialized results, or store the results in a secure location. That means, if you are using this in a form object, you must make sure your formstates are not visible to the public, or they are encrypted, since the serialized version of this object will be in the formstate.
Refer: http://php.net/manual/en/book.mcrypt.php
- QBaseClass
- QCryptography
public
|
#
__construct( null|string $strKey = null, null|boolean $blnBase64 = null, null|string $strCipher = null, null|string $strMode = null, null|string $strRandomSource = null )
The Random Number Generator the library uses to generate the IV: - MCRYPT_DEV_RANDOM = /dev/random (only on nix systems) - MCRYPT_DEV_URANDOM = /dev/urandom (only on *nix systems) - MCRYPT_RAND = the internal PHP srand() mechanism (on Windows, you *must use MCRYPT_RAND, b/c /dev/random and /dev/urandom doesn't exist) TODO: there appears to be some /dev/random locking issues on the QCubed development environment (using Fedora Core 3 with PHP 5.0.4 and LibMcrypt 2.5.7). Because of this, we are using MCRYPT_RAND be default. Feel free to change to to /dev/*random at your own risk. |
public
mixed|string
|
|
public
string
|
|
public
mixed|string
|
|
public
string
|
|
public
|
|
public
|
|
public
|
OverrideAttributes(),
__call(),
__get(),
__set()
|
protected
resource
|
$objMcryptModule
Mcrypt algorithm module resource |
|
protected
boolean
|
$blnBase64
Are we going to use Base 64 encoding? |
|
protected
string
|
$strKey
Key to be used for encryption/decryption - used for mycrypt_generic_init |
|
protected
string
|
$strIv
Initialization vector for the algorithm |
|
protected
string
|
$strCipher
Cipher to use when creating the encryption object |
|
protected
string
|
$strMode
Mode to use when creating the encryption object |
|
protected
string
|
$strRandomSource
Random source to use when creating IVs |
|
public static
string
|
$Base64
Default Base64 mode for any new QCryptography instances that get constructed. This is similar to MIME-based Base64 encoding/decoding, but is safe to use in URLs, POST/GET data, and any other text-based stream. Note that by setting Base64 to true, it will result in an encrypted data string that is 33% larger. |
#
true
|
public static
string
|
$Key
Default Key for any new QCryptography instances that get constructed |
#
"qc0Do!d3F@lT.k3Y"
|