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
- Host: GitHub
- URL: https://github.com/rafael-santiago/linux-crypto-api-aes-gcm-min-sample
- Owner: rafael-santiago
- License: gpl-2.0
- Created: 2022-02-02T23:12:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-06T00:39:40.000Z (over 2 years ago)
- Last Synced: 2025-03-26T01:51:06.796Z (2 months ago)
- Topics: aes-gcm, complete-sample, cryptography, documentation, linux-crypto-api, sample, snippet, straightforward, suckless
- Language: C
- Homepage:
- Size: 12.7 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
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 ;)