Thanks for the info!
I looked at the demos programs in the given link
http://git.openssl.org/gitweb/?p=openssl.git;a=blob;f=demos/evp/aesgcm.c;h=324d8a55b1481c507c7754fa7f33c30a02bdb737;hb=HEAD
.

I have a question in encrypt:

...
 /* Finalise: note get no output for GCM */
63
<http://git.openssl.org/gitweb/?p=openssl.git;a=blob;f=demos/evp/aesgcm.c;h=324d8a55b1481c507c7754fa7f33c30a02bdb737;hb=HEAD#l63>
        EVP_EncryptFinal_ex(ctx, outbuf, &outlen);
...

What does this mean? That we shouldn't expect any output from this call
and/or that we should ignore it?



Thanks!


On Tue, May 27, 2014 at 12:33 AM, Jens Hiller <jens.hiller.c...@hotmail.de>
wrote:

> On 05/27/2014 09:00 AM, Anant Rao wrote:
> > Hi,
> >
> > I have ciphertext encrypted in Java (using BouncyCastle - BC) with
> > "AES/GCM/NoPadding" cipher.
> >
> > When I tried to decrypt it using OpenSSL in a 'c' program, the last call
> > 'EVP_DecryptFinal_ex' fails. Somehow, ERR_print_errors_fp is not
> > printing anything either.
> >
> > I do have the IV that is used in the Java's encrypt. However, I don't
> > know where BC stores the tag in the ciphertext. I tried it at the
> > beginning and the end of the ciphertext, but it didn't help.
> >
> > That is, I tried both of the following in the decrypt:
> >
> > |IV|TAG|Ciphertext
> >
> > |IV|Ciphertext|TAG
> > Both didn't work.
> >
> > I tried both of the following as well with the same failure:
> > EVP_aes_256_gcm
> > EVP_aes_128_gcm
> >
> > I have run out of ideas what else to try. Any help would be greatly
> > appreciated.
> > Thanks in advance!
> >
> >
>
> Have a look at
> https://www.openssl.org/docs/crypto/EVP_EncryptInit.html#GCM_Mode
> and at the example in 'openssl/demos/evp/aesgcm.c' of the current master
> branch (git://git.openssl.org/openssl.git).
>
> Regards
> Jens
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           majord...@openssl.org
>



-- 

   *Anant* *Rao*
Server Lead
D  / a...@noknok.com

     *Nok Nok Labs Inc.*
4151 Middlefield Road, Suite 200
Palo Alto, CA 94303
T +1 650 433 1300
i...@noknok.com

*www.noknok.com* <http://www.noknok.com>




 <http://www.linkedin.com/company/nok-nok-labs>
<http://www.twitter.com/noknoklabs>
<https://plus.google.com/108217184383559859585>
<http://www.facebook.com/NokNokLabs>

Reply via email to