-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPUF_strong_mutual.spthy
225 lines (194 loc) · 5.61 KB
/
PUF_strong_mutual.spthy
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/******************************************************************************
* Mutual authentication based on stong PUFs and hashes - no noise
*
* check with:
* tamarin-prover --prove PUF_strong_mutual.spthy
******************************************************************************/
theory PUF_strong_mutual
begin
// PUF is private
functions: spuf/2 [private]
builtins: hashing
/*
* Strong PUF model
*/
rule PUF:
[ PUFin(D,c) ] --[ PUF(D,c) ]-> [ PUFout(D, c, spuf(D,c)) ]
rule CRP:
[ CRPin(A,D), Fr(~c) ] --[ CRP(A,D,~c) ]-> [ !CRPout(A,D,~c,spuf(D,~c)) ]
rule BreakPUF:
[ In(<D,c>) ] --[ BreakPUF(D,c) ]-> [ Out(spuf(D,c)) ]
rule RevealCRP:
[ !CRPout(A,D,c,p) ] --[ RevealCRP(A,D,c) ]-> [ Out(<c,p>) ]
rule Modeling:
[ In(<D,c,spuf(D,c1)>) ] --[ Model(D) ]-> [ Out(spuf(D,c)) ]
/*
* Hash-based mutual authentication based on strong PUFs
* For strong agreement it is necessary that A is included in the hash.
* The PUF challenge plays the role of first nonce n
*
* A -> D: c
* D -> A: m,h(A,spuf(D,c),m)
* A -> D: h(spuf(D,c),m)
*
*/
rule BuildWeakCRPs:
[ ] --> [ CRPin($A,$D) ] // builds CRPs for Server-Device pairs
rule Alice0:
[ ] --> [ Alice0($A) ]
rule Alice1:
[ Alice0(A),!CRPout(A,D,c,r) ]
--[ Start(A,D,c) ]->
[ Out(<A,D,c>), Alice2(A,D,c,r) ]
rule Alice2:
[ Alice2(A,D,c,r), In(<D,A,m,h(A,r,m)>) ]
--[ Run(A,D,<'AtoD',c,m>), Commit(A,D,<'DtoA',c,m>) ]->
[ Out(<A,D,h(r,m)>) ]
rule Don0:
[ ] --> [ Don0($D) ]
rule Don1:
[ Don0(D),In(<A,D,c>), Fr(~m) ]
--[ Run(D,A,<'DtoA',c,~m>) ]->
[ PUFin(D,c), Don2(D,A,c,~m) ]
rule Don2:
[ Don2(D,A,c,m), PUFout(D,c,r) ] -->
[ Out(<D,A,m,h(A,r,m)>), Don3(D,A,r,c,m) ]
rule Don3:
[ Don3(D,A,r,c,m), In(<A,D,h(r,m)>) ]
--[ Commit(D,A,<'AtoD',c,m>) ]->
[ ]
// ======================================
/*
* Initialization is before deployment
*/
restriction resCRPbeforePUF:
"All A D c1 c2 #i #j. CRP(A,D,c1)@i & PUF(D,c2)@j ==> i < j"
/*
* CRPs are not reused
*/
restriction resCRPnotReuse:
"All A D x #i #j. Run(A,D,x)@i & Run(A,D,x)@j & (Ex c r. x = <'AtoD',c,r>) ==> #i = #j"
/*
* sanity check: the protocol can commit in both directions
*/
lemma Sanity:
exists-trace
"
Ex A D c r #i. Commit(A,D,<'DtoA',c,r>)@i
&
Ex A D c r #i. Commit(A,D,<'AtoD',c,r>)@i
&
not (Ex A D c #k. RevealCRP(A,D,c)@k)
&
not (Ex D c #k. BreakPUF(D,c)@k)
&
not (Ex D #k. Model(D)@k)
"
/*
* Helper lemma stating that Modeling requires another attack to
* intercept one PUF value. This is similar to the Secrecy_A
* property below. Interestingly, without this lemma next proofs
* do not converge.
*/
lemma modelPUF [use_induction,reuse]:
"All D #t . Model(D)@t ==>
(Ex a c #i.RevealCRP(a,D,c)@i & i<t ) // CRP for D is revealed by one server
|
(Ex c #i.BreakPUF(D,c)@i & i<t) // PUF for D is broken
"
/*
* Property: Secrecy of PUF with respect to A
* with A = {BreakPUF(D,c), RevealCRP(a,D,c)}
*
* Intuition:
* puf values are only leaked if some CRP is explicity revealed or
* if puf has been broken.
*
* Note: Modelling is not possible without at least one PUF value. This
* is why we quantify over all possibles c's
*/
lemma Secrecy_A [use_induction,reuse]:
"All D p c #t. K(p)@t & p = spuf(D,c) ==>
(Ex a c #i.RevealCRP(a,D,c)@i & i<t ) // CRP for D is revealed by one server
|
(Ex c #i.BreakPUF(D,c)@i & i<t) // PUF for D is broken
"
/*
* The following property is the same that we checked for weak PUFs!
* We use A = {BreakPUF(D,c), RevealCRP(a,D,c)} as for secrecy.
*/
lemma MutualAuthentication_A:
"All B C x #i. Commit(B,C,x)@i ==>
(
(Ex #j. Run(C,B,x)@j
& j<i
& not (Ex E G #k. Commit(E,G,x) @k & not (#k = #i)))
| (
(Ex n m. x = <'DtoA',n,m>) & // C is the Device
(
(Ex G c #r. RevealCRP(G,C,c)@r & r<i) // Need generic G if we don't add Model
|
(Ex c #r. BreakPUF(C,c)@r & r<i)
)
)
| (
(Ex n m. x = <'AtoD',n,m>) & // B is the device
(
(Ex E c #r. RevealCRP(E,B,c)@r & r<i) // It is enough that one party E that registered B reveals the CRP
|
(Ex c #r. BreakPUF(B,c)@r & r<i)
)
)
)
"
/*
* This is the stronger refined property
*
* it holds for sets
* A1 = {BreakPUF(D,c), RevealCRP(a,D,c)}
* A2 = {BreakPUF(D,X), RevealCRP(a,D,X)}
*/
lemma MutualAutentication_A1_A2:
"All B C x y c m #t. Commit(B,C,x)@t & x = <y,c,m> ==>
(
(Ex #j. Run(C,B,x)@j & j<t
& not (Ex E F #k. Commit(E,F,x)@k & not (#k = #t)))
|
(
y = 'DtoA' & // C is the Device
(
(
(Ex #r. Model(C)@r & r<t) &
(
(Ex E c2 #r. RevealCRP(E,C,c2)@r & r<t ) // It is enough that one party E that registered C reveals one CRP
|
(Ex c2 #r. BreakPUF(C,c2)@r & r<t )
)
)
|
(Ex #r. RevealCRP(B,C,c)@r & r<t) // It is necessary that B revels its CRP!
|
(Ex #k #w. w<k & k<t & Start(B,C,c)@w & BreakPUF(C,c)@k )
)
)
|
(
y = 'AtoD' & // B is the device
(
(
(Ex #r. Model(B)@r & r<t) &
(
(Ex E c2 #r. RevealCRP(E,B,c2)@r & r<t ) // It is enough that one party E that registered B reveals one CRP
|
(Ex c2 #r. BreakPUF(B,c2)@r & r<t )
)
)
|
(Ex E #r. RevealCRP(E,B,c)@r & r<t) // It is enough that one party E that registered B reveals the CRP
|
(Ex #r. BreakPUF(B,c)@r & r<t)
)
)
)
"
end