threshold_crypto/examples
Andrew Gross b39cc1f909 Typo fixes, added Code of Conduct file 2018-09-12 11:28:23 -06:00
..
README.md Minor README modifications, added environment variables section 2018-08-29 10:35:12 -06:00
basic_pkc.rs Added basic public-key cryptography example. 2018-08-29 06:06:52 -07:00
threshold_enc.rs Typo fixes, added Code of Conduct file 2018-09-12 11:28:23 -06:00
threshold_sig.rs Typo fixes, added Code of Conduct file 2018-09-12 11:28:23 -06:00

README.md

Examples

Run examples using:

$ MLOCK_SECRETS=false cargo run --example <example name>
  • Public-Key Cryptography - Demonstrates how to generate a random secret-key and corresponding public-key, sign some bytes using a secret-key, validate the signature for some bytes using a public-key, encrypt some bytes using a public-key, and how to decrypt a ciphertext using a secret-key.

  • Threshold Encryption - Demonstrates how to encrypt a message to a group of actors with a master public-key, where the number of actors collaborating in the decryption process must exceed a given threshold number before the ciphertext can be successfully decrypted. This example also demonstrates the idea of a "trusted dealer", i.e. some trusted entity that is responsible for generating the keys.

  • Threshold Signing - Demonstrates how threshold signing can be used to generate an append-only ledger of chat messages. Each node running our chat protocol receives and signs messages (using its share of the network's master secret-key). The network adds a new message to the ledger once enough nodes (threshold + 1) have signed a given message.