cryptol/examples/MiniLock
2018-10-10 16:21:38 -07:00
..
prim Merge Cryptol/Extras.cry with Cryptol.cry 2018-05-23 15:55:05 -07:00
File.md Rename prelude function width to length, and generalize its type. 2018-10-10 16:21:38 -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)