1
0
mirror of https://github.com/fumiama/simple-crypto.git synced 2026-06-05 01:50:24 +08:00
2023-07-29 15:41:04 +08:00
2021-05-29 13:58:23 +08:00
2023-07-29 15:41:04 +08:00
2022-10-14 20:32:52 +08:00
2023-07-29 15:41:04 +08:00
2023-07-08 20:00:02 +08:00
2022-10-14 20:32:52 +08:00
2023-07-29 15:41:04 +08:00

simple-crypto

Simple C lib of the MD5 & TEA algorithm

Performance

Benchmark a 3.5MB file comparing with md5 command in MacOS Mojave by running three times time command then calculating their average.

# system command: total 22ms
real    0m0.015s
user    0m0.012s
sys     0m0.005s

# our md5 command: total 39ms
# build by
gcc md5.c -o md5 -O3 -DTEST_SIMPLE_CRYPTO

real    0m0.021s
user    0m0.013s
sys     0m0.005s

Our version is 17ms slower than what system does.

Benchmark a 481.7MB file comparing with md5 command in MacOS Mojave by running three times time command then calculating their average.

# system command: total 2079ms
real    0m0.980s
user    0m0.964s
sys     0m0.135s

# our md5 command: total 2499ms
# build by
gcc md5.c -o md5 -O3 -DTEST_SIMPLE_CRYPTO

real    0m1.253s
user    0m1.003s
sys     0m0.243s

Our version is 400ms slower than what system does.

Install

git clone https://github.com/fumiama/simple-crypto.git
cd simple-crypto
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE:STRING=Release ..
cmake --build . --config Release --target all --
cmake --install .

Usage

  1. Include simplecrypto.h in your c program.
#include <simplecrypto.h>
  1. Call functions.

see all functions in simplecrypto.h

Description
A simple c lib to calc md5, tea.
Readme 85 KiB
Languages
C 96.2%
CMake 3.8%