I want to decrypt a file that has been encrypted using AES-256 in GCM mode in libressl. I have the key but I don't have the IV, is there any way I can still decrypt?

  • 2
    $\begingroup$ For the internal CTR mode, if you have one full block of plaintext then you XOR it to retrieve the key stream, which is the encrypted counter block, consisting of the nonce and 32 bits of counter (starting at value 2 in unsigned big endian format). So XOR, then decrypt, get first 12 bytes. Didn't post this as an answer because I'm not sure if some GMAC specific tricks can be played. Note to other answerers: for that maybe it matters if the IV/nonce is 12 bytes or not, not sure. $\endgroup$
    – Maarten Bodewes
    Jun 7 '21 at 7:27
  • $\begingroup$ I'm really new to this, I don't understand how I can XOR it then decrypt without the iv to get the first 12 bytes $\endgroup$ Jun 7 '21 at 12:39
  • $\begingroup$ Both the XOR and the decrypt are block operations, so on a full block of ciphertext, using the AES block size of 16 bytes. The block decrypt only requires the key, no IV needs to be supplied for that. Does that make more sense? $\endgroup$
    – Maarten Bodewes
    Jun 7 '21 at 12:45
  • $\begingroup$ This following answer may help you with understanding and decrypting the rest of the ciphertext, without actually performing the authenticity check / calculating the tag value. $\endgroup$
    – Maarten Bodewes
    Jun 7 '21 at 12:50
  • $\begingroup$ Where can I block decrypt? $\endgroup$ Jun 7 '21 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.