Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. public String encrypt(String Data, String pKey) throws Exception
  2. {
  3. Key key = generateKey(pKey);
  4. Cipher c = Cipher.getInstance(ALGO);
  5. c.init(Cipher.ENCRYPT_MODE, key);
  6. byte[] encVal = c.doFinal(Data.getBytes("UTF-8"));
  7. return new BASE64Encoder().encode(encVal);
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement