Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/virgilsecurity/virgil-crypto-c

This library is designed to be small, flexible and convenient wrapper for a variety crypto algorithms. So it can be used in a small micro controller as well as in a high load server application.
https://github.com/virgilsecurity/virgil-crypto-c

crypto crypto-algorithms falcon phe post-quantum-cryptography pythia round5 virgil-crypto

Last synced: 6 days ago
JSON representation

This library is designed to be small, flexible and convenient wrapper for a variety crypto algorithms. So it can be used in a small micro controller as well as in a high load server application.

Awesome Lists containing this project

README

        

[![License](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](https://raw.githubusercontent.com/VirgilSecurity/virgil-crypto/master/LICENSE)

# Virgil Security Crypto Library for C

[![Build Linux](https://github.com/VirgilSecurity/virgil-crypto-c/actions/workflows/build-linux.yml/badge.svg)](https://github.com/VirgilSecurity/virgil-crypto-c/actions/workflows/build-linux.yml)
[![Build macOS](https://github.com/VirgilSecurity/virgil-crypto-c/actions/workflows/build-macos.yml/badge.svg)](https://github.com/VirgilSecurity/virgil-crypto-c/actions/workflows/build-macos.yml)
[![VirgilCrypto](https://img.shields.io/cocoapods/v/VSCCrypto.svg?style=flat)](https://cocoapods.org/pods/VSCCrypto)
[![Swift Package Manager](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat)](https://www.swift.org/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 Purpose | Implementation details |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Key Generation, PRNG | CTR_DRBG [NIST SP 800-90A](http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf) |
| Key Derivation | [KDF1, KDF2](https://www.shoup.net/iso/std6.pdf), [HKDF](https://tools.ietf.org/html/rfc5869), [PBKDF2](https://tools.ietf.org/html/rfc8018#section-5.2) |
| Key Exchange | [X25519](https://tools.ietf.org/html/rfc7748), [RSA](http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Br1.pdf), [ECDH](https://www.secg.org/sec1-v2.pdf) |
| Key Encapsulation Mechanism | [Round5](https://github.com/round5/code), ECIES-KEM |
| Hashing | [SHA-2 (224/256/384/512)](https://tools.ietf.org/html/rfc4634) |
| Message Authentication Code | [HMAC](https://www.ietf.org/rfc/rfc2104.txt) |
| Digital Signature | [Ed25519](https://tools.ietf.org/html/rfc8032), [RSASSA-PSS](https://tools.ietf.org/html/rfc4056), [ECDSA](https://www.secg.org/sec1-v2.pdf), [Falcon](https://falcon-sign.info) |
| Entropy Source | Linux, macOS [/dev/urandom](https://tls.mbed.org/module-level-design-rng),
Windows [CryptGenRandom()](https://tls.mbed.org/module-level-design-rng) |
| Symmetric Algorithms | [AES-256-GCM](http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf), [AES-256-CBC](https://tools.ietf.org/html/rfc3602) |
| Encryption schemes | [PBES2](https://tools.ietf.org/html/rfc8018#section-6.2) |
| Elliptic Curves | [Ed25519](https://tools.ietf.org/html/rfc8032), [Curve25519](https://tools.ietf.org/html/rfc7748), [secp256R1](https://www.secg.org/sec1-v2.pdf) |
| Post-quantum cryptography | [Falcon](https://falcon-sign.info), [Round5](https://github.com/round5/code) |

### Library: PHE

The cryptographic background for the [Password-Hardened Encryption (PHE) protocol](https://virgilsecurity.com/wp-content/uploads/2018/11/PHE-Whitepaper-2018.pdf) 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](https://github.com/VirgilSecurity/virgil-phe-go).

### Library: Pythia

The cryptographic background for the [Pythia PRF Service](http://pages.cs.wisc.edu/~ace/papers/pythia-full.pdf).

### Library: Ratchet

Implementation of the [Double Ratchet Algorithm](https://en.wikipedia.org/wiki/Double_Ratchet_Algorithm).

## Platforms & languages

| Library | Platforms | Languages / Binaries |
| ---------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| foundation | all | [C](https://cdn.virgilsecurity.com/virgil-crypto-c/c), [Swift](https://github.com/VirgilSecurity/virgil-cryptowrapper-x), [Java](https://mvnrepository.com/artifact/com.virgilsecurity.crypto), [JS](https://github.com/VirgilSecurity/virgil-crypto-javascript), [Python](https://pypi.org/project/virgil-crypto-lib), [Go](https://github.com/VirgilSecurity/virgil-sdk-go/tree/master/crypto/internal), [PHP](https://github.com/VirgilSecurity/virgil-cryptowrapper-php) |
| pythia | linux, macOS | [C](https://cdn.virgilsecurity.com/virgil-crypto-c/c), [Swift](https://github.com/VirgilSecurity/virgil-cryptowrapper-x), [Java](https://mvnrepository.com/artifact/com.virgilsecurity.crypto), [JS](https://github.com/VirgilSecurity/virgil-crypto-javascript), [Python](https://pypi.org/project/virgil-crypto-lib), [PHP](https://github.com/VirgilSecurity/virgil-cryptowrapper-php) |
| phe | all | [C](https://cdn.virgilsecurity.com/virgil-crypto-c/c), [PHP](https://cdn.virgilsecurity.com/virgil-crypto-c/php), [Java](https://mvnrepository.com/artifact/com.virgilsecurity.crypto), [JS](https://github.com/VirgilSecurity/virgil-crypto-javascript), [Python](https://pypi.org/project/virgil-crypto-lib), [Go](https://github.com/VirgilSecurity/virgil-sdk-go/tree/master/crypto/internal), [PHP](https://github.com/VirgilSecurity/virgil-cryptowrapper-php) |
| ratchet | all | [C](https://cdn.virgilsecurity.com/virgil-crypto-c/c), [Swift](https://github.com/VirgilSecurity/virgil-cryptowrapper-x), [Java](https://mvnrepository.com/artifact/com.virgilsecurity.crypto), [JS](https://github.com/VirgilSecurity/virgil-crypto-javascript), [Python](https://pypi.org/project/virgil-crypto-lib), [Go](https://github.com/VirgilSecurity/virgil-sdk-go/tree/master/crypto/internal) |

## Build from sources

### Prerequisites

* Compiler:
- `gcc` (version >= 4.8.2), or
- `clang` (version >= 3.6), or
- `msvc` (version >= 14.0)
* Build tools:
- `cmake` (version >= 3.12)
- `python` (version >= 3)
- `python-protobuf`

### Build & Install

```bash
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

```bash
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](https://twitter.com/VirgilSecurity) or send us an email [email protected].

Also, get extra help from our support team on [Slack](https://virgilsecurity.com/join-community).

## License

BSD 3-Clause. See [LICENSE](LICENSE) for details.