Skip to content

HLRichardson-Git/Gestalt

Repository files navigation

Welcome to the Gestalt

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.

Table of Contents

Building Gestalt

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.

CMake

You can include Gestalt in your CMake project by using 'FetchContent`:

  1. Include FetchContent in your CMakeLists.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)
  2. Build your project:

    mkdir build
    cd build
    cmake ..
    cmake --build .
  3. 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.

(back to top)

Supported Algorithms

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 Encryption Elliptic Curve Signature Algorithm
ECDH Asymmetric Encryption Elliptic Curve Shared Secret computation

More algorithms are being implemented very often, see open issues to see algorithms in devlopment

(back to top)

Documentation

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.

(back to top)

Usage

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:

Example using AES CBC with 128-bit key:

#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;
}

Example using SHA2-256:

#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;
}

Example using ECDSA with P-256 and SHA2-256:

#include <gestalt/ecdsa.h>
#include <gestalt/sha2.h>
#include <iostream>

int main() {
    std::string privateKey = "0xC9AFA9D845BA75166B5C215767B1D6934E50C3DB36E89B127B8A622B120F6721";
    ECDSA ecdsa(StandardCurve::P256, privateKey);

    std::string message = "Hello, Gestalt!";
    std::string messageHash = hashSHA256(message);

    Signature signature = ecdsa.signMessage(messageHash);
    bool signatureStatus = ecdsa.verifySignature(messageHash, signature);

    if (signatureStatus) std::cout << "Valid!" << std::endl;

    return 0;
}

For more examples, check out our examples.

(back to top)

Contributing

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 [email protected]

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:

  1. Fork Gestalt
  2. Create your own branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Note: It is planned to create a Gestalt Organization

(back to top)

Roadmap

  • 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).

(back to top)

License

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.

(back to top)

Contact

Hunter Richardson - [email protected]

Gestalt: https://github.com/HLRichardson-Git/Gestalt

(back to top)

Legalities

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.

(back to top)

Acknowledgments

A special thanks to the following people and resources that make Gestalt better:

Copyright

Copyright (c) 2023-2024 The Gestalt Project Authors.

All rights reserved.

(back to top)