Giter Club home page Giter Club logo

crypto-box's Introduction

@chiffre/crypto-box

NPM MIT License Continuous Integration Coverage Status Dependabot Status

Lightweight serialization for TweetNaCl sealed box pattern.

Formats

Keys

TweetNaCl box key pairs are serialized using base64url, without trailing padding, and prefixed with an identifying tag:

TweetNaCl box key pair:
Public key: pk.Oq5P4CKFp8FStZr6EfbHzkX53LkJTXNCqqHdm6djFhk
Secret key: sk.LY6NqZ_oEnlgkv-plSldGgHvXmtqHqlnkI5JSTIC7I0

Messages

We use the sealed box pattern, where an ephemeral key pair is used for encrypting every message. The ephemeral public key is sent as part of the message, along with the nonce used for encryption and the ciphertext.

Example:

v1.naclbox.Eu6k3DshffqkRnqhtCFfZA4SCzgrxqXX6GeY1LbBZT0.utf8.LQ6atta_ET_-jLN2aLpKNIa35bDhxRum.ivrW2XNVK0_5Fc27oZpG3_onzX2U4Gg52oTbcEhN

The various parts are separated by a dot .:

Part Value
Version identifier v1
Algorithm naclbox
Ephemeral public key Eu6k3DshffqkRnqhtCFfZA4SCzgrxqXX6GeY1LbBZT0
Message encoding utf8
Nonce or IV LQ6atta_ET_-jLN2aLpKNIa35bDhxRum
Ciphertext ivrW2XNVK0_5Fc27oZpG3_onzX2U4Gg52oTbcEhN

Ephemeral public key, nonce and ciphertext are all base64url encoded, with optional trailing padding = characters.

License

MIT - Made with ❤️ by François Best.

crypto-box's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar franky47 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

visionarylab

crypto-box's Issues

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.