-
Notifications
You must be signed in to change notification settings - Fork 1
/
paste.vp
46 lines (34 loc) · 1.11 KB
/
paste.vp
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
attacker[passive]
principal Server[]
principal Reader[]
principal Creator[
knows private paste
knows password optional_secret
generates key, cipher_iv, kdf_salt
// PBKDF2
kdf_key1 = HKDF(kdf_salt, CONCAT(key, optional_secret), cipher_iv)
cipher_text = AEAD_ENC(kdf_key1, paste, CONCAT(cipher_iv, kdf_salt))
]
Creator -> Server: cipher_text, cipher_iv, kdf_salt
principal Server [
generates paste_id
]
Server -> Creator: paste_id
phase[1]
Creator -> Reader: paste_id, key, optional_secret
phase[2]
// in response to: Reader -> Server: paste_id
Server -> Reader: cipher_text, cipher_iv, kdf_salt
principal Reader[
kdf_key2 = HKDF(kdf_salt, CONCAT(key, optional_secret), cipher_iv)
dec_paste = AEAD_DEC(kdf_key2, cipher_text, CONCAT(cipher_iv, kdf_salt))?
]
queries[
// paste can be obtained by the attacker, because they get the same information as Reader:
confidentiality? paste
// both key and optional_password can be obtained even by a passive attacker:
confidentiality? key
confidentiality? optional_secret
// the server or the attacker can spoof the message:
authentication? Creator -> Reader: cipher_text
]