/comp-security-ca2

AES encryption/decryption demonstration in Java

Primary LanguageJava

AES Encryt/Decrypt Java Application

This application uses AES to encrypt and decrypt a user defined text file (.txt). Only a valid text file such as the input.txt in the application root directory will be encrypted.

The string in the text file will be read by the application, then encrypted using randomly generated key. An initial vector byte along with the encypted string will be written a text file called ciphertext.txt. The key used to encrypt the string will be either stored in another text file keystore.txt or in a password protected java key store keystore.jks.

The saved key can then be used to decrypt the data in cipher.txt back into plaintext. The decrypted data will be written to plaintext.txt.


Only run the program on the terminal as the Console instance is only suitable for terminal interface


Compiler and exection commands

Compile

# To compile the source code into bin directory
javac -d bin -cp src src/main/java/org/encryption/*.java

Execution

# To run compiled class files in bin directory
java -cp bin org.encryption.App

All references