Tag: aes gcm

使用EVP接口的AES-GCM的OpenSSL C示例

对于AES-GCM加密/解密,我试过这个,但它有一个问题。 ctx = EVP_CIPHER_CTX_new(); //Get the cipher. cipher = EVP_aes_128_gcm (); #define GCM_IV “000000000000” #define GCM_ADD “0000” #define TAG_SIZE 16 #define ENC_SIZE 64 //Encrypt the data first. //Set the cipher and context only. retv = EVP_EncryptInit (ctx, cipher, NULL, NULL); //Set the nonce and tag sizes. //Set IV length. [Optional for GCM]. retv = EVP_CIPHER_CTX_ctrl […]