How do I use BasicTextEncryptor for encrypting and decrypting string information?
Category: org.jasypt, viewed: 2748 time(s).
This example is showing you how to use the Jasypt API to write a simple code to do string encryption and decryption. In this example we are going to use the BasicTextEncryptor class which use the PBEWithMD5AndDES algorithm. This class is an implementation of the TextEncryoptor interface.
You can download the library from their website, it's already included with the dependency libraries required by Jasypt such as the commons-codec and commons-lang.
A result produced by the code above are:
Text = The quick brown fox jumps over the lazy dog Encrypted = 7AfSQQt4vUuPqFTEQkE9N7rSBYCxZOTJVKRjqq7HUPCU7CTRNZXoMIHQp7XO4+EDQo6vZyPxU/I= Original = The quick brown fox jumps over the lazy dog
Download Hundreds of Complimentary Industry Resources
Get hundreds of popular Industry magazines, white papers, webinars, podcasts, and more;
all available at no cost to you. With more than 600 complimentary offers, you'll find
plenty of titles to suit your professional interests and needs.
Click Here and Sign up today!
Related Examples
|
|


