I have this piece of code in Java, which encrypts a source String to a Base64 encrypted value using AES 128 bit. However I failed to find similar PHP function producing the same result. Any help would be greatly appreciated
String key = "1234567890123456";
String source = "The quick brown fox jumped over the lazy dog";
byte[] raw = key.getBytes();
SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
// Instantiate the cipher
Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
byte[] encrypted = cipher.doFinal(source.getBytes());
System.out.println(new String(Base64.encodeBase64(encrypted)));