Class Crypto
This class contains cryptography functions
Methods summary
public static
string
|
#
aes256Encode( string $data, string $key = CRYPTO_KEY, string $iv = CRYPTO_IV )
Encode a string with AES 256 algorithm
Encode a string with AES 256 algorithm
Parameters
- $data
- The data to encrypt
- $key
- The encryption key
- $iv
- The initialization vector for encryption
Returns
string The encrypted data
|
public static
string
|
#
aes256Decode( string $data, string $key = CRYPTO_KEY, string $iv = CRYPTO_IV )
Decode with AES 256 algorithm
Decode with AES 256 algorithm
Parameters
- $data
- The data to decrypt
- $key
- The decryption key
- $iv
- The initialization vector for decryption
Returns
string The decrypted data
|
public static
string
|
#
saltHash( string $data, string $salt = CRYPTO_SALT )
Hash a string with a salt
Hash a string with a salt
Parameters
- $data
- The data to hash
- $salt
- The salt to use before hashing
Returns
string The hashed data
|
public static
string
|
#
generateKey( integer $length )
Generate random key
Parameters
- $length
- The length of the generated key
Returns
string the generated key
|