GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - HLRichardson-Git/Gestalt: A user-friendly cryptography library

BranchesTags
Open more actions menu

Latest commit

 

History

210 Commits
210 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
external
external
 
 
images
images
 
 
include/gestalt
include/gestalt
 
 
src
src
 
 
tests
tests
 
 
tools
tools
 
 
.gitignore
.gitignore
 
 
AUTHORS.md
AUTHORS.md
 
 
CHANGES.md
CHANGES.md
 
 
CMakeLists.txt
CMakeLists.txt
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

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
    • CMake
  • Supported Algorithms
  • Documentation
  • Usage
  • Contributing
  • Roadmap
  • License
  • Contact
  • Legalities

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 Signature Scheme Elliptic Curve Digital Signature Algorithm signing
RSA Asymmetric Encryption Rivest–Shamir–Adleman key encryption with Raw, PKCS1v1.5, or OAEP padding
RSA Asymmetric Signature Scheme Rivest–Shamir–Adleman message signing with Raw, PKCS1v1.5, 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

(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() {
    const SecureBytes key     = SecureBytes::fromHex("10a58869d74be5a374cf867cfb473859"); // 128-bit key
    const SecureBytes iv      = SecureBytes::fromHex("123456789abcdef123456789abcdef12");
    const SecureBytes message = SecureBytes::fromAscii("Hello, Gestalt!");
    SecureBytes ciphertext = encryptAESCBC(message, iv, key);

    std::cout << "AES-CBC-128: " << ciphertext.toHex() << std::endl;

    return 0;
}

Example using SHA2-256:

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

int main() {
    const SecureBytes message = SecureBytes::fromAscii("Hello, Gestalt!");
    SecureBytes hash = hashSHA256(message);

    std::cout << "SHA2-256: " << hash.toHex() << std::endl;

    return 0;
}

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

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

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

    const SecureBytes message = SecureBytes::fromAscii("Hello, Gestalt!");

    ECDSASignature signature = ecdsa.signMessage(message, HashAlgorithm::SHA256);

    ECDSAPublicKey peerPublicKey(BigInt("0x60fed4ba255a9d31c961eb74c6356d68c049b8923b61fa6ce669622e60f29fb6"),
                                 BigInt("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.

(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:

  • Gestalt Contributors
  • NIST
  • GoogleTest
  • GMP

Copyright

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

All rights reserved.

(back to top)

About

A user-friendly cryptography library

gestaltcrypto.github.io

Topics

cpp-librarycryptographyencryption-decryptiongestalthashing-algorithmpublic-key-cryptography

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity

Stars

4 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.