Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Performs Encryption
- public static String encrypt(String plainText) throws Exception {
- Key key = generateKey();
- Cipher chiper = Cipher.getInstance(algorithm);
- chiper.init(Cipher.ENCRYPT_MODE, key);
- byte[] encVal = chiper.doFinal(plainText.getBytes());
- String encryptedValue = encode(encVal);
- return encryptedValue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement