Property | Type | Description | |
---|---|---|---|
$encryption_key | string | Reference to the user's encryption key |
Property | Type | Description | |
---|---|---|---|
$_hash_type | string | Type of hash operation | |
$_mcrypt_cipher | string | Current cipher to be used with mcrypt | |
$_mcrypt_exists | boolean | Flag for the existence of mcrypt | |
$_mcrypt_mode | integer | Method for encrypting/decrypting data |
Method | Description | |
---|---|---|
__construct ( ) : void | Initialize Encryption class | |
decode ( $string, $key = '' ) : string | Decode | |
encode ( $string, $key = '' ) : string | Encode | |
encode_from_legacy ( $string, $legacy_mode = MCRYPT_MODE_ECB, $key = '' ) : string | Encode from Legacy | |
get_key ( $key = '' ) : string | Fetch the encryption key | |
hash ( $str ) : string | Hash encode a string | |
mcrypt_decode ( $data, $key ) : string | Decrypt using Mcrypt | |
mcrypt_encode ( $data, $key ) : string | Encrypt using Mcrypt | |
set_cipher ( $cipher ) : CI_Encrypt | Set the Mcrypt Cipher | |
set_hash ( $type = 'sha1' ) : void | Set the Hash type | |
set_key ( $key = '' ) : CI_Encrypt | Set the encryption key | |
set_mode ( $mode ) : CI_Encrypt | Set the Mcrypt Mode |
Method | Description | |
---|---|---|
_add_cipher_noise ( $data, $key ) : string | Adds permuted noise to the IV + encrypted data to protect against Man-in-the-middle attacks on CBC mode ciphers http://www.ciphersbyritter.com/GLOSSARY.HTM#IV | |
_get_cipher ( ) : integer | Get Mcrypt cipher Value | |
_get_mode ( ) : integer | Get Mcrypt Mode Value | |
_remove_cipher_noise ( string $data, string $key ) : string | Removes permuted noise from the IV + encrypted data, reversing _add_cipher_noise() | |
_xor_decode ( $string, $key ) : string | XOR Decode | |
_xor_merge ( $string, $key ) : string | XOR key + string Combiner |
protected _add_cipher_noise ( $data, $key ) : string | ||
return | string |
protected _get_cipher ( ) : integer | ||
return | integer |
protected _xor_decode ( $string, $key ) : string | ||
return | string |
protected _xor_merge ( $string, $key ) : string | ||
return | string |
public encode_from_legacy ( $string, $legacy_mode = MCRYPT_MODE_ECB, $key = '' ) : string | ||
return | string |
public mcrypt_decode ( $data, $key ) : string | ||
return | string |
public mcrypt_encode ( $data, $key ) : string | ||
return | string |
public set_cipher ( $cipher ) : CI_Encrypt | ||
return | CI_Encrypt |
public set_key ( $key = '' ) : CI_Encrypt | ||
return | CI_Encrypt |
public set_mode ( $mode ) : CI_Encrypt | ||
return | CI_Encrypt |
protected string $_mcrypt_cipher | ||
return | string |
protected bool $_mcrypt_exists | ||
return | boolean |
protected int $_mcrypt_mode | ||
return | integer |
public string $encryption_key | ||
return | string |