commons-crypt Wiki
A library for easy use of symmetric encryption and decryption in java
Brought to you by:
michaels-apps
public static void main(String[] args) throws IOException {
FileInputStream plainInput = new FileInputStream(args[0]);
FileOutputStream cipherOutput = new FileOutputStream(args[1]);
String password = args[2];
long outputLength = Crypt.AES256.encrypt(plainInput, cipherOutput, password);
}
public static void main(String[] args) throws IOException {
FileInputStream cipherInput = new FileInputStream(args[0]);
FileOutputStream plainOutput = new FileOutputStream(args[1]);
String password = args[2];
long outputLength = Crypt.Blowfish256.decrypt(cipherInput, plainOutput, password);
}
byte[] plainText = { ... };
byte[] cipherText = Crypt.AES256.encrypt(plainText, "password");
byte[] plainTextAgain = Crypt.AES256.decrypt(cipherText, "password");
commons-crypt is on maven central.
So the recommended way to use it, is to add a dependency to your pom.xml:
<dependency>
<groupId>de.mibos</groupId>
<artifactId>commons-crypt</artifactId>
<version>1.4</version>
</dependency>
The javadoc documentation is here: http://commonscrypt.sourceforge.net/apidocs/index.html
Java 7 or later