This is an example of how to use the Virgil Security APIs using the official JS and Ruby SDKs to implement end to end encryption in a chat application.
This demo uses
- Ruby 2.2.2+
- Rails 5.1
- The Virgil Security SDKs for JS and Ruby
- Clone this repository
- Run
bundle
to install all dependencies - Run
rake db:setup
to initialize the database - Run
rails server
to start the app - Visit
http://localhost:5000/
and register - In a separate browser or on a different machine create a second account.
- Select the other user in the UI
- Start a conversation
All messages are client side encrypted and can not be read by the server. To inspect this behaviour, open a rails console
and run Message.pluck(:content)
to inspect the message content.
There are 2 special branches of this repo, the before and after branch show the state of this application in their respective before and after adding end-to-end-encryption states.
Here are the exact differences between these 2 branches.
This repository includes the app.virgilkey
, key password, app ID, and access token. In a production environment these should probably not live with your code but somewhere separated like environment variables.
- The Virgil Security Ruby SDK
- The Virgil Security Javascript SDK
- Get Started with Encrypted Communication