An open API service indexing awesome lists of open source software.

https://github.com/rafael-santiago/linux-crypto-api-aes-gcm-min-sample

A straightforward (complete) sample of how to implement AES-GCM by using Linux crypto API at kernel side
https://github.com/rafael-santiago/linux-crypto-api-aes-gcm-min-sample

aes-gcm complete-sample cryptography documentation linux-crypto-api sample snippet straightforward suckless

Last synced: about 2 months ago
JSON representation

A straightforward (complete) sample of how to implement AES-GCM by using Linux crypto API at kernel side

Awesome Lists containing this project

README

        

# AES/GCM min sample

This is an attempt of producing a sane and well-explained tiny code to show how to use (minimally)
``AES-256/GCM`` into ``Linux kernel crypto api``. Instead of wasting hours grasping into code that
does not matter directly to your task.

I have waste some time on it and I hope you waste less of your time from now on.

>"A good idea is an orphan without effective communication" -- Andrew Hunt, The Pragmatic Programmer.

Have you found issues? Please, let me [know](https://github.com/rafael-santiago/linux-crypto-api-aes-gcm-min-sample/issues) and
thank you!

## How can I clone it?

```
_ git clone https://github.com/rafael-santiago/linux-crypto-api-aes-gcm-min-sample
```

All code is within ``src`` subdirectory.

## How can I build?

```
cd src
make
```

If the build has succeeded you will got ``aes-gcm-min-sample.ko`` module.

## How can I test it?

It is just about inserting the produced ``LKM``. Supposing your ``cwd`` is the ``src`` subdirectory:

```
_ insmod ./aes-gcm-min-sample.ko
```

Watch the results by executing ``dmesg``.

If the encryption and decryption was done, the kernel module has inserted, so you need to remove it:

```
_ rmmod aes-gcm-min-sample
```

So folks, that's all!
I hope it be useful and saves your time ;)