Giter VIP home page Giter VIP logo

ocaml-sodium's Introduction

ocaml-sodium

Ctypes bindings to libsodium 1.0.9+ which wraps NaCl. GNU/Linux, FreeBSD, and OS X operating systems are supported. OCaml 4.01.0 or later is required to build.

All original NaCl primitives are wrapped. crypto_shorthash is missing.

open Sodium
let nonce = Box.random_nonce () in
let (sk, pk ) = Box.random_keypair () in
let (sk',pk') = Box.random_keypair () in
let c = Box.Bytes.box sk pk' "Hello, Spooky World!" nonce in
let m = Box.Bytes.box_open sk' pk c nonce in
print_endline (String.escaped c);
print_endline m

Considerations

Originally described in The Security Impact of a New Cryptographic Library, NaCl is a high-level, performant cryptography library exposing a straightforward interface.

This binding has not been thoroughly and independently audited so your use case must be able to tolerate this uncertainty.

Despite ocaml-sodium's thin interface on top of libsodium, it is still important to be mindful of security invariants. In particular, you should ensure that nonces used for cryptographic operations are never repeated with the same key set.

Tests

Internal consistency tests may be found in lib_test.

Enclave Tests

(limited for now: under development)

make test_enclave

part of enclave-bindings repo.

Salt

Salt is very important for the camel. It needs eight times as much salt as do cattle and sheep. A camel needs 1 kg of salt a week and it is advisable to leave salt with camels every week.

-- UN FAO Manual for Primary Animal Health Care Workers

ocaml-sodium's People

Contributors

dsheets avatar whitequark avatar vbmithr avatar avsm avatar yallop avatar zatkh avatar cmb avatar chambart avatar klakplok avatar

Watchers

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