Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

A simple Drag and Drop demo to illustrate how you can easily integrate Virtru SDKs into your application. For more info:

License

Notifications You must be signed in to change notification settings

virtru/encrypt-decrypt-demo

Repository files navigation

Virtru Developer Hub Drag and Drop Demo

Drag and Drop

The Drag and Drop Demo leverages the Virtru SDK for JavaScript as well as the TDF Architecture in order to secure files and share them with others, while maintaining visibility and control of your data.

This demo showcases features such as:

  • Securing a file such that only intended recipients can access its data
  • Revoking access to a secured file, so users can no longer access its data
  • Decrypting an encrypted file by an authorized user

And uses the following technology:

  • Virtru SDK for JavaScript
  • Virtru Auth Widget
  • A Vitru Hosted Key Access Server (KAS)
  • A Vitru Hosted Entity Attribute Server (EAS)

See it Live

Go here to test drive the live demo. Afterwards, check the out Virtru's Developer Hub for a step-by-step guide on how it all works.

How it Works

Authenticating

You'll be taken to the demo's login screen. Click 'Start', and log in with your Google, Outlook or Office365 account. If you have neither, you can enter your email address to receive a 8-digit code, e.g., V-12345678.

Encrypting and Decrypting Files

Once logged in, you should see two drag and drop areas for encrypting and decrypting TDF files.

Encrypting

When a file is dropped onto the encrypt region it will be encrypted using Virtru's infrastructure (its Key Access Server and Entity Attribute Server). Once encrypted, the file (as a .tdf) will be downloaded to your default download location.

Decrypting

Similar to encryption, when a previously encrypted .tdf file is dropped onto the decrypt region it will be decrypted using Virtru's Key Access Server. Once the decryption has taken place, the decrypted file (without the .tdf extension) will be downloaded to your default download location.

Run it Locally

This demo can run on your local environment. Please ensure you meet the prerequisites and follow the steps.

Prerequisites

To be able to use Federated OAuth we suggest you to modify your /etc/hosts. This is an optional step, but note the fallback authentication will be email code only.

Windows

  • Install a POSIX-compatible environment such as Cygwin or Cmder
  • Install NVM
  • Edit c:\Windows\System32\Drivers\etc\hosts to include 127.0.0.1 local.virtru.com

Alternatively you could install Windows Subsystem for Linux and use the instructions below for Linux

Linux / MacOS

  • Install NVM
  • Edit /etc/hosts to include 127.0.0.1 local.virtru.com

Getting Started

# Clone the repository
$ git clone git@github.com:virtru/encrypt-decrypt-demo.git

# Change directory
$ cd encrypt-decrypt-demo

# Install node via NVM
$ nvm use

# Install node modules
$ npm ci

# Start the node server
$ npm start

If running successfully, you can now visit https://local.virtru.com.


You may be presented with a warning screen with a message similar to "Your connection is not private." This is due to the self-signed SSL certificate when running in development mode. To access the demo:

  • Chrome: Click Advanced then Proceed to local.virtru.com (unsafe)
  • Firefox: Click Advanced then Accept the Risk and Continue
  • Safari: Click Show Details then visit this website
  • Opera: Click Help me understand then Proceed to local.virtru.com (unsafe)

Stop the Server

In order to stop the running local server hosting local.virtru.com, go to the running Node server in the terminal hold the ctrl then press c.

Getting Help

There are many ways to get our attention.

  • If you found a bug or have a feature request, please use Github Issues.
  • You can join Virtru's Developer Hub Community Slack channel to get your questions answered.
  • You can get support here

License

Copyright © 2019 Virtru Corporation

This repository is released under the MIT license for all artifacts in this repository, with the following exceptions which are subject to our Virtru Data Protection Platform Subscription Agreement:

  • virtru-sdk

About

A simple Drag and Drop demo to illustrate how you can easily integrate Virtru SDKs into your application. For more info:

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published