https://github.com/onyazuka/desu
DES encryption + Triple DES + Multithread version
https://github.com/onyazuka/desu
cpp cryptography des fast
Last synced: 5 months ago
JSON representation
DES encryption + Triple DES + Multithread version
- Host: GitHub
- URL: https://github.com/onyazuka/desu
- Owner: onyazuka
- Created: 2018-09-26T20:23:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-27T08:03:39.000Z (about 7 years ago)
- Last Synced: 2025-05-15T17:13:43.397Z (5 months ago)
- Topics: cpp, cryptography, des, fast
- Language: C++
- Homepage:
- Size: 2.37 MB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DESu DES
DES encryption + Triple DES + Multithread versionOverview
C++ implementation of DES - Data Encryption Standart algorithm.
Supports Triple DES, also can use some of your cores.
Tested and optimized for msvc 2017 and gcc.
MSVC compilation
- Download repository
- Run DES.sln
- Press Ctrl+F5
- Enjoy
Usage
Usage: DES mode [settings] keys_file input_file output_file
Key file generation for DES: DES -g 1 keyfile_name
Key file generation for Triple-DES: DES -g 3 keyfile_name
Modes
-g
key file generation
-e
encryptiont mode
-d
decryption mode
Settings
-3 eee3
Triple DES (DES-EEE3)
-3 ede3
Triple DES (DES-EDE3)
-mt
Multithread mode
Examples
Example: using command-line utility for encrypting
Generating key file
DES -g 1 keys.keyEncrypting file
DES -e keys.key input.bin input.encDecrypting file
DES -d keys.key input.enc input_decrypted.binEncrypting Triple DES EEE3
DES -e -3 eee3 keys.key input.bin input.encUsing multithreading
DES -e -3 eee3 -mt keys.key input.bin input.encExample: encrypt raw block of data
Here we are just using DESEncrypter class from DES.h
#include "DES.h"
uint64_t data = //...your data;
uint64_t key = //...your key;
DESEncrypter encr{ data, key, DESEncrypter::Mode::ENCRYPT };
uint64_t output = encr.run(); //your encrypted dataExample: decrypt raw block of data
#include "DES.h"
uint64_t data = //...your data;
uint64_t key = //...your key;
DESEncrypter encr{ data, key, DESEncrypter::Mode::DECRYPT };
uint64_t output = encr.run(); //your encrypted dataExample: encrypring file
Here you should initialize instance of File_Crypter from DESFileCrypt.h
#include "DESFileCrypt.h"
fc = File_Crypter{};
fc.ifname = "/foo/bar" // file you want to encrypt
fc.kname = "/foo/keys" // file
fc.ofname = "/foo/output" // output file
fc.read_keys(); // reads keys from keyfile and populates fc object with it
fc.mode = fc.Encrypt; // fc.Encrypt or fc.Decrypt
fc.triple_des = true; // if you want Triple_DES
fc.set_triple_des_mode(fc.EEE3); // if you want Triple_DES
fc.multithread = true; // if you want multithread
fc.run();