-
Notifications
You must be signed in to change notification settings - Fork 39
/
needham-schroeder-sk-amend.spdl
66 lines (55 loc) · 1.45 KB
/
needham-schroeder-sk-amend.spdl
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
# Amended Needham Schroeder Symmetric Key
#
# Modelled after the description in the SPORE library
# http://www.lsv.ens-cachan.fr/spore/nssk_amended.html
#
#
# Note:
# According to SPORE there are no attacks on this protocol, scyther
# finds one however. This has to be investigated further.
# Model dec that is invertible by inc
const dec,inc: Function;
inversekeys(dec,inc);
usertype SessionKey;
const Fresh: Function;
const Compromised: Function;
protocol needhamschroedersk-amend(I,R,S)
{
role I
{
fresh Ni: Nonce;
var Nr: Nonce;
var Kir: SessionKey;
var T,T2: Ticket;
send_1(I,R,I);
recv_2(R,I,T);
send_3(I,S,(I,R,Ni,T));
recv_4(S,I, {Ni,R,Kir,T2}k(I,S));
send_5(I,R,T2);
recv_6(R,I,{Nr}Kir);
send_7(I,R,{{Nr}dec}Kir);
claim_I2(I,Secret,Kir);
claim_I3(I,Nisynch);
claim_I4(I,Empty,(Fresh,Kir));
}
role R
{
fresh Nr: Nonce;
var Kir: SessionKey;
recv_1(I,R,I);
send_2(R,I,{I,Nr}k(R,S));
recv_5(I,R,{Kir,Nr,I}k(R,S));
send_6(R,I,{Nr}Kir);
recv_7(I,R,{{Nr}dec}Kir);
claim_R1(R,Secret,Nr);
claim_R3(R,Nisynch);
claim_R4(R,Empty,(Fresh,Kir));
}
role S
{
var Ni,Nr: Nonce;
fresh Kir: SessionKey;
recv_3(I,S,(I,R,Ni,{I,Nr}k(R,S)));
send_4(S,I,{Ni,R,Kir,{Kir,Nr,I}k(R,S)}k(I,S));
}
}