cryptol/examples/MiniLock
Aaron Tomb 49e847387e Simplify some type signatures in examples
These examples weren't type checking, and now do, with type constraints
that are no more awkward, and arguably less awkward, than before.
2017-06-22 10:09:13 -07:00
..
prim Simplify some type signatures in examples 2017-06-22 10:09:13 -07:00
File.md Update examples to use (/\) instead of (&&) where appropriate, 2016-08-22 18:14:44 -07:00
Keys.cry Update examples to use (/\) instead of (&&) where appropriate, 2016-08-22 18:14:44 -07:00
README.md integrate MiniLock example 2016-01-19 18:19:35 -08:00

Minilock in Cryptol

miniLock is a low-barrier to use file encryption utility based on the algorithms:

  • SCrypt
    • PBKDF2
    • HMAC-SHA512
  • Blake2s
  • Base64
  • Base58
  • CryptoBox
    • Salsa20
    • Curve25519
    • Poly1305

This example is a specification of miniLock file encryption in Cryptol including all component algorithms as well as primitive JSON encoding to allow inter-operability between the official miniLock written in JavaScript and files produced by Cryptol.

Use

To encrypt a file consider:

CRYPTOLPATH=`pwd`/prim cryptol File.md

Then use the miniLock function such as can be seen in test_lock:

miniLock [(theirID, nonceA)] filename contents (myPrivKey, myPubKey) key nonceF (ephemPriv, ephemPub)

Note SCrypt, and thus miniLock ID and key derivation from user passwords, is too expensive for the Cryptol interpreter to compute on all but todays more powerful computers. The ID generation can be done using mkID from Keys.cry.

License

Copyright (c) 2013-2016 Galois, Inc. Distributed under the terms of the BSD3 license (see LICENSE file)