Wednesday, December 4, 2013

Protect Your Documents - Use Jasypt For Java

Do you have that one family member who always messes up with your documents on your computer? Well, if you're looking for a library in Java, you can give a try to Jasypt. I always use this library in every of my projects because not only it is super easy to implement and use but many of Developers are now using this wonderful library. Give it a try! Download it now!

I use this library mostly when I make apps that need an internet connection. Because we have no idea that someone is intercepting our communication and stealing our data. This is what we called Man-in-the-middle attack. You can google about that type of attack over the network.
But with the help of Jasypt, the chance of being MiM the network gets slimmer. Just take this example, please make a new project with new class and copy paste this code:

public class Main {
 public static void main(String arg){
  BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
  textEncryptor.setPassword("MySecretPasswordOnlyTrustedFriendsKnow");
  String myEncryptedText = textEncryptor.encrypt("MySecretMessageToMyFriends");
 }
}

And on the machine that receive the message, he needs to decrypt the message using the same password used to encrypt it.

textEncryptor.setPassword("MySecretPasswordOnlyTrustedFriendsKnow");
textEncryptor.decrypt(myEncryptedText);
Just toy around to that easy-to-use security library and in no time you will get the hang of it.
Having a good security to your application is vital.
Thanks for reading!

No comments:

Post a Comment