0
$\begingroup$

I want to encrypt data on client side with Openssl AES 128 GCM and decrypt those data on server side inside Intel SGX using rijndael 128 GCM. I can see inside sgx_aes_gcm.cpp that it uses the same functions from Openssl.

I can imagine that the tag generated by EVP_CIPHER_CTX_ctrl(pState, EVP_CTRL_GCM_GET_TAG, 16, tag) function is mandatory for the decryption to success.

So my question is, how can I transfer the tag from the client to the server so I can authenticate and decrypt the data successfully?

$\endgroup$

1 Answer 1

1
$\begingroup$

So my question is, how can I transfer the tag from the client to the server so I can authenticate and decrypt the data successfully?

How do you expect the transfer the ciphertext? You can use that same mechanism. In fact, it is standard practice to just append the tag to the ciphertext, and just treat that as one long bytestring.

$\endgroup$
2
  • $\begingroup$ But if I just append it to the ciphertext isn't it a security vulnerability because someone could see the tag as it is always 16 bytes? I wonder if Openssl puts the tag inside the ciphertext in some way $\endgroup$
    – gsoap
    Dec 27, 2022 at 20:38
  • $\begingroup$ @gsoap: why would it be a security vulnerability? GCM gives full security even if the attacker can see (and modify) the tag... $\endgroup$
    – poncho
    Dec 29, 2022 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.