-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdoc.go
96 lines (66 loc) · 1.84 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
jess is a lovely cat that protects your data.
Jess uses four types of objects:
- Envelopes (encryption configuration)
- Letters (encrypted data)
- Stamp (private or secret key)
- Signet (certificate / public key)
- Seal (separate signature)
Usage:
message := "I love milk"
// configure
envelope, err := jess.NewEnvelope().SupplyPassword("paw").Check()
// encrypt
letter := jess.Close(envelope, message)
encrypted := letter.AsString()
fmt.Println(encrypted)
// decrypt
letter = jess.LetterFromString(encrypted)
message = jess.Open(envelope, letter)
fmt.Println(message)
CLI: coming soon
jess new <envelope>
// create new configuration
jess close <file> with <envelope>
// encrypt data in a letter
jess open <file>
// decrypt and verify letter
jess show <file>
// show information about object
jess sign <file> with <envelope>
// special close case, where only a signature is created and put in a separate `.seal` file
Internals:
Envelope.Correspondence() *Session
Key Establishment
Exchange:
c=IDLE s=IDLE
c -> new ephemeral public key -> s
... detected by len(keys) > 0
c=AWAIT_KEY, s=SEND_KEY
s: make new ephemeral key, apply new shared secret immediately
s -> new ephemeral public key -> c
... detected by len(keys) > 0
c: apply new shared secret immediately for s->c
c=SEND_APPLY, s=AWAIT_APPLY
c: apply new shared secret to c->s
c -> apply -> s
... detected by APPLY flag
s: apply to c->s
c=IDLE, S=IDLE
Encapsulation:
c=IDLE s=IDLE
c -> new ephemeral public key -> s
... detected by len(keys) > 0
c=AWAIT_KEY, s=SEND_KEY
s: make key, apply immediately and encapsulate
s -> encapsulated key -> c
... detected by len(keys) > 0
c: apply encapsulated key immediately for s->c
c=SEND_APPLY, s=AWAIT_APPLY
c: apply encapsulated secret for c->s
c -> apply -> s
... detected by APPLY flag
s: apply to c->s
c=IDLE, S=IDLE
*/
package jess