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]
393 questions
2
votes
1 answer
AES-GCM: #C Microsoft Class additional authenticated data"(AAD)"
I am trying to implement AES-GCM encryption but when comes to
cipher.Encrypt(_iv, toEncrypt, cipherText, tag, associatedData);
I realize that I also need to implement the associated data, this is a byte[] data type, anyone has an idea in terms of…

jy824212
- 37
- 8
2
votes
1 answer
WebCrypto API: DOMException: The provided data is too small
I want to decrypt a message on the client-side(react.js) using Web Crypto API which is encrypted on the back-end(node.js), however I ran into a weird problem and don't have any idea what is wrong(I also checked this)
node.js
function…

Shahin Ghasemi
- 1,600
- 1
- 20
- 38
2
votes
1 answer
Encrypt a big file that does not fit in RAM with AES-GCM
This code works for a file myfile which fits in RAM:
import Crypto.Random, Crypto.Cipher.AES # pip install pycryptodome
nonce = Crypto.Random.new().read(16)
key = Crypto.Random.new().read(16) # in reality, use a key derivation function, etc. ouf…

Basj
- 41,386
- 99
- 383
- 673
2
votes
2 answers
How to programatically decrypt a AES256-GCM96 cipher text generated by Vault and export Vault keys?
I am trying to back up my Vault keys I am using to encrypt/decrypt my data. The official doc says that in order to read the keys I should execute the following command line:
$ vault read transit/keys/orders
Key Value
--- …

404NotFound
- 65
- 7
2
votes
1 answer
Possible to encrypt non-multiple of 16 bytes when chaining BCryptEncrypt calls using AES in GCM mode?
Is it possible, using Windows CNG API and AES in GCM mode, to encrypt a buffer of data with a size that is not a multiple of 16 bytes (128 bits) when chaining is enabled?
When I try to pass a buffer of 60 bytes to the BCryptEncrypt function with…

Pineapple
- 61
- 1
- 4
2
votes
1 answer
Generating AES 256 GCM secret using a given key in python
I am trying to Implement AES encryption in python.
I am referring a java code sample in order to accomplish this.
In Java, the 256 bit secret (using the given key) is generated using
Key secretKey = new SecretKeySpec(Base64.decodeBase64(GIVEN_KEY),…

Hrishi
- 1,424
- 1
- 13
- 29
2
votes
2 answers
java.security.InvalidAlgorithmParameterException: GCM can not be used with class javax.crypto.spec.GCMParameterSpec
I'm Encrypting the data with "AES/GCM/NoPadding" algorithm, before cipher init method I'm getting java.security.InvalidAlgorithmParameterException: GCM can not be used with class javax.crypto.spec.GCMParameterSpec error, is there any specific reason…

Surendra Naidu
- 21
- 1
- 4
2
votes
1 answer
AES-GCM decryption in C
I have token (base64url) that i need to decrypt with aes-gcm. The token contains:
16 bytes for IV, 17 bytes for TAG and the rest is the binary that needs to be decrypted.
I can't seem to be able to figure out, this is my code:
{
unsigned char *…

David Villasmil
- 395
- 2
- 19
2
votes
1 answer
NodeJs encrypt using pbkdf2Sync and decrypt in java
I encrypt some data in NodeJs using below method. It works fine on Nodejs server to encrypt and decrypt.
Input for encryption = "SIYdcYSyiWY5XUqYMrfv31sPF8DSojs1ikghMs4R"
Encrypted Output in NodeJS =…

Mohamed Adel
- 41
- 2
2
votes
0 answers
OpenJDK 7 GCM support like in Oracle JDK?
Oracle JDK 7 supports GCM since version 7u191 (https://www.oracle.com/technetwork/java/javase/2col/7u191-bugfixes-4489527.html)
In the openJDK Bugtracker, they mention they fixed it. (https://bugs.openjdk.java.net/browse/JDK-8200684)
But I checked…

Bertl
- 605
- 5
- 10
2
votes
0 answers
AES-GCM encryption compatibility between android/java and web/javascript
Problem definition: I need to be able to encrypt and decrypt data on Android platform and on web interchangeably. Right now, my solution is working platform specifically i.e web encrypted data can be decrypted on web only and failing on android with…

NotABot
- 781
- 7
- 24
2
votes
1 answer
unable to decrypt data in Node which is encrypted in Java using AES-GCM-256
I am trying to make an API in node.js which decrypts the input that is created by using AES-GCM-256 algo, I am using the same algo in JAVA to encrypt the code but i am not able to decrypt it using node.js
I Have tried many approaches but i am stuck…

Danny Galiyara
- 197
- 2
- 8
2
votes
1 answer
BadPaddingException: mac check in GCM failed
I am trying to encrypt/decrypt using AES-GCM and JDK 1.8 CipherOutputStream, But getting BadPaddingException during decryption. I am using same IV and secret key during encryption and decryption, but not sure what is going wrong. Please see the code…

Dexter
- 158
- 2
- 8
2
votes
2 answers
Unable to decrypt aes-192-gcm
I'm using nodejs to encrypt and decrypt aes-192-gcm
here's my code:
const encrypted = decrypt.encryptText('aes-192-gcm', 'FnpkKuIoqZL5B3tnE0Htmg==', '1z3FtB6OitmFOIsP', 'helloWorld', 'base64');
const de = decrypt.decryptText('aes-192-gcm',…
Jeniffer
2
votes
1 answer
AEADBadTagException while decrypting
I have found many similar questions here, but none of the suggestions worked for me. I am encrypting user password with keystore while logging to the application and trying to decrypt in some other part of my application. Encryption is working…

visakh r
- 175
- 1
- 11