Advertisement
Guest User

Untitled

a guest
May 26th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. // Performs Encryption
  2. public static String encrypt(String plainText) throws Exception {
  3. Key key = generateKey();
  4. Cipher chiper = Cipher.getInstance(algorithm);
  5. chiper.init(Cipher.ENCRYPT_MODE, key);
  6. byte[] encVal = chiper.doFinal(plainText.getBytes());
  7. String encryptedValue = encode(encVal);
  8. return encryptedValue;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement