|
|
Algorithm 4 Seluge++ key generation implemented in Casper. |
|
| 1: |
#Free variables |
| 2: |
datatype F = G | Exp(F,Num) unwinding 2 |
| 3: |
BS, ND: Agent |
| 4: |
Ds, Dn: Num |
| 5: |
N1: Nonce |
| 6: |
Pub: Agent – > PublicKey |
| 7: |
Pri: Agent – > SecretKey |
| 8: |
H: HashFunction |
| 9: |
pwd: Agent x Agent – > Password |
| 10: |
InverseKeys = (sk,sk), (Exp, Exp), (Pub, Pri),(pwd, pwd) |
| 11: |
sk, Yn,Ys: F |
| 12: |
#Processes |
| 13: |
BASE(BS, Ds, SK) knows Pub, Pri(BS), pwd(BS,ND) |
| 14: |
MOTE(ND,Dn, N1, SK) knows Pub, pwd(BS,ND) |
| 15: |
#Protocol description |
| 16: |
0. – > BS : ND |
| 17: |
[BS ! = ND] |
| 18: |
1. BS – > ND : {Exp(G, Ds)%Qs}{Pri(BS)} |
| 19: |
[BS ! = ND and isExp(Qs)] |
| 20: |
< sk := Exp(Qs, Dn) > |
| 21: |
2. ND – > BS : Exp(G, Dn)%Qn, {Exp(G, Dn)%Qn}{pwd(BS, ND)} |
| 22: |
[ND ! = BS and isExp(Qn)] |
| 23: |
< sk := Exp(Qn, Ds) > |
| 24: |
3. BS – > ND : BS |
| 25: |
4. ND – > : sk |
| 26: |
#Equivalences |
| 27: |
forall x,y : Num . \ |
| 28: |
Exp(Exp(G,y), x) = Exp(Exp(G,x), y) |
| 29: |
#Specification |
| 30: |
– –Passed this test
|
| 31: |
Secret(BS, sk, [ND]) |
| 32: |
– –Passed this test
|
| 33: |
Secret(ND, sk, [BS]) |
| 34: |
– –Passed this test
|
| 35: |
WeakAgreement(BS,ND) |
| 36: |
#Functions |
| 37: |
inline isExp(y) = member(y, F__(1)) and y! =G |
| 38: |
symbolic Pub, Pri, pwd |
| 39: |
#Actual variables |
| 40: |
BaseStation, Node, Attacker : Agent |
| 41: |
W, ds, dn: Num |
| 42: |
n1, n2: Nonce |
| 43: |
#System |
| 44: |
BASE(BaseStation, ds) |
| 45: |
MOTE(Node, dn, n1) |
| 46: |
#Intruder Information |
| 47: |
Intruder = Attacker |
| 48: |
IntruderKnowledge = {Node, Intruder, W, n2, Pri(Attacker)} |
|