Re: Decryption succeed in GCM mode when tag is truncated

2014-06-19 Thread Jakob Bohm
On 6/19/2014 11:19 AM, Jeffrey Walton wrote: ... CCM is probably the oldest of the three, its more complicated, and its offline (you have to have all data beforehand - you cannot stream data into it). Personally, I don't care about GCM's parallelizability because I require all data to be authent

Re: Decryption succeed in GCM mode when tag is truncated

2014-06-19 Thread Michel
Hey, thanks Jeff ! I also inadvertently found an interresting article of a certain M. J. W. ... ;-) I should have read more carefully : http://www.codeproject.com/Articles/34380/Authenticated-Encryption particularly when it states : "It is up to the receiver to determine whether to accept a tag

Re: Decryption succeed in GCM mode when tag is truncated

2014-06-19 Thread Jeffrey Walton
On Thu, Jun 19, 2014 at 4:48 AM, Michel wrote: > Ok, I have missed that point (and probably many others...) > I need to go deeper to better understand things, > and I am grateful for your explanations. If AEAD schemes are your thing, then you might take a look at David Wagner's http://www.cs.berke

Re: Decryption succeed in GCM mode when tag is truncated

2014-06-19 Thread Michel
Ok, I have missed that point (and probably many others...) I need to go deeper to better understand things, and I am grateful for your explanations. Le 18/06/2014 20:25, Thulasi Goriparthi a écrit : In the test program, you are feeding a fixed ccm_tag to decryption process. This will not work fo

Re: Decryption succeed in GCM mode when tag is truncated

2014-06-18 Thread Thulasi Goriparthi
One more thing to correct myself. 2 as tag length is not allowed. only 4, 6, 8, 10, 12, 14, 16 are allowed. On Wed, Jun 18, 2014 at 11:55 PM, Thulasi Goriparthi < thulasi.goripar...@gmail.com> wrote: > In the test program, you are feeding a fixed ccm_tag to decryption > process. This will not w

Re: Decryption succeed in GCM mode when tag is truncated

2014-06-18 Thread Thulasi Goriparthi
In the test program, you are feeding a fixed ccm_tag to decryption process. This will not work for CCM, as tag length itself will also be an input for tag generation. Change in tag length, will change the tag produced. I modified the decryption api(aes_ccm_decrypt) to take the tag generated by encr

Re: Decryption succeed in GCM mode when tag is truncated

2014-06-18 Thread Michel
I tried all of 2, 4, 6, 8, 10, 12, 14, 16 values, and always got a "Plaintext not available: tag verify failed". Even when tag length of decryption was equal to tag length of encryption. :-( It just works for : tag length of decryption = tag length of encryption = 16. Thanks again for your hel

Re: Decryption succeed in GCM mode when tag is truncated

2014-06-18 Thread Thulasi Goriparthi
Truncate-able tags gave a way to truncated hmac extension. Haven't gone through CCM RFC 3610 completely. I can see the restriction of possible M values(Tag lengths) to 2, 4, 6, 8, 10, 12, 14, 16. Can you try reducing the tag size accordingly and see if it succeeds. On Wed, Jun 18, 2014 at 6:52

Re: Decryption succeed in GCM mode when tag is truncated

2014-06-18 Thread Michel
Thank for your answer. But isn't this strategy very hazardous ? And why just for GCM and not CCM ? Le 18/06/2014 14:37, Thulasi Goriparthi a écrit : EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, sizeof(gcm_tag), gcm_tag); When you change tag length with the above statement, you are tellin

Re: Decryption succeed in GCM mode when tag is truncated

2014-06-18 Thread Thulasi Goriparthi
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, sizeof(gcm_tag), gcm_tag); When you change tag length with the above statement, you are telling the decrypt context to consider only those many number of bytes for tag comparision. On Wed, Jun 18, 2014 at 4:52 PM, Michel wrote: > Hi all, > > I w

Decryption succeed in GCM mode when tag is truncated

2014-06-18 Thread Michel
Hi all, I was surprised that decryption succeeded in GCM mode althought the tag was shorter than the one produced when encrypting, as it is not the case in CCM. Is it the intended behaviour ? In order to rule out a possible bug in my program, I finally used the example code at : https://gith