Topic: How to use AES GCM 128 algorithm

Hi,

I am new to AES GCM 128 algorithm .
I want to use the AES-GCM mode for encryption/decryption and Can you guide me how can i start

Share

Re: How to use AES GCM 128 algorithm

Hi harish.reddy,

We have a good AES CBC example here, which can be adopted to GCM:
https://github.com/wolfSSL/wolfssl-exam … -encrypt.c

Our AES GCM wolfCrypt test is here:
https://github.com/wolfSSL/wolfssl/blob … st.c#L7225

Thanks,
David Garske, wolfSSL

Share

Re: How to use AES GCM 128 algorithm

Hi,



https://github.com/wolfSSL/wolfssl/blob … st.c#L7225

We have tried above program but we are getting following error
   
[Error] wolfssl/version.h: No such file or directory

kindly suggest

Share

Re: How to use AES GCM 128 algorithm

Hi harish,

Where did you download wolfSSL from? Did it come from: https://www.wolfssl.com/download/ or somewhere else?


Warm Regards,

KH

Re: How to use AES GCM 128 algorithm

Hi harish.reddy,

Can you also tell us a bit about the build environment you are using such as compiler, IDE and RTOS?

I'm guessing you are building the sources directly. Make sure you have added the wolfssl-root to your include path. All our code include references the root. `CFLAGS="-I<wolfssl-root>"`. For build configuration I recommend defining `WOLFSSL_USER_SETTINGS` and having your own `user_settings.h` file. You can find a good article for this here:https://www.wolfssl.com/how-do-i-manage-the-build-configuration-of-wolfssl/

Thanks,
David Garske, wolfSSL

Share

Re: How to use AES GCM 128 algorithm

Hi,

7E A0 38 41 00 02 04 01 96 4D 42 E6 E7 00 CC 27 30 00 00 07 06 A9 2A 14 EA 17 A1 18 FE 05 0A A8 47 3C 9C EC 3D B9 24 BE FF 82 80 94 04 0D EC DE 6A 2D C8 E6 7F FF 93 A2 25 7E

I want to decrypt above mentioned encrypted raw data

How can I identify TAG length and data

Share

Re: How to use AES GCM 128 algorithm

Hi harish.reddy,

There is not enough data there to determine that information. Typically the AES GCM IV is 12 bytes. Typically the AES GCM Auth Tag is 16 bytes. Typically the AES GCM Encrypted data is a multiple of block size (16 bytes).

https://github.com/wolfSSL/wolfssl/blob … aes.h#L110

Thanks,
David Garske, wolfSSL

Share