We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c2d2450 commit b1d9f0dCopy full SHA for b1d9f0d
README.md
@@ -1 +1,29 @@
1
-# dh
+# dh
2
+
3
+dh is a simple, ready to use Diffie-Hellman-Ephemeral implementation written in golang
4
+using MODP groups as defined in [RFC3526](https://datatracker.ietf.org/doc/html/rfc3526).
5
6
+Example:
7
8
+```Go
9
+import (
10
+ "fmt"
11
+ "reflect"
12
+ "github.com/WolframAlph/dh"
13
+)
14
15
+func main() {
16
+ alice := dh.New()
17
+ bob := dh.New()
18
19
+ aliceSecret := alice.ComputeSecret(bob.PublicKey)
20
+ bobSecret := bob.ComputeSecret(alice.PublicKey)
21
22
+ fmt.Println(reflect.DeepEqual(aliceSecret, bobSecret))
23
+}
24
+```
25
26
+## Notes
27
28
+1. You must use the same MODP group on both sides, or else you
29
+ end up with non-matching keys. Group #14 is used by default.
0 commit comments