久久精品国产精品青草色艺_www.一区_国内精品免费久久久久妲己_免费的性爱视频

用php實現(xiàn)java中的aes加密?

java中的aes加密算法如下:

public static byte[] decrypt(byte[] data, byte[] key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { Security.addProvider(new BouncyCastleProvider()); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding"); cipher.init(2, new SecretKeySpec(key, "AES")); return cipher.doFinal(data); }public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyEx<愛尬聊_生活百科>ception, BadPaddingException, IllegalBlockSizeException { Security.addProvider(new BouncyCastleProvider()); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding"); cipher.init(1, new SecretKeySpec(key, "AES")); return cipher.doFinal(data); }

請問如何用php來實現(xiàn)
我測試了很多網(wǎng)上的例子都不能得到相同的密文


編輯 舉報 2023-05-23 14:26

0個評論

暫無評論...
驗證碼 換一張
相關(guān)內(nèi)容