Class FileCipher

Summary

Fully Qualified Name: Laminas\Crypt\FileCipher

Description

Encrypt/decrypt a file using a symmetric cipher in CBC mode then authenticate using HMAC

Methods

Name Description Defined By
__construct() Constructor FileCipher
decrypt() Decrypt a file FileCipher
encrypt() Encrypt then authenticate a file using HMAC FileCipher
getCipher() Get the cipher object FileCipher
getCipherAlgorithm() Get the cipher algorithm FileCipher
getCipherSupportedAlgorithms() Get the supported algorithms of the symmetric cipher FileCipher
getHashAlgorithm() Get the hash algorithm for HMAC authentication FileCipher
getKey() Get the key FileCipher
getKeyIteration() Get the number of iterations for Pbkdf2 FileCipher
getPbkdf2HashAlgorithm() Get the Pbkdf2 hash algorithm FileCipher
setCipher() Set the cipher object FileCipher
setCipherAlgorithm() Set algorithm of the symmetric cipher FileCipher
setHashAlgorithm() Set the hash algorithm for HMAC authentication FileCipher
setKey() Set the encryption/decryption key FileCipher
setKeyIteration() Set the number of iterations for Pbkdf2 FileCipher
setPbkdf2HashAlgorithm() Set the hash algorithm for the Pbkdf2 FileCipher

Method Details

__construct()

Constructor

Parameter Name Type Description
$cipher \SymmetricInterface

Returns:

decrypt()

Decrypt a file

Parameter Name Type Description
$fileIn string
$fileOut string
$compress bool

Returns: bool

encrypt()

Encrypt then authenticate a file using HMAC

Parameter Name Type Description
$fileIn string
$fileOut string

Returns: bool

getCipher()

Get the cipher object

Returns: \SymmetricInterface

getCipherAlgorithm()

Get the cipher algorithm

Returns: string|bool

getCipherSupportedAlgorithms()

Get the supported algorithms of the symmetric cipher

Returns: array

getHashAlgorithm()

Get the hash algorithm for HMAC authentication

Returns: string

getKey()

Get the key

Returns: string|null

getKeyIteration()

Get the number of iterations for Pbkdf2

Returns: int

getPbkdf2HashAlgorithm()

Get the Pbkdf2 hash algorithm

Returns: string

setCipher()

Set the cipher object

Parameter Name Type Description
$cipher \SymmetricInterface

Returns:

setCipherAlgorithm()

Set algorithm of the symmetric cipher

Parameter Name Type Description
$algo string

Returns:

setHashAlgorithm()

Set the hash algorithm for HMAC authentication

Parameter Name Type Description
$hash string

Returns:

setKey()

Set the encryption/decryption key

Parameter Name Type Description
$key string

Returns:

setKeyIteration()

Set the number of iterations for Pbkdf2

Parameter Name Type Description
$num int

Returns:

setPbkdf2HashAlgorithm()

Set the hash algorithm for the Pbkdf2

Parameter Name Type Description
$hash string

Returns:

Top