Gestalt is a user-friendly cryptography library designed for developers who want to seamlessly integrate cryptographic algorithms into their projects.
Our goal is to provide a straightforward and intuitive interface for implementing essential cryptographic operations without the hassle associated with more complex libraries.
- Building Gestalt
- Supported Algorithms
- Documentation
- Usage
- Contributing
- Roadmap
- License
- Contact
- Legalities
To get started, check out our website and examples. Whether you're an experienced developer or new to cryptography, Gestalt is here to make cryptography accessible and hassle-free.
You can include Gestalt in your CMake project by using 'FetchContent`:
-
Include
FetchContent
in yourCMakeLists.txt
:cmake_minimum_required(VERSION 3.16.3) project(Project) include(FetchContent) FetchContent_Declare( Gestalt GIT_REPOSITORY https://github.com/HLRichardson-Git/Gestalt.git GIT_TAG main ) FetchContent_MakeAvailable(Gestalt) add_executable(${PROJECT_NAME} main.cpp) target_link_libraries (${PROJECT_NAME} PRIVATE Gestalt)
-
Build your project:
mkdir build cd build cmake .. cmake --build .
-
Run the tests (optional but recommended):
./_deps/gestalt-build/tests/Debug/tests.exe
By using the FetchContent
module, Gestalt and its dependencies will be automatically downloaded and made available to your project. You can then link against it as shown in the example above.
To see more about the supported algorithms check out our website and examples.
Algorithm | Type | Description |
---|---|---|
AES | Symmetric Encryption | Advanced Encryption Standard |
DES/3DES | Symmetric Encryption | Data Encryption Standard |
SHA-1 | Hash Function | Secure Hash Algorithm |
SHA-2 | Hash Function | Secure Hash Algorithm |
HMAC-SHA1 | Message Authentication Code | HMAC using SHA-1 |
HMAC-SHA2 | Message Authentication Code | HMAC using SHA-2 |
ECDSA | Asymmetric Signature Scheme | Elliptic Curve Digital Signature Algorithm signing |
RSA | Asymmetric Encryption | Rivest–Shamir–Adleman key encryption with Raw or OAEP padding |
RSA | Asymmetric Signature Scheme | Rivest–Shamir–Adleman message signing with Raw or PSS padding |
ECDH | Asymmetric Key Agreement | Elliptic Curve Diffie-Hellman Shared Secret computation |
More algorithms are being implemented very often, see open issues to see algorithms in devlopment
If you want to read more about using Gestalt the best place to start is the Gestalt website "Getting Started" page. You can also find a few examples under Usage, or for more detailed examples check out Gestalts website "Examples" page.
Using Gestalt is meant to be as simple as possible for developers to quickly use cryptography algorithms. Here are just a couple of examples of using Gestalt:
#include <gestalt/aes.h>
#include <iostream>
int main() {
std::string key = "10a58869d74be5a374cf867cfb473859"; // 128-bit key
std::string iv = "123456789abcdef123456789abcdef12";
std::string message = "Hello, Gestalt!";
std::string ciphertext = encryptAESCBC(message, iv, key);
std::cout << "AES-CBC-128: " << ciphertext << std::endl;
return 0;
}
#include <gestalt/sha2.h>
#include <iostream>
int main() {
std::string message = "Hello, Gestalt!";
std::string hash = hashSHA256(message);
std::cout << "SHA2-256: " << hash << std::endl;
return 0;
}
#include <gestalt/ecdsa.h>
#include <iostream>
int main() {
std::string privateKey = "0xC9AFA9D845BA75166B5C215767B1D6934E50C3DB36E89B127B8A622B120F6721";
ECDSA ecdsa(StandardCurve::P256, privateKey);
std::string message = "Hello, Gestalt!";
Signature signature = ecdsa.signMessage(message, HashAlgorithm::SHA256);
ECDSAPublicKey peerPublicKey("0x60fed4ba255a9d31c961eb74c6356d68c049b8923b61fa6ce669622e60f29fb6",
"0x7903fe1008b8bc99a41ae9e95628bc64f2f1b20c2d7e9f5177a3c294d4462299");
bool signatureStatus = ecdsa.verifySignature(message, peerPublicKey, signature, HashAlgorithm::SHA256);
if (signatureStatus) std::cout << "Valid!" << std::endl;
return 0;
}
For more examples, check out our examples.
First off, thank you to anyone who takes the time to contribute to Gestalt! Contributors are what will make Gestalt even better, so any contributions are greatly appreciated!
Gestalt adheres to the contributor-maintained code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to hunter@hunterrichardson.net
If you have a suggestion that would make Gestalt better, feel free to open an issue and one of the maintainers will try to respond promptly. Remember to give Gestalt a star, it keeps us very motivated!
Make sure you read through CONTRIBUTING before contributing. Here are the steps to follow if you want to contribute:
- Fork Gestalt
- Create your own branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Note: It is planned to create a Gestalt Organization
- Add all FIPS-approved algorithms
- Refactor for multiple build environments
- Update all documentation to be current
- Prepare for the 1.0 launch
- Implement Non-Approved FIPS algorithms
See the open issues for a full list of proposed features (and known issues).
Gestalt is licensed under the MIT License, which means that you are free to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software.
See the LICENSE file for more details.
Hunter Richardson - hunter@hunterrichardson.net
Gestalt: https://github.com/HLRichardson-Git/Gestalt
A number of nations restrict the use or export of cryptography. If you are potentially subject to such restrictions, you should seek legal advice before attempting to develop or distribute cryptographic code.
A special thanks to the following people and resources that make Gestalt better:
Copyright (c) 2023-2024 The Gestalt Project Authors.
All rights reserved.