Git Product home page Git Product logo

crypto-examples's Introduction

Linux Kernel Crypto API Examples

Testing the crypto samples in the Linux kernel document.

Note: It seems the kernel crypto API v4.14 is different to v4.15+.

You can check the crypto support in kernel by:

cat /proc/crypto

The SHA384 and SHA512 might not be enabled by default, it has to turn on with:

$ make linux-menuconfig
  Cryptographic API โ€”> SHA384 and SHA512 digest algorithm

Built and tested on Debian 9.x (4.14.0-3-amd64).

# cbc-aes-aesni

cd aes-example
make
sudo dmesg -C
sudo insmod aes-example.ko
sudo rmmod aes-example.ko
sudo dmesg

Modified to be built and tested on Debian 9.x (4.14.0-3-amd64).

# shash (SHA1)

cd shash-example
make
sudo dmesg -C
sudo insmod shash-example.ko
sudo rmmod shash-example.ko
sudo dmesg

Cannot get compiled Debian 9.x (4.14.0-3-amd64).

# cbc-aes-aesni

cd aes-example
make
sudo dmesg -C
sudo insmod aes-example.ko
sudo rmmod aes-example.ko
sudo dmesg
# rand

# load drbg module
sudo modprobe drbg

cd rand-example
make
sudo dmesg -C
sudo insmod rand-example.ko
sudo rmmod rand-example.ko
sudo dmesg

Output

[ 2223.280561] test rand loaded
[ 2223.280597] RNG returned no data
[ 2223.280599] get_random_numbers return 0
[ 2223.280600] 10
[ 2223.280600] 58
[ 2223.280600] 77
[ 2223.280601] 69
[ 2223.280601] 48
[ 2223.280602] 19
[ 2223.280602] ca
[ 2223.280602] 43
[ 2223.280603] 2b
[ 2223.280603] a0
[ 2223.280604] de
[ 2223.280604] fa
[ 2223.280604] 88
[ 2223.280605] 63
[ 2223.280605] a3

Reference

crypto-examples's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.