use of org.craftercms.commons.crypto.TextEncryptor in project commons by craftercms.
the class EncryptionTool method encrypt.
private static void encrypt(CommandLine line) throws MissingOptionException, CryptoException {
String clearText = line.getOptionValue(ENC_OPTION);
TextEncryptor encryptor = createEncryptor(line);
String cipherText = encryptor.encrypt(clearText);
System.out.print("Cipher text (in Base 64): ");
System.out.println(cipherText);
}
use of org.craftercms.commons.crypto.TextEncryptor in project commons by craftercms.
the class EncryptionTool method decrypt.
private static void decrypt(CommandLine line) throws MissingOptionException, CryptoException {
String cipherText = line.getOptionValue(DEC_OPTION);
TextEncryptor encryptor = createEncryptor(line);
String clearText = encryptor.decrypt(cipherText);
System.out.print("Clear text: ");
System.out.println(clearText);
}
Aggregations