{"id":20585738,"url":"https://github.com/chronoxor/cppsecurity","last_synced_at":"2026-02-28T04:59:21.601Z","repository":{"id":83989717,"uuid":"190162660","full_name":"chronoxor/CppSecurity","owner":"chronoxor","description":"C++ Security Library","archived":false,"fork":false,"pushed_at":"2024-03-09T10:34:45.000Z","size":64316,"stargazers_count":39,"open_issues_count":1,"forks_count":22,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T09:21:15.600Z","etag":null,"topics":["aes","argon2","aria","bcrypt","camellia","cipher","google-authenticator","one-time-password","password-generator","password-hashing","pbkdf2","scrypt"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chronoxor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-06-04T08:40:08.000Z","updated_at":"2025-01-07T01:06:32.000Z","dependencies_parsed_at":"2024-03-09T00:26:40.676Z","dependency_job_id":"24f0e168-a7a9-427d-ac75-8099986167dc","html_url":"https://github.com/chronoxor/CppSecurity","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoxor%2FCppSecurity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoxor%2FCppSecurity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoxor%2FCppSecurity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronoxor%2FCppSecurity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chronoxor","download_url":"https://codeload.github.com/chronoxor/CppSecurity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248961237,"owners_count":21189993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes","argon2","aria","bcrypt","camellia","cipher","google-authenticator","one-time-password","password-generator","password-hashing","pbkdf2","scrypt"],"created_at":"2024-11-16T07:09:12.081Z","updated_at":"2026-02-28T04:59:16.569Z","avatar_url":"https://github.com/chronoxor.png","language":"C++","readme":"# CppSecurity\n\n[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![Release](https://img.shields.io/github/release/chronoxor/CppSecurity.svg?sort=semver)](https://github.com/chronoxor/CppSecurity/releases)\n\u003cbr/\u003e\n[![Linux (clang)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-linux-clang.yml/badge.svg)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-linux-clang.yml)\n[![Linux (gcc)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-linux-gcc.yml/badge.svg)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-linux-gcc.yml)\n[![MacOS](https://github.com/chronoxor/CppSecurity/actions/workflows/build-macos.yml/badge.svg)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-macos.yml)\n\u003cbr/\u003e\n[![Windows (Cygwin)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-windows-cygwin.yml/badge.svg)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-windows-cygwin.yml)\n[![Windows (MSYS2)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-windows-msys2.yml/badge.svg)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-windows-msys2.yml)\n[![Windows (MinGW)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-windows-mingw.yml/badge.svg)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-windows-mingw.yml)\n[![Windows (Visual Studio)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-windows-vs.yml/badge.svg)](https://github.com/chronoxor/CppSecurity/actions/workflows/build-windows-vs.yml)\n\nC++ Security Library provides different security functionality for password\ngeneration, password hashing algorithms and Google Authenticator.\n\n[CppSecurity API reference](https://chronoxor.github.io/CppSecurity/index.html)\n\n# Contents\n  * [Features](#features)\n  * [Requirements](#requirements)\n  * [How to build?](#how-to-build)\n  * [Security benchmarks](#security-benchmarks)\n    * [Benchmark 1: Password generator](#benchmark-1-password-generator)\n    * [Benchmark 2: Google Authenticator](#benchmark-2-google-authenticator)\n    * [Benchmark 3: 'PBKDF2' password hashing algorithm](#benchmark-3-PBKDF2-password-hashing-algorithm)\n    * [Benchmark 4: 'bcrypt' password hashing algorithm](#benchmark-4-bcrypt-password-hashing-algorithm)\n    * [Benchmark 5: 'scrypt' password hashing algorithm](#benchmark-5-scrypt-password-hashing-algorithm)\n    * [Benchmark 6: 'Argon2' password hashing algorithm](#benchmark-6-argon2-password-hashing-algorithm)\n    * [Benchmark 7: Cipher](#benchmark-7-cipher)\n\n# Features\n* Cross platform (Linux, MacOS, Windows)\n* Password generator\n* [Google Authenticator](https://en.wikipedia.org/wiki/Google_Authenticator) support\n* Password hashing algorithms ([PBKDF2](https://en.wikipedia.org/wiki/PBKDF2), [bcrypt](https://en.wikipedia.org/wiki/Bcrypt), [scrypt](https://en.wikipedia.org/wiki/Scrypt), [Argon2](https://en.wikipedia.org/wiki/Argon2))\n* Symmetric ciphers ([AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard), [ARIA](https://en.wikipedia.org/wiki/ARIA_(cipher)), [Camellia](https://en.wikipedia.org/wiki/Camellia_(cipher)))\n\n# Requirements\n* Linux\n* MacOS\n* Windows\n* [cmake](https://www.cmake.org)\n* [gcc](https://gcc.gnu.org)\n* [git](https://git-scm.com)\n* [gil](https://github.com/chronoxor/gil.git)\n* [OpenSSL](https://www.openssl.org)\n* [python3](https://www.python.org)\n\nOptional:\n* [clang](https://clang.llvm.org)\n* [CLion](https://www.jetbrains.com/clion)\n* [Cygwin](https://cygwin.com)\n* [MSYS2](https://www.msys2.org)\n* [MinGW](https://mingw-w64.org/doku.php)\n* [Visual Studio](https://www.visualstudio.com)\n\n# How to build?\n\n### Linux: install required packages\n```shell\nsudo apt-get install -y binutils-dev uuid-dev libssl-dev\n```\n\n### Install [gil (git links) tool](https://github.com/chronoxor/gil)\n```shell\npip3 install gil\n```\n\n### Setup repository\n```shell\ngit clone https://github.com/chronoxor/CppSecurity.git\ncd CppSecurity\ngil update\n```\n\n### Linux\n```shell\ncd build\n./unix.sh\n```\n\n### MacOS\n```shell\ncd build\n./unix.sh\n```\n\n### Windows (Cygwin)\n```shell\ncd build\nunix.bat\n```\n\n### Windows (MSYS2)\n```shell\ncd build\nunix.bat\n```\n\n### Windows (MinGW)\n```shell\ncd build\nmingw.bat\n```\n\n### Windows (Visual Studio)\n```shell\ncd build\nvs.bat\n```\n\n# Security benchmarks\n\n## Benchmark 1: Password generator\nBenchmark source file: [password_generator.cpp](https://github.com/chronoxor/CppSecurity/blob/master/performance/password_generator.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 24.476 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Wed Jun 12 01:55:58 2019\nUTC timestamp: Tue Jun 11 22:55:58 2019\n===============================================================================\nBenchmark: Generate password\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: Generate password\nAverage time: 73.490 mcs/op\nMinimal time: 73.490 mcs/op\nMaximal time: 76.286 mcs/op\nTotal time: 4.925 s\nTotal operations: 67019\nOperations throughput: 13607 ops/s\n===============================================================================\nBenchmark: Validate password\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: Validate password\nAverage time: 19 ns/op\nMinimal time: 19 ns/op\nMaximal time: 20 ns/op\nTotal time: 1.944 s\nTotal operations: 97525818\nOperations throughput: 50161060 ops/s\n===============================================================================\n```\n\n## Benchmark 2: Google Authenticator\nBenchmark source file: [google_authenticator.cpp](https://github.com/chronoxor/CppSecurity/blob/master/performance/google_authenticator.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 24.470 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Wed Jun 12 01:57:37 2019\nUTC timestamp: Tue Jun 11 22:57:37 2019\n===============================================================================\nBenchmark: Generate Google Authenticator secret\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: Generate Google Authenticator secret\nAverage time: 75.167 mcs/op\nMinimal time: 75.167 mcs/op\nMaximal time: 77.377 mcs/op\nTotal time: 4.882 s\nTotal operations: 64960\nOperations throughput: 13303 ops/s\n===============================================================================\nBenchmark: Generate Google Authenticator token\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: Generate Google Authenticator token\nAverage time: 1.244 mcs/op\nMinimal time: 1.244 mcs/op\nMaximal time: 1.260 mcs/op\nTotal time: 4.847 s\nTotal operations: 3894253\nOperations throughput: 803368 ops/s\n===============================================================================\n```\n\n## Benchmark 3: 'PBKDF2' password hashing algorithm\nBenchmark source file: [password_hashing_pbkdf2.cpp](https://github.com/chronoxor/CppSecurity/blob/master/performance/password_hashing_pbkdf2.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 17.1017 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Thu Jun  6 02:52:55 2019\nUTC timestamp: Wed Jun  5 23:52:55 2019\n===============================================================================\nBenchmark: 'PBKDF2' generate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'PBKDF2' generate\nAverage time: 491.718 mcs/op\nMinimal time: 491.718 mcs/op\nMaximal time: 507.445 mcs/op\nTotal time: 4.933 s\nTotal operations: 10034\nOperations throughput: 2033 ops/s\n===============================================================================\nBenchmark: 'PBKDF2' validate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'PBKDF2' validate\nAverage time: 403.262 mcs/op\nMinimal time: 403.262 mcs/op\nMaximal time: 412.173 mcs/op\nTotal time: 4.976 s\nTotal operations: 12341\nOperations throughput: 2479 ops/s\n===============================================================================\n```\n\n## Benchmark 4: 'bcrypt' password hashing algorithm\nBenchmark source file: [password_hashing_bcrypt.cpp](https://github.com/chronoxor/CppSecurity/blob/master/performance/password_hashing_bcrypt.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 17.921 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Thu Jun  6 02:59:34 2019\nUTC timestamp: Wed Jun  5 23:59:34 2019\n===============================================================================\nBenchmark: 'bcrypt' generate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'bcrypt' generate\nAverage time: 950.807 mcs/op\nMinimal time: 950.807 mcs/op\nMaximal time: 960.204 mcs/op\nTotal time: 4.986 s\nTotal operations: 5245\nOperations throughput: 1051 ops/s\n===============================================================================\nBenchmark: 'bcrypt' validate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'bcrypt' validate\nAverage time: 862.694 mcs/op\nMinimal time: 862.694 mcs/op\nMaximal time: 867.637 mcs/op\nTotal time: 4.988 s\nTotal operations: 5783\nOperations throughput: 1159 ops/s\n===============================================================================\n```\n\n## Benchmark 5: 'scrypt' password hashing algorithm\nBenchmark source file: [password_hashing_scrypt.cpp](https://github.com/chronoxor/CppSecurity/blob/master/performance/password_hashing_scrypt.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 18.052 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Thu Jun  6 02:42:32 2019\nUTC timestamp: Wed Jun  5 23:42:32 2019\n===============================================================================\nBenchmark: 'scrypt' generate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'scrypt' generate\nAverage time: 956.991 mcs/op\nMinimal time: 956.991 mcs/op\nMaximal time: 982.195 mcs/op\nTotal time: 4.983 s\nTotal operations: 5207\nOperations throughput: 1044 ops/s\n===============================================================================\nBenchmark: 'scrypt' validate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'scrypt' validate\nAverage time: 857.232 mcs/op\nMinimal time: 857.232 mcs/op\nMaximal time: 916.809 mcs/op\nTotal time: 4.781 s\nTotal operations: 5578\nOperations throughput: 1166 ops/s\n===============================================================================\n```\n\n## Benchmark 6: 'Argon2' password hashing algorithm\nBenchmark source file: [password_hashing_argon2.cpp](https://github.com/chronoxor/CppSecurity/blob/master/performance/password_hashing_argon2.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.0.0\n===============================================================================\nCPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 3.998 GHz\nCPU Hyper-Threading: enabled\nRAM total: 31.962 GiB\nRAM free: 18.026 GiB\n===============================================================================\nOS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuaraion: release\nLocal timestamp: Thu Jun  6 02:45:53 2019\nUTC timestamp: Wed Jun  5 23:45:53 2019\n===============================================================================\nBenchmark: 'Argon2d' generate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'Argon2d' generate\nAverage time: 824.018 mcs/op\nMinimal time: 824.018 mcs/op\nMaximal time: 844.418 mcs/op\nTotal time: 4.932 s\nTotal operations: 5986\nOperations throughput: 1213 ops/s\n===============================================================================\nBenchmark: 'Argon2d' validate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'Argon2d' validate\nAverage time: 744.765 mcs/op\nMinimal time: 744.765 mcs/op\nMaximal time: 791.891 mcs/op\nTotal time: 4.778 s\nTotal operations: 6416\nOperations throughput: 1342 ops/s\n===============================================================================\nBenchmark: 'Argon2i' generate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'Argon2i' generate\nAverage time: 851.280 mcs/op\nMinimal time: 851.280 mcs/op\nMaximal time: 921.955 mcs/op\nTotal time: 4.768 s\nTotal operations: 5601\nOperations throughput: 1174 ops/s\n===============================================================================\nBenchmark: 'Argon2i' validate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'Argon2i' validate\nAverage time: 747.924 mcs/op\nMinimal time: 747.924 mcs/op\nMaximal time: 764.430 mcs/op\nTotal time: 4.961 s\nTotal operations: 6634\nOperations throughput: 1337 ops/s\n===============================================================================\nBenchmark: 'Argon2id' generate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'Argon2id' generate\nAverage time: 828.117 mcs/op\nMinimal time: 828.117 mcs/op\nMaximal time: 858.997 mcs/op\nTotal time: 4.935 s\nTotal operations: 5960\nOperations throughput: 1207 ops/s\n===============================================================================\nBenchmark: 'Argon2id' validate\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: 'Argon2id' validate\nAverage time: 738.366 mcs/op\nMinimal time: 738.366 mcs/op\nMaximal time: 791.300 mcs/op\nTotal time: 4.698 s\nTotal operations: 6363\nOperations throughput: 1354 ops/s\n===============================================================================\n```\n\n## Benchmark 7: Cipher\nBenchmark source file: [cipher.cpp](https://github.com/chronoxor/CppSecurity/blob/master/performance/cipher.cpp)\n\nBenchmark report is the following:\n```\n===============================================================================\nCppBenchmark report. Version 1.0.3.0\n===============================================================================\nCPU architecture: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz\nCPU logical cores: 8\nCPU physical cores: 4\nCPU clock speed: 2.112 GHz\nCPU Hyper-Threading: enabled\nRAM total: 15.387 GiB\nRAM free: 5.900 GiB\n===============================================================================\nOS version: Microsoft Windows 10 Enterprise Edition (build 18363), 64-bit\nOS bits: 64-bit\nProcess bits: 64-bit\nProcess configuration: release\nLocal timestamp: Sun Nov 20 23:06:31 2022\nUTC timestamp: Sun Nov 20 19:06:31 2022\n===============================================================================\nBenchmark: Cipher encrypt\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: Cipher encrypt\nAverage time: 182 ns/op\nMinimal time: 175 ns/op\nMaximal time: 188 ns/op\nTotal time: 3.819 s\nTotal operations: 20915100\nOperations throughput: 5475649 ops/s\n===============================================================================\nBenchmark: Cipher decrypt\nAttempts: 5\nDuration: 5 seconds\n-------------------------------------------------------------------------------\nPhase: Cipher decrypt\nAverage time: 292 ns/op\nMinimal time: 201 ns/op\nMaximal time: 297 ns/op\nTotal time: 3.207 s\nTotal operations: 10983063\nOperations throughput: 3423788 ops/s\n===============================================================================\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchronoxor%2Fcppsecurity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchronoxor%2Fcppsecurity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchronoxor%2Fcppsecurity/lists"}