Encrypt/decrypt a file using a symmetric cipher in CBC mode
then authenticate using HMAC
Methods
Constructor
__construct()
Decrypt a file
decrypt(string $fileIn, string $fileOut) : bool
Parameters
$fileIn
string
$fileOut
string
Exceptions
Returns
bool
Encrypt then authenticate a file using HMAC
encrypt(string $fileIn, string $fileOut) : bool
Parameters
$fileIn
string
$fileOut
string
Exceptions
Returns
bool
Get the cipher algorithm
getCipherAlgorithm() : string | bool
Get the supported algorithms of the symmetric cipher
getCipherSupportedAlgorithms() : array
Get the hash algorithm for HMAC authentication
getHashAlgorithm() : string
Get the key
getKey() : string | null
Get the number of iterations for Pbkdf2
getKeyIteration() : int
Get the Pbkdf2 hash algorithm
getPbkdf2HashAlgorithm() : string
Set the cipher object
setCipher(\Zend\Crypt\Symmetric\SymmetricInterface $cipher)
Set algorithm of the symmetric cipher
setCipherAlgorithm(string $algo)
Set the hash algorithm for HMAC authentication
setHashAlgorithm(string $hash)
Parameters
$hash
string
Exceptions
Set the encryption/decryption key
setKey(string $key)
Parameters
$key
string
Exceptions
Set the number of iterations for Pbkdf2
setKeyIteration(int $num)
Set the hash algorithm for the Pbkdf2
setPbkdf2HashAlgorithm(string $hash)
Parameters
$hash
string
Exceptions
Check that input file exists and output file dont
checkFileInOut(string $fileIn, string $fileOut)
Parameters
$fileIn
string
$fileOut
string
Exceptions
Properties
Hash algorithm for HMAC
$hash : string
Number of iterations for Pbkdf2
$keyIteration : int
Hash algorithm for Pbkdf2
$pbkdf2Hash : string
Constants