Questions tagged [aes-gcm]

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.

309 questions
4
votes
1 answer

Android - javax.crypto.AEADBadTagException

I'm currently getting an AEADBadTagException when trying to decrypt a file I have encrypted. I have searched pretty much everywhere on stackoverflow and unable to find a solution, and hoping there is just a small mistake I have made or something to…
FalseNull
  • 121
  • 1
  • 8
4
votes
1 answer

Cannot decrypt AES-256 GCM with Java

I have a node module that can both encrypt and decrypt with AES-256 GCM. Now I am also trying to decrypt with Java whatever the node module encrypts, but I keep getting a AEADBadTagException. I have tested the node module by itself and can confirm…
bitscuit
  • 844
  • 1
  • 8
  • 22
4
votes
3 answers

GCMParameterSpec throws InvalidAlgorithmParameterException: unknown parameter type

I am doing android data encryption to save in SharedPreferences. GCMParameterSpec was introduced in Android in API 19 which I'm using for AES/GCM/NoPadding encryption. This is how I'm implementing it: Cipher c =…
Ricardo
  • 7,598
  • 3
  • 26
  • 33
4
votes
1 answer

GCM encryption and decryption in xws-security (webservices-rt)

I've successfully implemented support for GCM encryption in xws-security (EncryptionProcessor.java) using JDK8 as tested against other systems. However I have a problem with decryption. The first problem was as…
tkr
  • 73
  • 1
  • 6
4
votes
0 answers

xmlsec with AES-GCM

I have compiled the newest release of XMLSec from https://www.aleksey.com/xmlsec/news.html in a cygwin enviroment. Now i am following this example to encrypt a XML file using a session key and digital signatures.…
chenino
  • 424
  • 1
  • 7
  • 18
4
votes
3 answers

Is it possible to use AES128 with GCM mode on iOS?

So my question for you stackoverflow geniuses is: if there a way (native, library, framework, whatever..) to encrypt data with AES (preferably 128 but could be 256 too) using a strong Authenticated encryption algorithm, let's say GCM mode? Question…
tanou
  • 1,023
  • 1
  • 12
  • 33
4
votes
2 answers

Adding additional authenticated data to AES-GCM on Android

I'm trying to add the additional authenticated data (AAD) to AES-GCM on Android. I see the Java 7 version of Cipher notes about using GCMParameterSpec and the updateAAD(...) method but given Android is Java 6 based I'm all out of ideas. I'm using…
scottyab
  • 21,990
  • 15
  • 91
  • 102
4
votes
1 answer

Decryption of AES-GCM files using openssl

I'm currently trying to decrypt a given text using openssl. I tried to make my own code using the example given there : Late authentication in OpenSSL GCM decryption but i still have a bad result in the end. My decryption function is as followed…
4
votes
1 answer

Late authentication in OpenSSL GCM decryption

I am using OpenSSL's EVP interfaces to implement AES encryption using GCM mode. Now GCM, being one of the authentication modes, provides cipher text integrity. Meaning it generates a tag (MAC - message authentication code) on the cipher text (and…
sg1
  • 337
  • 1
  • 3
  • 20
4
votes
1 answer

BouncyCastle GCM/CCM ArrayIndexOutOfBoundsException

can anyone give me an example for using GCM and/or CCM modes with AES in BouncyCastle? My code is this: SecretKeySpec key = new SecretKeySpec(keyBytes, "AES"); IvParameterSpec ivSpec = new IvParameterSpec(ivBytes); Cipher cipher =…
RYN
  • 13,462
  • 29
  • 105
  • 163
3
votes
1 answer

Decrypt an encrypted message with AES GCM in Python

I use the AES method to encrypt a sentance called from a txt file. I used the GCM Mode and created a specific key too. Everything is working (the code is below). from Crypto.Cipher import AES from Crypto.Protocol.KDF import scrypt from…
Julien
  • 117
  • 1
  • 12
3
votes
1 answer

Different generated Ciphertext from AES-CTR & AES-GCM

To verify my understanding on AES-GCM & AES-CTR modes, I'm creating a simple example using python Crpyto.Cipher library. I'm expecting the same ciphertext is generated from both modes where both are using CTR method. Since my intention is just to…
Pi-Turn
  • 127
  • 3
  • 11
3
votes
0 answers

Java large file AES Encryption is very slow

I'm trying to encrypt a 512 Mb file with AES/CBC algorithm. It is taking around 7 sec which is too much. How to reduce the encryption time and make it faster. I'm using a fixed key and tried using CipherOutStream as well as cipher.update() instead…
3
votes
1 answer

AES-GCM 256 decryption fails even with correct data

I have a given encrypted message (decrypted, it is "encrypted secret message") and I'm trying to retrieve this original string from the AES-GCM 256 encrypted one. I use the aes-gcm crate to do this: use aes_gcm::Aes256Gcm; use aead::{Aead, NewAead,…
CypElf
  • 85
  • 1
  • 8
3
votes
1 answer

Encrypting large byte array

I am using a Cipher for encryption/decryption. It has always been fine, but now I am having problem when dealing with large array bytes. This is my implementation: val cipher = Cipher.getInstance("AES/GCM/NoPadding") cipher.init(Cipher.ENCRYPT_MODE,…
GVillani82
  • 16,419
  • 26
  • 96
  • 162
1 2
3
20 21