Advertisement
Guest User

Untitled

a guest
Apr 12th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. public static String m8317a(String str, String str2) {
  2. try {
  3. SecureRandom secureRandom = new SecureRandom();
  4. byte[] bArr = new byte[16];
  5. AlgorithmParameterSpec ivParameterSpec = new IvParameterSpec("sk7erfJeopw289dS".getBytes());
  6. Key secretKeySpec = new SecretKeySpec(str.getBytes("UTF-8"), "AES");
  7. Cipher instance = Cipher.getInstance("AES/CBC/PKCS5Padding");
  8. instance.init(1, secretKeySpec, ivParameterSpec);
  9. byte[] doFinal = instance.doFinal(str2.getBytes("UTF-8"));
  10. ByteBuffer allocate = ByteBuffer.allocate(doFinal.length);
  11. allocate.put(doFinal);
  12. return Base64.encodeToString(allocate.array(), 0);
  13. } catch (Throwable th) {
  14. C1861b.m8310a(th);
  15. return null;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement