All Projects → chronoxor → CppSecurity

chronoxor / CppSecurity

Licence: MIT license
C++ Security Library

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to CppSecurity

CryptoKnight
CryptoKnight is a general purpose cryptography desktop app
Stars: ✭ 18 (-25%)
Mutual labels:  aes, scrypt, password-generator, bcrypt
phc-crypto
Hashing algorithms simplified (supports Argon2, Bcrypt, Scrypt, and PBKDF2)
Stars: ✭ 22 (-8.33%)
Mutual labels:  scrypt, argon2, pbkdf2, bcrypt
hash-wasm
Lightning fast hash functions using hand-tuned WebAssembly binaries
Stars: ✭ 382 (+1491.67%)
Mutual labels:  scrypt, argon2, pbkdf2, bcrypt
crypthash-net
CryptHash.NET is a .NET multi-target library to encrypt/decrypt/hash/encode/decode strings and files, with an optional .NET Core multiplatform console utility.
Stars: ✭ 33 (+37.5%)
Mutual labels:  aes, argon2, bcrypt
Forge
A native implementation of TLS in Javascript and tools to write crypto-based and network-heavy webapps
Stars: ✭ 4,204 (+17416.67%)
Mutual labels:  aes, cipher, pbkdf2
Password4j
Password4j is a user-friendly cryptographic library that supports Argon2, Bcrypt, Scrypt, PBKDF2 and various cryptographic hash functions.
Stars: ✭ 124 (+416.67%)
Mutual labels:  scrypt, argon2, bcrypt
jscrypto
Crypto library for Node/ES6/Typescript/Browser.
Stars: ✭ 20 (-16.67%)
Mutual labels:  aes, cipher
FlashPaper
One-time encrypted password/secret sharing
Stars: ✭ 85 (+254.17%)
Mutual labels:  aes, bcrypt
TripleSecManaged
A C# port of the TripleSec encryption scheme created by Chris Coyne, Maxwell Krohn, and Filippo Valsorda
Stars: ✭ 18 (-25%)
Mutual labels:  aes, scrypt
weweibuy-framework
基于Springboot 封装的基础组件, 包括: Http请求响应日志,日志脱敏,APM, 加解密,签名(AES,BCrypt,RSA,JWT),数据库脱敏,报文脱敏,下滑线风格URL传参,统一异常处理,feign mock,feign日志,feign报文风格转换,跨应用异常上抛,自动补偿组件,幂等组件,RocketMq客户端
Stars: ✭ 24 (+0%)
Mutual labels:  aes, bcrypt
WebCrypto.swift
A small collection of cryptographic functions based on the JavaScript WebCrypto API.
Stars: ✭ 16 (-33.33%)
Mutual labels:  aes, cipher
AES
AES for microcontrollers (Arduino & Raspberry pi)
Stars: ✭ 116 (+383.33%)
Mutual labels:  aes, cipher
Siv Mode
RFC 5297 SIV mode of operation in Java
Stars: ✭ 22 (-8.33%)
Mutual labels:  aes, cipher
webcrypto
A WebCrypto Polyfill for NodeJS
Stars: ✭ 111 (+362.5%)
Mutual labels:  aes, pbkdf2
OormiPass
Free open source cross platform password manager
Stars: ✭ 50 (+108.33%)
Mutual labels:  aes, password-generator
cryptorious
CLI Password Manager
Stars: ✭ 15 (-37.5%)
Mutual labels:  aes, password-generator
Phoenix Ecto Encryption Example
🔐 A detailed example for how to encrypt data in a Phoenix (Elixir) App before inserting into a database using Ecto Types
Stars: ✭ 166 (+591.67%)
Mutual labels:  aes, argon2
Js Ethereum Cryptography
Every cryptographic primitive needed to work on Ethereum, for the browser and Node.js
Stars: ✭ 83 (+245.83%)
Mutual labels:  aes, scrypt
Encrypt
🔒 A set of high-level APIs over PointyCastle for two-way cryptography.
Stars: ✭ 199 (+729.17%)
Mutual labels:  aes, cipher
cryptopocket
🔐 Encrypt anything, then Decrypt by providing a required key.
Stars: ✭ 22 (-8.33%)
Mutual labels:  aes, password-generator

CppSecurity

Linux (clang) Linux (gcc)
MacOS
Windows (Cygwin) Windows (MSYS2) Windows (MinGW) Windows (Visual Studio)

C++ Security Library provides different security functionality for password generation, password hashing algorithms and Google Authenticator.

CppSecurity API reference

Contents

Features

Requirements

Optional:

How to build?

Linux: install required packages

sudo apt-get install -y binutils-dev uuid-dev libssl-dev

Install gil (git links) tool

pip3 install gil

Setup repository

git clone https://github.com/chronoxor/CppSecurity.git
cd CppSecurity
gil update

Linux

cd build
./unix.sh

MacOS

cd build
./unix.sh

Windows (Cygwin)

cd build
unix.bat

Windows (MSYS2)

cd build
unix.bat

Windows (MinGW)

cd build
mingw.bat

Windows (Visual Studio)

cd build
vs.bat

Security benchmarks

Benchmark 1: Password generator

Benchmark source file: password_generator.cpp

Benchmark report is the following:

===============================================================================
CppBenchmark report. Version 1.0.0.0
===============================================================================
CPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
CPU logical cores: 8
CPU physical cores: 4
CPU clock speed: 3.998 GHz
CPU Hyper-Threading: enabled
RAM total: 31.962 GiB
RAM free: 24.476 GiB
===============================================================================
OS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit
OS bits: 64-bit
Process bits: 64-bit
Process configuaraion: release
Local timestamp: Wed Jun 12 01:55:58 2019
UTC timestamp: Tue Jun 11 22:55:58 2019
===============================================================================
Benchmark: Generate password
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: Generate password
Average time: 73.490 mcs/op
Minimal time: 73.490 mcs/op
Maximal time: 76.286 mcs/op
Total time: 4.925 s
Total operations: 67019
Operations throughput: 13607 ops/s
===============================================================================
Benchmark: Validate password
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: Validate password
Average time: 19 ns/op
Minimal time: 19 ns/op
Maximal time: 20 ns/op
Total time: 1.944 s
Total operations: 97525818
Operations throughput: 50161060 ops/s
===============================================================================

Benchmark 2: Google Authenticator

Benchmark source file: google_authenticator.cpp

Benchmark report is the following:

===============================================================================
CppBenchmark report. Version 1.0.0.0
===============================================================================
CPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
CPU logical cores: 8
CPU physical cores: 4
CPU clock speed: 3.998 GHz
CPU Hyper-Threading: enabled
RAM total: 31.962 GiB
RAM free: 24.470 GiB
===============================================================================
OS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit
OS bits: 64-bit
Process bits: 64-bit
Process configuaraion: release
Local timestamp: Wed Jun 12 01:57:37 2019
UTC timestamp: Tue Jun 11 22:57:37 2019
===============================================================================
Benchmark: Generate Google Authenticator secret
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: Generate Google Authenticator secret
Average time: 75.167 mcs/op
Minimal time: 75.167 mcs/op
Maximal time: 77.377 mcs/op
Total time: 4.882 s
Total operations: 64960
Operations throughput: 13303 ops/s
===============================================================================
Benchmark: Generate Google Authenticator token
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: Generate Google Authenticator token
Average time: 1.244 mcs/op
Minimal time: 1.244 mcs/op
Maximal time: 1.260 mcs/op
Total time: 4.847 s
Total operations: 3894253
Operations throughput: 803368 ops/s
===============================================================================

Benchmark 3: 'PBKDF2' password hashing algorithm

Benchmark source file: password_hashing_pbkdf2.cpp

Benchmark report is the following:

===============================================================================
CppBenchmark report. Version 1.0.0.0
===============================================================================
CPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
CPU logical cores: 8
CPU physical cores: 4
CPU clock speed: 3.998 GHz
CPU Hyper-Threading: enabled
RAM total: 31.962 GiB
RAM free: 17.1017 GiB
===============================================================================
OS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit
OS bits: 64-bit
Process bits: 64-bit
Process configuaraion: release
Local timestamp: Thu Jun  6 02:52:55 2019
UTC timestamp: Wed Jun  5 23:52:55 2019
===============================================================================
Benchmark: 'PBKDF2' generate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'PBKDF2' generate
Average time: 491.718 mcs/op
Minimal time: 491.718 mcs/op
Maximal time: 507.445 mcs/op
Total time: 4.933 s
Total operations: 10034
Operations throughput: 2033 ops/s
===============================================================================
Benchmark: 'PBKDF2' validate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'PBKDF2' validate
Average time: 403.262 mcs/op
Minimal time: 403.262 mcs/op
Maximal time: 412.173 mcs/op
Total time: 4.976 s
Total operations: 12341
Operations throughput: 2479 ops/s
===============================================================================

Benchmark 4: 'bcrypt' password hashing algorithm

Benchmark source file: password_hashing_bcrypt.cpp

Benchmark report is the following:

===============================================================================
CppBenchmark report. Version 1.0.0.0
===============================================================================
CPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
CPU logical cores: 8
CPU physical cores: 4
CPU clock speed: 3.998 GHz
CPU Hyper-Threading: enabled
RAM total: 31.962 GiB
RAM free: 17.921 GiB
===============================================================================
OS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit
OS bits: 64-bit
Process bits: 64-bit
Process configuaraion: release
Local timestamp: Thu Jun  6 02:59:34 2019
UTC timestamp: Wed Jun  5 23:59:34 2019
===============================================================================
Benchmark: 'bcrypt' generate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'bcrypt' generate
Average time: 950.807 mcs/op
Minimal time: 950.807 mcs/op
Maximal time: 960.204 mcs/op
Total time: 4.986 s
Total operations: 5245
Operations throughput: 1051 ops/s
===============================================================================
Benchmark: 'bcrypt' validate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'bcrypt' validate
Average time: 862.694 mcs/op
Minimal time: 862.694 mcs/op
Maximal time: 867.637 mcs/op
Total time: 4.988 s
Total operations: 5783
Operations throughput: 1159 ops/s
===============================================================================

Benchmark 5: 'scrypt' password hashing algorithm

Benchmark source file: password_hashing_scrypt.cpp

Benchmark report is the following:

===============================================================================
CppBenchmark report. Version 1.0.0.0
===============================================================================
CPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
CPU logical cores: 8
CPU physical cores: 4
CPU clock speed: 3.998 GHz
CPU Hyper-Threading: enabled
RAM total: 31.962 GiB
RAM free: 18.052 GiB
===============================================================================
OS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit
OS bits: 64-bit
Process bits: 64-bit
Process configuaraion: release
Local timestamp: Thu Jun  6 02:42:32 2019
UTC timestamp: Wed Jun  5 23:42:32 2019
===============================================================================
Benchmark: 'scrypt' generate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'scrypt' generate
Average time: 956.991 mcs/op
Minimal time: 956.991 mcs/op
Maximal time: 982.195 mcs/op
Total time: 4.983 s
Total operations: 5207
Operations throughput: 1044 ops/s
===============================================================================
Benchmark: 'scrypt' validate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'scrypt' validate
Average time: 857.232 mcs/op
Minimal time: 857.232 mcs/op
Maximal time: 916.809 mcs/op
Total time: 4.781 s
Total operations: 5578
Operations throughput: 1166 ops/s
===============================================================================

Benchmark 6: 'Argon2' password hashing algorithm

Benchmark source file: password_hashing_argon2.cpp

Benchmark report is the following:

===============================================================================
CppBenchmark report. Version 1.0.0.0
===============================================================================
CPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
CPU logical cores: 8
CPU physical cores: 4
CPU clock speed: 3.998 GHz
CPU Hyper-Threading: enabled
RAM total: 31.962 GiB
RAM free: 18.026 GiB
===============================================================================
OS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit
OS bits: 64-bit
Process bits: 64-bit
Process configuaraion: release
Local timestamp: Thu Jun  6 02:45:53 2019
UTC timestamp: Wed Jun  5 23:45:53 2019
===============================================================================
Benchmark: 'Argon2d' generate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'Argon2d' generate
Average time: 824.018 mcs/op
Minimal time: 824.018 mcs/op
Maximal time: 844.418 mcs/op
Total time: 4.932 s
Total operations: 5986
Operations throughput: 1213 ops/s
===============================================================================
Benchmark: 'Argon2d' validate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'Argon2d' validate
Average time: 744.765 mcs/op
Minimal time: 744.765 mcs/op
Maximal time: 791.891 mcs/op
Total time: 4.778 s
Total operations: 6416
Operations throughput: 1342 ops/s
===============================================================================
Benchmark: 'Argon2i' generate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'Argon2i' generate
Average time: 851.280 mcs/op
Minimal time: 851.280 mcs/op
Maximal time: 921.955 mcs/op
Total time: 4.768 s
Total operations: 5601
Operations throughput: 1174 ops/s
===============================================================================
Benchmark: 'Argon2i' validate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'Argon2i' validate
Average time: 747.924 mcs/op
Minimal time: 747.924 mcs/op
Maximal time: 764.430 mcs/op
Total time: 4.961 s
Total operations: 6634
Operations throughput: 1337 ops/s
===============================================================================
Benchmark: 'Argon2id' generate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'Argon2id' generate
Average time: 828.117 mcs/op
Minimal time: 828.117 mcs/op
Maximal time: 858.997 mcs/op
Total time: 4.935 s
Total operations: 5960
Operations throughput: 1207 ops/s
===============================================================================
Benchmark: 'Argon2id' validate
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: 'Argon2id' validate
Average time: 738.366 mcs/op
Minimal time: 738.366 mcs/op
Maximal time: 791.300 mcs/op
Total time: 4.698 s
Total operations: 6363
Operations throughput: 1354 ops/s
===============================================================================

Benchmark 7: Cipher

Benchmark source file: cipher.cpp

Benchmark report is the following:

===============================================================================
CppBenchmark report. Version 1.0.3.0
===============================================================================
CPU architecture: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
CPU logical cores: 8
CPU physical cores: 4
CPU clock speed: 2.112 GHz
CPU Hyper-Threading: enabled
RAM total: 15.387 GiB
RAM free: 5.900 GiB
===============================================================================
OS version: Microsoft Windows 10 Enterprise Edition (build 18363), 64-bit
OS bits: 64-bit
Process bits: 64-bit
Process configuration: release
Local timestamp: Sun Nov 20 23:06:31 2022
UTC timestamp: Sun Nov 20 19:06:31 2022
===============================================================================
Benchmark: Cipher encrypt
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: Cipher encrypt
Average time: 182 ns/op
Minimal time: 175 ns/op
Maximal time: 188 ns/op
Total time: 3.819 s
Total operations: 20915100
Operations throughput: 5475649 ops/s
===============================================================================
Benchmark: Cipher decrypt
Attempts: 5
Duration: 5 seconds
-------------------------------------------------------------------------------
Phase: Cipher decrypt
Average time: 292 ns/op
Minimal time: 201 ns/op
Maximal time: 297 ns/op
Total time: 3.207 s
Total operations: 10983063
Operations throughput: 3423788 ops/s
===============================================================================
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].