You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-22Lines changed: 26 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,7 @@
5
5
A pairing-based threshold cryptosystem for collaborative decryption and
6
6
signatures.
7
7
8
-
Provides constructors for encrypted message handling within a public key
9
-
encryption system. It utilizes the pairing elliptic curve library to create
10
-
and enable reconstruction of public and private key shares.
8
+
The `threshold_crypto` crate provides constructors for encrypted message handling. It utilizes the [`pairing`](https://crates.io/crates/pairing) elliptic curve library to create and enable reconstruction of public and private key shares.
11
9
12
10
In a network environment, messages are signed and encrypted, and key and
13
11
signature shares are distributed to network participants. A message can be
@@ -48,7 +46,7 @@ fn main() {
48
46
}
49
47
```
50
48
51
-
### More Examples
49
+
### Examples
52
50
53
51
Run examples from the [`examples`](examples) directory using:
The basic usage outline is: choose a threshold value t, create a key set, then
66
-
distribute N secret key shares among the participants and publish the public
67
-
master key. A third party can now encrypt a message to the public master key
63
+
[`MLOCK_SECRETS`](https://github.com/poanetwork/threshold_crypto/blob/master/src/lib.rs#L51): Sets whether or not the Unix syscall [`mlock`](http://man7.org/linux/man-pages/man2/mlock.2.html) or WinAPI function [`VirtualLock`](https://msdn.microsoft.com/en-us/library/windows/desktop/aa366895(v=vs.85).aspx) is called on portions of memory containing secret values. This option is enabled by default (`MLOCK_SECRETS=true`). Disabling memory locking (`MLOCK_SECRETS=false`) allows secret values to be copied to disk, where they will not be zeroed on drop and may persist indefinitely. **Disabling memory locking should only be done in development and testing.**
64
+
65
+
Disabling memory locking is useful because it removes the possibility of tests failing due to reaching the testing system's locked memory limit. For example, if your crate uses `threshold_crypto` and you write a test that maintains hundreds or thousands of secrets in memory simultaneously, you run the risk of reaching your system's allowed number of locked pages, which will cause this library to fail.
66
+
67
+
## Application Details
68
+
69
+
The basic usage outline is:
70
+
* choose a threshold value `t`
71
+
* create a key set
72
+
* distribute `N` secret key shares among the participants
73
+
* publish the public master key
74
+
75
+
A third party can now encrypt a message to the public master key
68
76
and any set of `t + 1` participants *(but no fewer!)* can collaborate to
69
-
decrypt it. Also, any `t + 1` participants can collaborate to sign a message,
70
-
producing a signature that can be verified against the public master key.
77
+
decrypt it. Also, any set of `t + 1` participants can collaborate to sign a message,
78
+
producing a signature that is verifiable with the public master key.
71
79
72
-
This cryptosystem has the property that signatures are unique, i.e.
73
-
independent of which particular participants produced it. If `S1` and `S2` are
80
+
In this system, a signature is unique and independent of
81
+
the set of participants that produced it. If `S1` and `S2` are
74
82
signatures for the same message, produced by two different sets of `t + 1`
75
-
secret key share holders each, then they won't just both be valid, but in fact
76
-
equal. This is useful in some applications, for example it allows using the
77
-
signature of a message as a pseudorandom number that is unknown to anyone
78
-
until `t + 1` participants agree to reveal it.
79
-
80
-
In its simplest form, threshold cryptography requires a trusted dealer who
81
-
produces the secret key shares and distributes them. However, there are ways
82
-
to produce the keys themselves in a way that guarantees that nobody except the
83
-
corresponding participant knows their secret in the end, and this crate
83
+
secret key share holders, both signatures will be valid AND
84
+
equal. This is useful in some applications, for example a message signature can serve as a pseudorandom number unknown to anyone until `t + 1` participants agree to reveal it.
85
+
86
+
In its simplest form, threshold_crypto requires a trusted dealer to
87
+
produce and distribute the secret key shares. However, keys can be produced so that only the corresponding participant knows their secret in the end. This crate
84
88
includes the basic tools to implement such a *Distributed Key Generation*
85
89
scheme.
86
90
87
-
One major application for this library is within distributed networks that
91
+
A major application for this library is within a distributed network that
88
92
must tolerate up to `t` adversarial (malicious or faulty) nodes. Because `t +
89
93
1` nodes are required to sign or reveal information, messages can be trusted
90
94
by third-parties as representing the consensus of the network.
0 commit comments