Introduction

Geralt is a modern cryptographic library for .NET 8+arrow-up-right based on libsodiumarrow-up-right and inspired by Monocypherarrow-up-right.

  • Simple: an easy-to-learn API with descriptive naming. Only one algorithm for each task is provided when possible.

  • Modern: the latest and greatest cryptographic algorithms, such as AEGIS-128L/AEGIS-256, (X)ChaCha20-Poly1305, BLAKE2b, Argon2id, X25519, and Ed25519.

  • Secure: libsodium was auditedarrow-up-right in 2017 and is the library of choice for lotsarrow-up-right of projects and evenarrow-up-right large companies.

  • Fast: libsodium is fasterarrow-up-right than many other cryptographic libraries. Furthermore, Geralt uses Span<T>arrow-up-right buffers to avoid memory allocations.

Installation

Geralt is available as a NuGetarrow-up-right package. It's supported on the following platformsarrow-up-right:

Windows
Linux
macOS
Other

win-x64

linux-x64

osx-x64

ios-arm64

win-x86

linux-musl-x64

osx-arm64

tvos

win-arm64

linux-arm64

maccatalyst

linux-arm

circle-info

Note that libsodium requires the Visual C++ Redistributable for Visual Studio 2015-2022arrow-up-right on Windows. Instructions on how to deal with this can be found here.

To get Geralt working on Android, you need to build the libsodium binaries yourselfarrow-up-right because they aren't included in the libsodium NuGet package. You then need to modifyarrow-up-right the project slightly to target that platform.

Source code

You can find the source code on GitHubarrow-up-right.

License

Geralt is licensed under the MITarrow-up-right license.

Goals

  • Span<T>arrow-up-right all the things: enables the secure erasure of bytes/chars and boosts performance.

  • Descriptive naming: BLAKE2b, not GenericHash.

  • Same vocabulary for everything: key, nonce, salt, input keying material, output keying material, etc.

  • Minimal parameters: no key parameter for an unkeyed hash.

  • Consistent parameter ordering: buffers come first.

  • Public constants: easy to create buffers.

  • One algorithm for each task: (X)ChaCha20-Poly1305, BLAKE2b, Argon2id, X25519, and Ed25519.

  • Some low-level functions: useful for customarrow-up-right constructionsarrow-up-right.

Out of scope

Acknowledgements

I'd like to say a big thanks to:

Last updated