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