Git Product home page Git Product logo

zerokit-web-sdk's Introduction

ZeroKit Web SDK

Build Status

This is the Web SDK of ZeroKit, that lets you enable secure authentication and end-to-end encryption in your application. It deals with password inputs, encryption and sharing, separating all the code that handles encryption keys and authentication, protecting you from accindental leaks and most XSS attacks.

The ZeroKit SDK for Web is currently under development and is accessible as a preview. We continuously improve it and fix bugs. Feedback is always welcome.

The project was written in typescript and is available compiled to javascript on the tenant server. Loading from there is the recommended way of use.

Usage

The SDK compiles into a bundle, which inserts the zkit_sdk object into the global namespace. Calling the setup method of this object initializes the sdk. This should be done during the pageload optionally along with a whoAmI call that will initialize the lazy loading. After the setup you can use the exposed methods to register and log users in or encrypt and decrypt your sensitive data.

You can see for yourself:

zkit_sdk.setup('https://host-hostId.tresorit.io', '/tenant-tenantId');
// After logging in...
zkit_sdk.createTresor().then(tresorId => {
  return zkit_sdk.encrypt('tresorId','Some sensitive data').then((encryptedText) => {
    // Now this text is only decryptable by people who you shared the above "tresor" with
    // You can transport it however you like, it wont leak..
    console.log(encryptedText);  
    return zkit_sdk.decrypt(encryptedText);
  }).then((plainText) => {
    // And we just got the original back...
    console.log(plainText);
    return zkit_sdk.shareTresor(tresorId, 'userIdB');
  }).then((oprationId) => {
    // If this operation is approved by the application server,
    // every text ever encrypted by this tresor is decryptable by userB...
    // No reencyption, no refreshing, everything handled by ZeroKit.
    return applicationServerCall(operationId);
  });
});
// That's how simple it is.

Go ahead to the management portal and find out more in the documentation and check the full set of features provided by ZeroKit!

Requirements

First, to use the SDK you need a tenant server (basically a subscription to ZeroKit). You can get one for free here, where you can also find a detailed documentation and sample apps for many platforms. You can also get the relevant example from GitHub.

zerokit-web-sdk's People

Contributors

porcellus avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.