It was an experiment repository, it contains POC library code. It's not producation ready. It'll be not supported.
Cryptography extensions for Cactoos library.
To encrypt/decrypt an input:
final Scalar<Cipher> cipher = new CipherFrom(
"AES/CBC/PKCS5Padding",
new CipherSpec(key, iv)
);
final Input encrypted = new CryptoInput.Enc(
new InputOf(file),
cipher
);
final Input decrypted = new CryptoInput.Dec(
encrypted,
cipher
);
To encrypt/decrypt an output:
final Scalar<Cipher> cipher = new CipherFrom(
"AES/CBC/PKCS5Padding",
new CipherSpec(key, iv)
);
final Output decrypting = new CryptoOutput.Dec(
new OutputTo(file),
cipher
);
final Output encrypting = new CryptoOutput.Enc(
decrypting,
cipher
);
To compute MAC of input:
final Bytes hmac = new MacOf(
new InputOf(file),
new MacFrom(
"HmacSHA256",
new MacSpec(key)
)
);
To compute message-digest of input:
final Bytes digest = new DigestOf(
new InputOf(file),
new DigestFrom("SHA-256")
);
mvn:
<dependency>
<groupId>com.g4s8</groupId>
<artifactId>cryptocactoos</artifactId>
</dependency>
gradle:
"com.g4s8:cryptocactoos:<vesion>"