salsa20version
Salsa20 family of encryption functions, in pure OCaml
utop[0]> #require "mirage-crypto";;
utop[1]> #require "mirage-crypto-rng.unix";;
utop[2]> Mirage_crypto_rng_unix.initialize ();;
- : unit = ()
utop[3]> let key = Mirage_crypto_rng.generate 32;;
val key : Cstruct.t = {Cstruct.buffer = <abstr>; off = 0; len = 32}
utop[4]> let nonce = Cstruct.create 8;;
val nonce : Cstruct.t = {Cstruct.buffer = <abstr>; off = 0; len = 8}
utop[5]> #require "salsa20";;
utop[6]> let state = Salsa20.create key nonce;;
val state : Salsa20.t = <abstr>
utop[7]> Salsa20.encrypt (Cstruct.of_string "My secret text") state |> Cstruct.to_string;;
- : string = " 2\193\020`\142\182\234\188H[R\241V"
Author | Alfredo Beaumont <alfredo.beaumont@gmail.com> |
---|---|
License | BSD-2-Clause |
Published | |
Homepage | https://github.com/abeaumont/ocaml-salsa20 |
Issue Tracker | https://github.com/abeaumont/ocaml-salsa20/issues |
Maintainer | Alfredo Beaumont <alfredo.beaumont@gmail.com> |
Dependencies |
|
Source [http] | https://github.com/abeaumont/ocaml-salsa20/archive/1.2.0.tar.gz md5=aabca4d3954543cf8afb5121e0719821 sha512=afe2212ee6f44a32811214b0a369be06ed7806e501adb4e98dd5b0bc0718ce311c8306919813d64ed7a6df3d6147d42ce819488801b863d5cd31079c37120fbb |
Edit | https://github.com/ocaml/opam-repository/tree/master/packages/salsa20/salsa20.1.2.0/opam |
No package is dependent