AES 256bit Encryption/Decryption and storing in the database using java

Danoja Dias
3 min readDec 3, 2016

AES 256bit Encryption/Decryption and storing in the database using java

AES stands for Advanced Encryption Standards. AES is based on the Rijndael ciper developed by two Belgian cryptographers, Joan Daeman and Vincent Rijmen. AES was designed to be efficient in both hardware and software and supports a block length of 128bits and key lengths of 128,192 and 256 bits. In security point of view AES is more secure when compared to DES Encryption methods.

Here you will learn how to encrypt and decrypt in java using above mentioned AES 256bit Encryption method and How to store it in a database.

I searched about this on internet but I couldn’t find a full tutorial on this. Even though there are tutorials on encryption and decryption, they do not say about storing it in database. Here you can learn about encryption decryption plus store in database.

Here the encrypted word is concatenated with the things that are needed for decryption. There fore the Encrypted word can be stored in database and decrypted.

You should have NetBeans or Eclipse IDE

Create new Project

First you download commons-codec-1.10 under binaries from here.

Extract it and add commons-codec-1.10 jar library to your project.

you have to create following three classes.

  1. Encryption.java

--

--

Danoja Dias

ATL at Enactor Ltd | Former R&D Engineer at Synopsys Inc | Former Intern at WSO2 | BSc Computer Engineering | GSoC2016 | http://linkedin.com/in/danojadias