Home

Awesome

Virgil Security .NET/C# Crypto Library

Build status Nuget package GitHub license

Introduction | Library purposes | Usage examples | Installation | Docs | License | Contacts

Introduction

VirgilCrypto is a stack of security libraries (ECIES with Crypto Agility wrapped in Virgil Cryptogram) and an open-source high-level cryptographic library that allows you to perform all necessary operations for securely storing and transferring data in your digital solutions. Crypto Library is written in C++ and is suitable for mobile and server platforms.

Virgil Security, Inc., guides software developers into the forthcoming security world in which everything will be encrypted (and passwords will be eliminated). In this world, the days of developers having to raise millions of dollars to build a secure chat, secure email, secure file-sharing, or a secure anything have come to an end. Now developers can instead focus on building features that give them a competitive market advantage while end-users can enjoy the privacy and security they increasingly demand.

Library purposes

Usage examples

Generate a key pair

Generate a Private Key with the default algorithm (EC_X25519):

using Virgil.Crypto;

var crypto = new VirgilCrypto();
var keyPair = crypto.GenerateKeys();

Generate and verify a signature

Generate signature and sign data with a private key:

using Virgil.Crypto;

var crypto = new VirgilCrypto();

// prepare a message
var messageToSign = "Hello, Bob!";
var dataToSign = Encoding.UTF8.GetBytes(messageToSign);

// generate a signature
var signature = crypto.GenerateSignature(dataToSign, senderPrivateKey);

Verify a signature with a public key:

using Virgil.Crypto;

var crypto = new VirgilCrypto();

// verify a signature
var verified = crypto.VerifySignature(signature, dataToSign, senderPublicKey);

Encrypt and decrypt data

Encrypt Data on a Public Key:

using Virgil.Crypto;

var crypto = new VirgilCrypto();

// prepare a message
var messageToEncrypt = "Hello, Bob!";
var dataToEncrypt = Encoding.UTF8.GetBytes(messageToEncrypt);

// encrypt the message
var encryptedData = crypto.Encrypt(dataToEncrypt, receiverPublicKey);

Decrypt the encrypted data with a Private Key:

using Virgil.Crypto;

var crypto = new VirgilCrypto();

// prepare data to be decrypted
var decryptedData = crypto.Decrypt(encryptedData, receiverPrivateKey);

// decrypt the encrypted data using a private key
var decryptedMessage = Encoding.UTF8.GetString(decryptedData);

Need more examples? Visit our developer documentation.

Installation

The Virgil .NET Crypto is provided as a package named Virgil.SDK.Crypto. The package is distributed via NuGet package management system.

Supported Platforms:

Installing the package using Package Manager Console:

Run PM> Install-Package Virgil.Crypto

Docs

License

This library is released under the 3-clause BSD License.

Support

Our developer support team is here to help you. Find out more information on our Help Center.

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

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