Galois/Counter mode of the Advanced Encryption Standard: A mode of operation of the AES block cipher which both encrypts and authenticates its input data.
Questions tagged [aes-gcm]
309 questions
49
votes
1 answer
Java AES/GCM/NoPadding - What is cipher.getIV() giving me?
I'm using AES/GCM/NoPadding encryption in Java 8 and I'm wondering whether my code has a security flaw. My code seems to work, in that it encrypts and decrypts text, but a few details are unclear.
My main question is this:
Cipher cipher =…
![](../../users/profiles/359008.webp)
Michael Hixson
- 1,138
- 1
- 8
- 14
22
votes
3 answers
Slow AES GCM encryption and decryption with Java 8u20
I am trying to encrypt and decrypt data using AES/GCM/NoPadding. I installed the JCE Unlimited Strength Policy Files and ran the (simple minded) benchmark below. I've done the same using OpenSSL and was able to achieve more than 1 GB/s encryption…
![](../../users/profiles/107523.webp)
Christo
- 1,662
- 3
- 19
- 28
15
votes
4 answers
OpenSSL C example of AES-GCM using EVP interfaces
For AES-GCM encryption/decryption, I tried this, but it has a problem.
ctx = EVP_CIPHER_CTX_new();
//Get the cipher.
cipher = EVP_aes_128_gcm ();
#define GCM_IV "000000000000"
#define GCM_ADD "0000"
#define TAG_SIZE …
![](../../users/profiles/1629262.webp)
doptimusprime
- 8,303
- 5
- 41
- 82
13
votes
1 answer
AES GCM implementation with authentication Tag in Java
I'm using AES GCM authentication in my android project and it works fine. But getting some issues with authentication tag when it compare with openssl API generate tag. Please find the java code below:
SecretKeySpec skeySpec = new SecretKeySpec(key,…
![](../../users/profiles/3656812.webp)
user3656812
- 131
- 1
- 1
- 3
12
votes
4 answers
Java 9: AES-GCM performance
I have run a simple test to measure the AES-GCM performance in Java 9, by encrypting byte buffers in a loop. The results were somewhat confusing. The native (hardware) acceleration seems to work - but not always. More specifically,
When encrypting…
![](../../users/profiles/9390627.webp)
gidon
- 271
- 1
- 7
12
votes
2 answers
How to chain BCryptEncrypt and BCryptDecrypt calls using AES in GCM mode?
Using the Windows CNG API, I am able to encrypt and decrypt individual blocks of data with authentication, using AES in GCM mode. I now want to encrypt and decrypt multiple buffers in a row.
According to documentation for CNG, the following scenario…
![](../../users/profiles/1380680.webp)
Reinier Torenbeek
- 14,439
- 5
- 37
- 57
10
votes
1 answer
AES/GCM/NoPadding AEADBadTagException
I am trying to use AES/GCM/NoPadding for encryption in Java8. But I can't figure out why I am having a AEADBadTagException when decrypting.
Here's my code:
private final int GCM_IV_LENGTH = 12;
private final int GCM_TAG_LENGTH = 16;
private static…
![](../../users/profiles/7377031.webp)
Cille
- 103
- 1
- 7
10
votes
1 answer
Is it possible to encrypt data with AES (256 bit) GCM mode in .net framework 4.7?
The MSDN link provides references to concrete AES classes:
System.Security.Cryptography.AesCng
System.Security.Cryptography.AesCryptoServiceProvider
System.Security.Cryptography.AesManaged
However AesCryptoServiceProvider is for older machines and…
![](../../users/profiles/889309.webp)
Raghu
- 2,485
- 3
- 24
- 54
9
votes
1 answer
decrypt TLS 1.2 AES-GCM packet
I'm working on a Java program to decrypt a TLS 1.2 Session which is using the TLS_RSA_WITH_AES_128_GCM_SHA256 cipher. I recorded a test session using wireshark. The Master Secret is known.
No. Time Protocol Length Info
4…
![](../../users/profiles/1791103.webp)
bidifx
- 1,610
- 13
- 17
8
votes
3 answers
Why is random IV fine for AES-CBC but not for AES-GCM
I have been using AES-CBC for encryption and I use a random IV each time I encrypt plain text. As far as I can tell, this is the recommended approach.
I have been looking into AES-GCM / AES-CTR, primarily for the AEAD. I have not yet implemented…
![](../../users/profiles/4365999.webp)
garys
- 75
- 1
- 1
- 4
8
votes
2 answers
Ruby - unsupported cipher algorithm (AES-256-GCM)
I'm getting the error:
unsupported cipher algorithm (AES-256-GCM) (RuntimeError)
But I seem to have all the requirements:
Ruby version:
$ ruby --version
ruby 2.1.2p95
OpenSSL does list gcm:
$ openssl enc -help 2>&1 | grep gcm
-aes-128-ecb …
![](../../users/profiles/3813959.webp)
user3813959
- 83
- 1
- 3
8
votes
2 answers
Adding Zero padding to an array
I am doing a GHASH for the AES-GCM implementation.
and i need to implement this
where v is the bit length of the final block of A, u is the bit length of the final block of C, and || denotes concatenation of bit strings.
How can I do the…
![](../../users/profiles/2988122.webp)
Anne
- 123
- 7
8
votes
1 answer
Data encryption on Android, AES-GCM or plain AES?
My team needs to develop a solution to encrypt binary data (stored as a byte[]) in the context of an Android application written in Java. The encrypted data will be transmitted and stored in various ways, during which data corruption cannot be ruled…
![](../../users/profiles/1084488.webp)
Matthias
- 469
- 1
- 8
- 29
7
votes
1 answer
Difference between IvParameterSpec and GCMParameterSpec with AES/GCM/NoPadding
I am using AES/GCM/NoPadding algorithm to encrypt some data on Android (API 19 and onwards) and then later decrypt it back.
The key size I use is 32 bytes and is provided to me
In addition to the encryption, I also want to know when I try to decrypt…
![](../../users/profiles/9599716.webp)
Droid
- 448
- 5
- 11
7
votes
1 answer
Can PKCS5Padding be in AES/GCM mode?
What's the padding mode for AES/GCM? I understood it can be NoPadding, as in ECB mode it can be PKCS5Padding, how about in GCM mode? in JCE interface, we need provide "algorithm/mode/padding" (Reference).
So I used the following code to get the…
![](../../users/profiles/872501.webp)
C.c
- 1,669
- 5
- 28
- 45