Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fumiama/simple-crypto
A simple c lib to calc md5, tea.
https://github.com/fumiama/simple-crypto
Last synced: 16 days ago
JSON representation
A simple c lib to calc md5, tea.
- Host: GitHub
- URL: https://github.com/fumiama/simple-crypto
- Owner: fumiama
- Created: 2021-12-11T09:39:28.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-29T07:41:10.000Z (over 1 year ago)
- Last Synced: 2024-10-30T17:08:51.661Z (2 months ago)
- Language: C
- Size: 31.3 KB
- Stars: 0
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
```bash
# 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_CRYPTOreal 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.
```bash
# 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_CRYPTOreal 0m1.253s
user 0m1.003s
sys 0m0.243s
```
Our version is `400ms` slower than what system does.# Install
```bash
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.
```c
#include
```
2. Call functions.> see all functions in simplecrypto.h