$authenticationMode
$authenticationMode : integer
The authenticated encryption mode operation property.
Class AuthenticatedEncryption - The authenticated encryption protocol object.
$keyedDigestionSource : \CryptoManana\Core\Abstractions\MessageDigestion\AbstractKeyedHashFunction|null
The message keyed digestion service property storage.
$symmetricCipherSource : \CryptoManana\Core\Abstractions\MessageEncryption\AbstractBlockCipherAlgorithm|null
The message symmetric encryption algorithm service property storage.
setKeyedDigestionFunction(\CryptoManana\Core\Abstractions\MessageDigestion\AbstractKeyedHashFunction $hasher) : $this
Setter for the keyed message digestion service.
\CryptoManana\Core\Abstractions\MessageDigestion\AbstractKeyedHashFunction | $hasher | The keyed message digestion service or null. |
The container object.
getKeyedDigestionFunction() : \CryptoManana\Core\Abstractions\MessageDigestion\AbstractKeyedHashFunction|null
Getter for the keyed message digestion service.
The currently injected message digestion service or null.
setSymmetricCipher(\CryptoManana\Core\Abstractions\MessageEncryption\AbstractBlockCipherAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface $cipher) : $this
Setter for the message symmetric encryption service.
\CryptoManana\Core\Abstractions\MessageEncryption\AbstractBlockCipherAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface | $cipher | The message symmetric encryption service. |
The container object.
getSymmetricCipher() : \CryptoManana\Core\Abstractions\MessageEncryption\AbstractBlockCipherAlgorithm|\CryptoManana\Core\Interfaces\MessageEncryption\DataEncryptionInterface|null
Getter for the message symmetric encryption service.
The currently injected message encryption service or null.
__construct(\CryptoManana\Core\Abstractions\MessageEncryption\AbstractBlockCipherAlgorithm|null $cipher = null, \CryptoManana\Core\Abstractions\MessageDigestion\AbstractKeyedHashFunction|null $hasher = null)
Container constructor.
\CryptoManana\Core\Abstractions\MessageEncryption\AbstractBlockCipherAlgorithm|null | $cipher | the message symmetric encryption service. |
\CryptoManana\Core\Abstractions\MessageDigestion\AbstractKeyedHashFunction|null | $hasher | The message keyed digestion service. |
Initialization validation.
authenticatedEncryptData(string $plainData) : \CryptoManana\DataStructures\AuthenticatedCipherData
Encrypts and authenticates the given plain data.
string | $plainData | The plain input string. |
Validation errors.
The authenticated cipher data object.
authenticatedDecryptData(\CryptoManana\DataStructures\AuthenticatedCipherData $authenticatedCipherData) : string
Decrypts and authenticates the given cipher data.
\CryptoManana\DataStructures\AuthenticatedCipherData | $authenticatedCipherData | The authenticated cipher data object. |
Validation errors.
The plain data information.
injectMacIntoMessageData(string $plainData, string $macTag) : string
Internal method for the injection of a MAC tag inside a plain message.
string | $plainData | The plain input string. |
string | $macTag | The message authentication code (tag). |
The plain message containing the MAC tag inside.
extractConcatenatedMacFromMessageData(string $plainData) : array
Internal method for the extraction of a MAC tag contained inside a plain message.
string | $plainData | The plain input string. |
The separated message data and MAC tag as a tuple/array representation.
encryptAndMac(string $plainData) : \CryptoManana\DataStructures\AuthenticatedCipherData
Encrypts and authenticates the given plain data in Encrypt-and-MAC (E&M) mode.
string | $plainData | The plain input string. |
Validation errors.
The authenticated cipher data object.
decryptAndMac(\CryptoManana\DataStructures\AuthenticatedCipherData $authenticatedCipherData) : string
Decrypts and authenticates the given plain data in Encrypt-and-MAC (E&M) mode.
\CryptoManana\DataStructures\AuthenticatedCipherData | $authenticatedCipherData | The authenticated cipher data object. |
Validation or authentication errors.
The plain data information.
macThenEncrypt(string $plainData) : \CryptoManana\DataStructures\AuthenticatedCipherData
Encrypts and authenticates the given plain data in MAC-then-Encrypt (MtE) mode.
string | $plainData | The plain input string. |
Validation errors.
The authenticated cipher data object.
macThenDecrypt(\CryptoManana\DataStructures\AuthenticatedCipherData $authenticatedCipherData) : string
Decrypts and authenticates the given plain data in MAC-then-Encrypt (MtE) mode.
\CryptoManana\DataStructures\AuthenticatedCipherData | $authenticatedCipherData | The authenticated cipher data object. |
Validation or authentication errors.
The plain data information.
encryptThenMac(string $plainData) : \CryptoManana\DataStructures\AuthenticatedCipherData
Encrypts and authenticates the given plain data in Encrypt-then-MAC (EtM) mode.
string | $plainData | The plain input string. |
Validation errors.
The authenticated cipher data object.
decryptThenMac(\CryptoManana\DataStructures\AuthenticatedCipherData $authenticatedCipherData) : string
Decrypts and authenticates the given plain data in Encrypt-then-MAC (EtM) mode.
\CryptoManana\DataStructures\AuthenticatedCipherData | $authenticatedCipherData | The authenticated cipher data object. |
Validation or authentication errors.
The plain data information.