this repository is AES block cipher using Rijndael algorithm
- create instance with pad mode
AESCipher cipher = new AESCipher(CBC_PKCS5PADDING);
- set key and iv (if seleted cbc mode)
byte[] plain = "abcdefghijklmnopqrstuvwxyz".getBytes();
byte[] key = "aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbb".getBytes();
byte[] iv = "aaaaaaaaaaaaaaaa".getBytes();
cipher.setKey(key);
cipher.setIV(iv);
- encrypt (plain is byte[])
byte[] enc = cipher.encrypt(plain);
- decrypt
byte[] dec = cipher.decrypt(enc);
devikkim, devikkim@gmail.com