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
2
votes
1 answer

C AES-GCM Decryption of ESP packet not working

I'm trying to decrypt my ESP packet encrypted with AES128-GCM12. I used c openssl library for decryption. But decrypted result is wrong! I used two Linux 18.04 VM for simulating ESP packet with strongswan IPsec. I captured ESP packet and printed my…
Jaemin Jo
  • 45
  • 1
  • 8
2
votes
1 answer

How to AES GCM Encrypt / Decrypt using LibTom

LibTom is a great comprehensive library for crypto and math operations in C/C++. https://www.libtom.net/LibTomCrypt/ The documentation has been written from the perspective of the developer who wrote the library, so some of the examples are less…
DanielG
  • 370
  • 1
  • 3
  • 15
2
votes
2 answers

How to calculate AES GCM IV for specific block

I use AES CTR to encrypt our documents for now. This is done to provide ability to make range-requests to encrypted documents. With AES CTR it is possible to calculate IV for specific block by simple function like that: private static int…
Vengrovskyi
  • 307
  • 1
  • 4
  • 9
2
votes
1 answer

AES GCM decryption without authentication tag

I have a question. In my limited experience with Cryptography. how to decrypt AES-128-GCM without authentication tag. I found AES GCM decryption bypassing authentication in JAVA it seems to have solved some problems. But only if iv is equal to 96…
屠若尘
  • 23
  • 1
  • 5
2
votes
1 answer

Can I send unencrypted nonce in AES-GCM?

I'm implementing AES-GCM in a simple chat. Since there is no problem in the nonce being public and I need to change it in every message, can I send the message nonce unencrypted with the message itself? An example: There is a function like…
2
votes
1 answer

gcm cipher mode in android

I use AES GCM cipher mode encryption, the code run without any problem in java but, at android exception error appears W/System.err: java.security.InvalidAlgorithmParameterException: unknown parameter type. W/System.err: at …
Sherif Awad
  • 171
  • 2
  • 10
2
votes
1 answer

PHP AES 128 bit encryption/decryption

I'm trying to understand how to AES encrypt a piece of text(16 bytes - 128 bits). This code is from php manual: $key = openssl_random_pseudo_bytes(32); $plaintext = "message to be encrypted"; $cipher = "aes-128-gcm"; if (in_array($cipher,…
emma
  • 761
  • 5
  • 20
2
votes
1 answer

What is the Secure Enclave ECIES Encrypted data format?

I created a assymetric EC key pair in secure enclave (). The public key of the key pair will be sent to my backend service which then uses it to encrypt the data (kSecKeyAlgorithmECIESEncryptionCofactorX963SHA512AESGCM). The encrypted data will be…
2
votes
1 answer

AES GCM mechanism parameters in C

I am having problem setting the parameters for the AES GCM mechanism. I am receving the following error #define CKR_MECHANISM_PARAM_INVALID 0x00000071UL What am I doing wrong? CK_BYTE iv[12] = { 0 }; CK_MECHANISM mechanismAES = {…
Hskctity
  • 23
  • 3
2
votes
0 answers

Implementing AES-GCM with 128-bit blocks and 256-bit key

I do not usually work with encryption but I need to use AES-GCM algorythm in C# with 128-bit blocks and 256-bit key. I already read many articles about it but I can't find a valid…
Emanuele
  • 648
  • 12
  • 33
2
votes
1 answer

Cipher returns entire file in one large block

We're using Cipher and CipherInputStream in an Android app to decrypt files downloaded from a server. For some reason, all the calls to Cipher.update return an empty block and the call to Cipher.doFinal returns the entire file in one block. This…
daramasala
  • 3,040
  • 2
  • 26
  • 33
2
votes
0 answers

Nodejs, Crypto: Encrypting multiple strings using same cipher

I am trying to encrypt multiple strings using same cipher with the code var iv = _crypto.randomBytes(16).slice(0, 12); var salt = _crypto.randomBytes(64); var key = _crypto.pbkdf2Sync(symmetricKey, salt, 2145, 32, 'sha512'); var cipher =…
2
votes
1 answer

AES GCM decryption bypassing authentication in JAVA

I have some AES/GCM encrypted data and wanted to decrypt it. I want to decrypt it bypassing authentication as the data does not contain authentication information(Data is encrypted by a third party application). I tried decryption with javax.crypto …
Dijesh
  • 334
  • 2
  • 11
2
votes
1 answer

How to verify a GMAC?

According to section 5.2 (Two GCM Functions) of the Recommendation for Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC, it mentions that for the case of GMAC, the authenticated encryption and decryption functions become the…
ktulinho
  • 3,870
  • 9
  • 28
  • 35
2
votes
1 answer

Unsupported state or unable to authenticate data error when using NodeJS (with Typescript) streams and aes-gcm algorithm

When trying to encrypt and decrypt a file through a Cipher/Decipher stream I always encounter the following error: Unsupported state or unable to authenticate data. This is the code (comparison between the stream and the not-stream versions): Non…
Marco Moschettini
  • 1,555
  • 2
  • 16
  • 26