Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void initKeys() {
- try {
- Cipher cipher = Cipher.getInstance("AES");
- SecretKeySpec skeySpec = new SecretKeySpec(MapleAESOFB.MAPLE_AES_KEY, "AES");
- cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- byte[] iv = BitTools.multiplyBytes(ivKey, 4, 4);
- for (int i = 0; i < 65536; i += 16) {
- iv = cipher.doFinal(iv, 0, 16);
- baos.write(iv, 0, 16);
- }
- WZ_KEY = baos.toByteArray();
- } catch (Exception e) {
- System.out.println("Error: Key Generation");
- e.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment