SECRET_KEY_128_BITS
SECRET_KEY_128_BITS
The symmetric secret key 128-bit size.
Interface EncryptionKeyGenerationInterface - Interface for encryption key and IV generation.
getEncryptionKey(integer $length = self::SECRET_KEY_128_BITS, boolean|integer $printable = true) : string
Generate a random encryption key for symmetrical cyphers.
Note: The output string can be in raw bytes of the $printable
parameter is set
to true
.
integer | $length | The desired output length (default => 16). |
boolean|integer | $printable | Flag for using only printable characters instead of bytes (default => true). |
Randomly generated encryption key.
getEncryptionInitializationVector(integer $length = self::IV_128_BITS, boolean|integer $printable = true) : string
Generate a random initialization vector (IV) for encryption purposes.
Note: The output string can be in raw bytes of the $printable
parameter is set
to true
.
integer | $length | The desired output length (default => 16). |
boolean|integer | $printable | Flag for using only printable characters instead of bytes (default => true). |
Validation errors.
Randomly generated encryption initialization vector.