Class SecretEncryptor

java.lang.Object
com.scivicslab.turingworkflow.plugins.secret.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();

 // 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);
 
Since:
1.0.0
Author:
devteam@scivicslab.com