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.

393 questions
3
votes
1 answer

Java AES GCM Tag mismatch

I have a problem with Java AES GCM encryption. I have followed the instructions on this page to generate the following code: package aes; import java.nio.ByteBuffer; import java.security.SecureRandom; import javax.crypto.Cipher; import…
Lukas Nothhelfer
  • 261
  • 1
  • 5
  • 14
3
votes
1 answer

Error decrypting message encrypted using AES/GCM/NoPadding in Android

I'm currently using AES/GCM/NoPadding to perform cipher operations. My encryption code: fun encrypt(plainText: ByteArray, key: Key): ByteArray? { var resultText: ByteArray? = null try { val cipher =…
Jayaprakash Mara
  • 323
  • 4
  • 11
3
votes
1 answer

AES-256-GCM Python cryptography vs Rails OpenSSL

I'm updating a Python script to use cryptography's AESGCM primitive so it can interact with a Rails server running OpenSSL's AES-256-GCM implementation. To begin, I'm simulating an encryption using identical message/key/nonce to see if both…
sscirrus
  • 55,407
  • 41
  • 135
  • 228
3
votes
2 answers

Random access of encrypted data AES GCM mode

There is a very good example for random access AES CTR mode and it works: Random access InputStream using AES CTR mode in android private static final int AES_BLOCK_SIZE = 16; private static IvParameterSpec calculateIVForOffset(final…
saganas
  • 555
  • 4
  • 12
3
votes
1 answer

correct nonce/iv size for AES-GCM mode

EDIT: The issue can be simplified to this: The following Node.js code give an "Invalid IV length" Error. Why? What should the IV be? const crypto = require('crypto') const decipher = crypto.createDecipheriv('aes-128-gcm', crypto.randomBytes(16),…
QuinnFreedman
  • 2,242
  • 2
  • 25
  • 42
3
votes
1 answer

PJSIP build doesn't find OpenSSL AES GCM support

When I try to build PJSIP 2.6 on Lubuntu 16.04 x86_64, it doesn't find AES GCM support, even though I have OpenSSL installed. ./configure | grep -e ssl -e SSL -e crypto checking for OpenSSL installations.. checking openssl/ssl.h usability...…
3
votes
1 answer

Go encryption differs from Ruby encryption using same key and iv

I have the following Ruby code: require 'base64' require 'openssl' data = '503666666' key = '4768c01c4f598828ef80d9982d95f888fb952c5b12189c002123e87f751e3e82' nonce = '4eFi6Q3PX1478767\n' nonce = Base64.decode64(nonce) c =…
content01
  • 3,115
  • 6
  • 41
  • 61
3
votes
1 answer

Tag mismatch error in AES-256-GCM Decryption using Java

I have the following function written in Javascript for encryption using aes-256-gcm: encrypt: function (text, masterkey){ try { // random initialization vector var iv = crypto.randomBytes(12); // random salt var…
Anish Hirlekar
  • 233
  • 1
  • 3
  • 11
3
votes
1 answer

Android Cipher AES/GCM/NoPadding "iv==null"

Trying to encrypt and decrypt some data, on Marshmallow. Encryption works well, but when trying to decrypt, I'm getting a RuntimeException, saying "iv == null". Basically, cipher.getIV() and cipher.getParameters() returns null. Am I missing…
marius bardan
  • 4,962
  • 4
  • 29
  • 32
3
votes
1 answer

Cannot find any provider supporting AES/GCM/NoPadding

We are trying to do encryption supporting AES/GCM/NoPadding in java 7 getting below exception. Cannot find any provider supporting AES/GCM/NoPadding Code sample for generating cipher instance is below. SecretKeySpec eks = new SecretKeySpec(k,…
dReAmEr
  • 6,986
  • 7
  • 36
  • 63
3
votes
1 answer

How to get authentication tag from AES-GCM

I'm using BouncyCastle to encrypt data in C#, using the AES256 GCM algorithm. For this I'm using the implementation provided by James Tuley. Below is a snippet of this code: public byte[] SimpleEncrypt(byte[] secretMessage, byte[] key, byte[]…
Leon Cullens
  • 12,276
  • 10
  • 51
  • 85
3
votes
1 answer

Use of AAD from AES-GCM

I'm working on a for-fun cryptography project in Java. I'm struggling trying to understand Additional Associated Data use. From Cipher documentation and further online research I understood that AAD are appended to encrypted data and authenticated,…
Simone Errico
  • 109
  • 1
  • 4
3
votes
2 answers

Android : AES Encryption & Decryption using GCM mode in android?

I'm trying to Encrypt & Decrypt the String using AES Algorithm & GCM mode. My code is able to encrypt the string but i'm not able to decrypt the encoded data. Steps followed : Create Key() Encrypt(string) Decrypt(encded_data); My Code : Create…
Uday
  • 1,619
  • 3
  • 23
  • 48
3
votes
1 answer

AES-256-GCM mode decryption fails in php

Here's my code:
Pethő Jonatán
  • 308
  • 4
  • 11
3
votes
1 answer

using EVP_aes_128_gcm in openssl for aad with size of not multiple of 16

I am trying to use openssl EVP (EVP_aes_128_gcm) as interface for GMAC. I am testing the code against the NIST's CAVP GCM test vector (http://csrc.nist.gov/groups/STM/cavp/documents/mac/gcmtestvectors.zip). The problem is: when the aad size is…
Tom
  • 321
  • 2
  • 9