Introduction

In this tutorial, we help you to add end-to-end encryption (E2EE) in your digital solutions like: Messenger App, ChatBot, IoT devices in order to communicate securely.

Remember, this is the simplest possible implementation of E2EE chat and it works perfectly for simple chat apps between 2 users where conversations are short-lived and it's okay to lose the message history if a device is lost with the private key on it. 

What you'll learn at the end of the tutorial

  • How to create and publish users' public keys on Virgil Cards Service.
  • How to encrypt chat messages with a receiver's public key before sending.
  • How to decrypt encrypted messages with a sender's private key after receiving.
  • How to create tamper proof signature to be sure of data integrity.

We publish the users’ public keys on Virgil Cards Service so that chat users are able to look up each other and encrypt messages for each other or verify signature. The private keys will stay on users' devices.

What Virgil provides to developers

  • Open source Crypto Library. Used to perform cryptographic operations.
  • Virgil Cards Service. For storing and managing users' Public Keys and for the validation of user identities in anything from emails to applications.
  • Virgil SDK. Allows you to easily manage a Crypto Library and communicate with Virgil Services.

What's needed from developer's side

  • a backend server for your app.
  • a client-side application.

OK, enough talking! Let's get started!

Create Virgil Account and V5 Application

The first thing you need to do is grab all the necessary information from your Virgil account.  You need to create Application V5 on Virgil Dashboard and collect necessary information:

CREATE A USER'S VIRGIL CARD

use this instruction https://developer.virgilsecurity.com/docs/javascript/how-to/public-key-management/v5/create-card  in order to create user's Card with a Public Keys inside and publish them on Virgil Cards Service.

USE A USER'S CARD FOR CRYPTO OPERATIONS

use this instruction https://developer-dev.virgilsecurity.com/docs/javascript/how-to/public-key-management/v5/use-card-for-crypto-operation in order to encrypt and sign message for a Receiver

 and then decrypt and verify the message from Sender.

Did this answer your question?