AES encryption method equivalent to MySQL aes_encrypt() function
I want to write an AES encryption method that should be equivalent to mysql aes_encrypt . I try to write but it's not correct, because mysql is nor giving proper data. What should I do to get it correct? Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, keySpec); byte[] encryptedTextBytes = cipher.doFinal(message .getBytes("UTF-8")); String k = new String(encryptedTextBytes); System.out.println("KKKKK"+k); MySQL's implementation of AES gives headaches to a lot of people. It'a mainly because of how MySQL processes the encryption key. The encryption key gets broken into