Home

Awesome

License

Virgil Security Crypto Library for C

Build Linux Build macOS VirgilCrypto Swift Package Manager

Introduction

This library is designed to be a small, flexible and convenient wrapper for a variety of crypto algorithms. So it can be used in a small microcontroller as well as in a high load server application. Also, it provides several custom hybrid algorithms that combine different crypto algorithms to solve common complex cryptographic problems in an easy way. This eliminates the requirement for developers to have strong cryptographic skills.

The library is available for different platforms and contains wrappers for other languages.

Features

The Virgil Security Crypto C library is decomposed into small libraries with specific purposes. A developer can freely choose a subset of libraries.

Library: Foundation

This library contains basic cryptographic algorithms and can be used as building blocks for complex solutions.

Algorithm PurposeImplementation details
Key Generation, PRNGCTR_DRBG NIST SP 800-90A
Key DerivationKDF1, KDF2, HKDF, PBKDF2
Key ExchangeX25519, RSA, ECDH
Key Encapsulation MechanismRound5, ECIES-KEM
HashingSHA-2 (224/256/384/512)
Message Authentication CodeHMAC
Digital SignatureEd25519, RSASSA-PSS, ECDSA, Falcon
Entropy SourceLinux, macOS /dev/urandom,<br>Windows CryptGenRandom()
Symmetric AlgorithmsAES-256-GCM, AES-256-CBC
Encryption schemesPBES2
Elliptic CurvesEd25519, Curve25519, secp256R1
Post-quantum cryptographyFalcon, Round5

Library: PHE

The cryptographic background for the Password-Hardened Encryption (PHE) protocol that provides developers the technology to protect user passwords from offline attacks and render stolen passwords useless even if your database has been compromised. The service implementation can be found here.

Library: Pythia

The cryptographic background for the Pythia PRF Service.

Library: Ratchet

Implementation of the Double Ratchet Algorithm.

Platforms & languages

LibraryPlatformsLanguages / Binaries
foundationallC, Swift, Java, JS, Python, Go, PHP
pythialinux, macOSC, Swift, Java, JS, Python, PHP
pheallC, PHP, Java, JS, Python, Go, PHP
ratchetallC, Swift, Java, JS, Python, Go

Build from sources

Prerequisites

Build & Install

git clone https://github.com/VirgilSecurity/virgil-crypto-c.git
cd virgil-crypto-c
cmake -Bbuild -H.
cmake --build build
cmake --build build --target install

Run Benchmarks

cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_BENCHMARKING=ON \
      -DED25519_AMD64_RADIX_64_24K=ON -DED25519_REF10=OFF \
      -Bbuild -H.

cmake --build build -- -j10

./build/benchmarks/foundation/bench

Support

Our developer support team is here to help you.

You can find us on Twitter or send us an email support@VirgilSecurity.com.

Also, get extra help from our support team on Slack.

License

BSD 3-Clause. See LICENSE for details.