1.0.6 • Published 4 years ago

datapeps-sdk v1.0.6

Weekly downloads
138
License
Apache-2.0
Repository
github
Last release
4 years ago

DataPeps SDK

This repository contains the source for the DataPeps SDK for JavaScript (written in TypeScript), released under the Apache License.

DataPeps is an End-to-End Encryption platform. By integrating this SDK in your application, you can encrypt resources on clients (web, mobile, ...) to store and share data securely. For you, as a developer, one of the main benefits is that the cryptography implementation is foolproof and you don't need any knowledge of cryptography.

Getting started

The simplest way to get started is to add DataPeps SDK, using your favourite package manager.

With npm, go to your project directory and run:

npm install datapeps-sdk --save

If you prefer yarn, go to your project directory and run:

yarn add datapeps-sdk

Once installed, just add the following line to your code to import the DataPeps SDK:

import * as DataPeps from 'datapeps-sdk';

If you plan to use DataPeps with Node.js (for testing with Mocha for instance), please read more about dependencies in the wiki.

Hello, DataPeps!

Say there are two friends, Alice and Bob. Alice wants to send a picture to Bob; however, Alice is quite rather concerned about data security (good for her!), and she wants to ensure, that only Bob can eventually read the picture. DataPeps to the rescue!

With DataPeps, Alice encrypts the message like this:

async function aliceSend() {
    let aliceSession = await DataPeps.login(aliceLogin, alicePassword);
    let resource = await aliceSession.Resource.create("text", "", [bobLogin]);
    let messageToBob = "Hello, Bob!";
    let encryptedMessage = resource.encrypt(new TextEncoder().encode(messageToBob));
    console.log("Alice sent a message: \"" + messageToBob + "\"");
    return [resource.id, encryptedMessage];
}

and Bob decrypts the message like this:

async function bobReceive(resourceId, encryptedMessage) {
    let bobSession = await DataPeps.login(bobLogin, bobPassword);
    let resource = await bobSession.Resource.get(resourceId);
    let decryptedMessage = resource.decrypt(encryptedMessage);
    let messageToBob = new TextDecoder().decode(decryptedMessage);
    console.log("Bob received message: \"" + messageToBob + "\"");
}

If you want a detailed explanation of the code above, look it up in the wiki.

Want to try asap? Here is a complete Gist.

Learn more

DataPeps is written by the Innovation Department at WALLIX.

1.0.6-dev-de08b2

4 years ago

1.0.6-dev-faf9a8

5 years ago

1.0.6-dev-2367c2

5 years ago

1.0.6-dev-d80b4d

5 years ago

1.0.6-dev-dc21a2

5 years ago

1.0.6-dev-b54351

5 years ago

1.0.6-dev-1410d1

5 years ago

1.0.6

5 years ago

1.0.5-dev-27cc12

5 years ago

1.0.5

5 years ago

1.0.4-dev-be5dee

5 years ago

1.0.4-dev-05cde4

5 years ago

1.0.4

5 years ago

1.0.3-dev-2ef913

5 years ago

1.0.3-dev-0b9f4a

5 years ago

1.0.3-dev-595fbf

5 years ago

1.0.3-dev-3d4d30

5 years ago

1.0.3-dev-e74761

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0-dev-dc1b80

5 years ago

1.0.0

5 years ago

1.0.0-0

5 years ago

0.0.50

5 years ago

0.0.49

5 years ago

0.0.48

5 years ago

0.0.47

5 years ago

0.0.46

5 years ago

0.0.45

5 years ago

0.0.44

5 years ago

0.0.43

5 years ago

0.0.42

5 years ago

0.0.41

5 years ago

0.0.40

5 years ago

0.0.39

6 years ago

0.0.38

6 years ago

0.0.37

6 years ago

0.0.36

6 years ago

0.0.35

6 years ago

0.0.34

6 years ago

0.0.33

6 years ago

0.0.32

6 years ago

0.0.31-dev-da16

6 years ago

0.0.31-dev-7c72

6 years ago

0.0.31

6 years ago

0.0.30

6 years ago

0.0.29

6 years ago

0.0.28

6 years ago

0.0.27

6 years ago

0.0.26

6 years ago

0.0.25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago