orbitz / ocaml-scrypt

C bindings and a high level interface to the official scrypt distribution.

Home Page:http://pacemkr.github.io/ocaml-scrypt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scrypt OCaml library

C bindings and a high level interface to the official scrypt distribution.
The original scrypt source is not modified in any way and is compiled directly using this companion Makefile.

Installation: opam install scrypt

Or, using make:

make
make install

Note

  • The scrypt distribution requires OpenSSL.
  • The make installation method requires ocamlfind.

Example usage

A simple toplevel demo of the API:

# #require "scrypt";;
...scrypt: added to search path
...scrypt.cma: loaded

# let passwd = "testpass";;
val passwd : string = "testpass"

# let cyphertext = Scrypt.encrypt_exn "my secret data" passwd;;
val cyphertext : string =
  "scrypt\000\017\000\000\000\b\000\000\000\004Y??\144k\133?T??U\134\019? \135?\011\139u\030_??6\137???\137:sA?\"?K1\138P\148I?\025?2]?U??s?7?۵\148[H?Y\026{?f???\029m?\130?\026?>\157'*?z?OH\019{6\006\028u\144??O\135|?\"?H\146<\127\030?\130?\012-R ??P???{{\023\018\146\151"
  
# let decrypted_data = Scrypt.decrypt_exn cyphertext passwd;;
val decrypted_data : string = "my secret data"

There are also non-exn versions of encrypt_exn and decrypt_exn that return a string option.

Full documentation: http://pacemkr.github.io/ocaml-scrypt/

About

C bindings and a high level interface to the official scrypt distribution.

http://pacemkr.github.io/ocaml-scrypt/

License:BSD 2-Clause "Simplified" License


Languages

Language:C 65.5%Language:Shell 26.7%Language:OCaml 2.8%Language:Makefile 2.6%Language:Groff 2.2%Language:C++ 0.2%