Class SecretEncryptor

java.lang.Object
com.scivicslab.actoriac.SecretEncryptor

public class SecretEncryptor extends Object
Utility for encrypting and decrypting secrets using AES-256-GCM.

This class provides authenticated encryption with AES-256 in GCM mode, which provides both confidentiality and integrity protection.

Usage Example

// Generate a new encryption key
String key = SecretEncryptor.generateKey();
System.out.println("ACTOR_IAC_SECRET_KEY=" + key);

// Encrypt a file
String plaintext = Files.readString(Path.of("secrets.ini"));
String encrypted = SecretEncryptor.encrypt(plaintext, key);
Files.writeString(Path.of("secrets.enc"), encrypted);

// Decrypt a file
String encryptedContent = Files.readString(Path.of("secrets.enc"));
String decrypted = SecretEncryptor.decrypt(encryptedContent, key);
Author:
devteam@scivics-lab.com