List of utility methods to do Byte Array Encrypt
byte[] | encrypt(byte[] raw, byte[] clear) encrypt SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES"); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec); byte[] encrypted = cipher.doFinal(clear); return encrypted; |