Giter Site home page Giter Site logo

savory's Introduction

Savory

A pure Elixir/Nif port of Freza's Erlang Salt application.

Salt is an Erlang wrapper for the libsodium library which, in turn, is an interface to the NaCl cryptographic primitives library. NaCl (which is also pronounced salt) is covered in detail here:

###Motivation While the Erlang standard library does have a crpyto package, there are numerous reasons you'd want to use a well-vetted, widely used low-level encryption package. More importantly, NaCl (and libsodium by extension) addresses a number of failings in other cryptographic libraries. That topic is covered in some detail in The security impact of a new cryptographic library.

Libsodium itself has bindings in a number of different languages almost 2 dozen languages with more or less the same API being exposed.

##Examples ###Public key: {a_pk, a_sk} = Savory.crypto_box_keypair() nc = Savory.crypto_random_bytes(24) pt = "Hello bob, message from Alice" ct = Savory.crypto_box(pt, nc, a_pk, a_sk) {:ok, d_pt} = Savory.crypto_box_open(ct, nc, a_pk, a_sk)

###Secret Key: sk = Savory.crypto_random_bytes(32) nc = Savory.crypto_random_bytes(24) pt = <<"Secret Message">> ct = Savory.crypto_secretbox(pt, nc, sk) assert {:ok, pt} == Savory.crypto_secretbox_open(ct, nc, sk)

##Dependencies

Libsodium needs to be installed:

git clone https://github.com/jedisct1/libsodium.git
cd libsodium
./autogen.sh
./configure && make check
sudo make install

##TODO:

  • Improve documentation
    • Add more use cases
    • Write module docs
  • Bench mark the use of gen_server and the corresponding nif support (it may be unnecessary). Any changes shouldn't affect the API

savory's People

Contributors

electricfeel avatar

Watchers

James Cloos avatar RAWdaMedia 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.