The algorithm that will be used in this integration is Advanced Encryption Standard (AES) in Galois/Counter Mode (GCM).
The implementation follows the specified requirements for Initial Vector (IV) length, Secret Key length, Salt length, and the final encrypted string format.
AES/GCM/NoPadding: This is a powerful, secure, and authenticated encryption mode. It not only encrypts the data but also provides an authentication tag to ensure the data has not been tampered with.
Initial Vector (IV): A random 12-byte value that ensures the same plaintext encrypts to a different ciphertext each time. It is not a secret and must be transmitted with the encrypted data.
Secret Key: A 256-bit (32-byte) key used for encryption. This key is the most critical piece of the system and must be kept secret.
Salt: A random 16-byte value used to add extra entropy, particularly for key derivation, although here it is used as part of the payload structure.
Encrypted String Order: The final encrypted string is a base64-encoded concatenation of the IV, SALT, and the encrypted_data in that specific order.