Module III : Encryption and Decryption Java Programming with Jasypt
Firstly, i want to Encrypt and Decrypt a text with java liblary Jasypt. You can see a documentation and download liblary in http://www.jasypt.org.
I have a java project with Jasypt liblary and you can download here : DOWNLOAD
If you have a java project above, you can follow this step :
1. Open project “javaphp” with Netbeans editor.
You can see that Jasypt liblary already exist in a project. If liblary’s not working, you can remove that liblary and add again with other jasypt liblary.
Aftert that. you can open Main Class file “Javaphp.java” right now.
Script description :
Line 5 & 6 : include class BasicTextEncryptor and class BasicPasswordEcryptor, so it can be used to make object of class.
Line 19 : define String variable with a sentence to be encrypted.
Line 21 : Create an object from class BasicTextEncryptor(), object name is “obyek_enkripsi”.
Line 23 : set password with setPassword method from class, that password’s required to encrypt and decrypt text.
Line 24 : get encrypt text and store in “tampungan” variable that define in line 20.
Line 26 : print encypt data
Line 28 : get decrypt text from ecrypted text in line 24, and sore in “hasil” variable.
Line 29 : print decyrpt data
Try with Run this program.!!
Posted on December 8, 2012, in Java Programming, Materi Kuliah and tagged decrypt, decryption, dekripsi, encrypt, encryption, enkripsi, jasypt, java, java programming, keamanan. Bookmark the permalink. 3 Comments.