Guest User

Untitled

a guest
May 27th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public void initKeys() {
  2. try {
  3. Cipher cipher = Cipher.getInstance("AES");
  4. SecretKeySpec skeySpec = new SecretKeySpec(MapleAESOFB.MAPLE_AES_KEY, "AES");
  5. cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
  6. ByteArrayOutputStream baos = new ByteArrayOutputStream();
  7. byte[] iv = BitTools.multiplyBytes(ivKey, 4, 4);
  8. for (int i = 0; i < 65536; i += 16) {
  9. iv = cipher.doFinal(iv, 0, 16);
  10. baos.write(iv, 0, 16);
  11. }
  12. WZ_KEY = baos.toByteArray();
  13. } catch (Exception e) {
  14. System.out.println("Error: Key Generation");
  15. e.printStackTrace();
  16. }
  17. }
Add Comment
Please, Sign In to add comment