Aes256GCMEncryptor
Aes256GCMEncryptor is a cryptographic utility for performing AES-256 encryption and decryption in GCM (Galois/Counter Mode). This class implements the Encryption
interface and provides methods to securely encrypt and decrypt text data.
The class uses a specified secret key for encryption and decryption operations, ensuring that the integrity and confidentiality of the data are maintained. Nonces are generated randomly to ensure uniqueness and mitigate the risk of ciphertext reuse attacks.
Key features:
Secure AES-256-GCM encryption and decryption implementation
Random nonce generation for each encryption operation
Base64 encoding/decoding for easy integration with external systems
Implements platform-independent
Encryption
interface
Parameters
A Base64-encoded string representing the AES-256 secret key to initialize the encryptor.
Throws
if the provided secret key is invalid or does not meet the required size.