simplephp / encrypt-decrypt

Java、Go、Python、NodeJS、PHP、JavaScript AES/CBC/PKCS7Padding 加解密
95 stars 71 forks source link

可以添加支持 $tag和$aad吗? #5

Open bizliaoyuan opened 1 year ago

bizliaoyuan commented 1 year ago

openssl_encrypt( string $data, string $cipher_algo, string $passphrase, int $options = 0, string $iv = "", string &$tag = null, string $aad = "", int $tag_length = 16 ): string|false

bizliaoyuan commented 1 year ago

Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(key.getBytes(), "AES"), new GCMParameterSpec(128, iv)); cipher.updateAAD(aad);