Encrypt And Decrypt Example in JAVA
Security is the first concern when you develope application what have sensitive data such as account number, passport number , etc . Today i want to show example how to do simple encrypt and decrypt method in JAVA. In this tutorial i will use 3rd party library, you can download the library by the following link : Common-Codecs-1.8 The import library : import org.apache.commons.codec.binary.Base64; import java.io.*; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import javax.swing.JOptionPane; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; The SharedVector private static byte[] sharedvector = { 0x01, 0x02, 0x03, 0x05, 0x07, 0x0B, 0x0D, 0x11 }; The Encr