[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openssl-users
Subject:    Re: AES-GCM
From:       Jens Hiller <jens.hiller.ccaa () hotmail ! de>
Date:       2014-05-27 7:33:44
Message-ID: BLU436-SMTP255E9E936EB209D3C11AD0AB3A0 () phx ! gbl
[Download RAW message or body]

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                           majordomo@openssl.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic