theory OtwayReesBurrows begin /* * Protocol : Otway-Ress Protocol modified by Burrows et al Modeled by : Rajiv Ranjan Singh January 2019 */ /* Protocol: 1. A -> B : M,A,B,{Na,M,A,B}Kas 2. B -> S : M,A,B,{Na,M,A,B}Kas,Nb,{M,A,B}Kbs 3. S -> B : M,{Na,Kab}Kas,{Nb,Kab}Kbs 4. B -> A : M,{Na,Kab}Kas M is session ID Na and Nb are nonces chosen by A and B respectively. */ functions: enc/2, dec/2 equations: dec(enc(M,k), k) = M rule setup: [ Fr(~k) ] --[ KeyGen($A) ]-> [ !SharedKeyWithServer($A, ~k) ] rule reveal: [ !SharedKeyWithServer(X, k) ] --[ Reveal(X) ]-> [ Out(k) ] rule A1: let m1= enc(<~na,~RID,$A,$B>,kas) msg1= <~RID,$A,$B,m1> in [Fr(~RID), Fr(~na), !SharedKeyWithServer($A,kas) ] --[ LogA1($A,$B,msg1) ]-> [ Initiator1($A,$B,~RID,~na), Out(<~RID,$A,$B,m1>) ] rule B2: let m2 = enc(,kas) m3 = enc(,kbs) msg1= msg2= in [ In(), Fr(~nb),!SharedKeyWithServer($B,kbs) ] --[ LogB2($A,$B,na,msg1,msg2)]-> [ Responder2($A,$B,RID,na,~nb), Out() ] rule S3: let m4 = enc(,kas) m5 = enc(,kbs) m6 = enc(,kas) m7 = enc(,kbs) msg2= msg3= in [ In(), Fr(~kab),!SharedKeyWithServer($A,kas), !SharedKeyWithServer($B,kbs) ] --[ KeySharedInit($A,$B,~kab,RID,na,nb) , LogS3($A,$B,msg2,msg3) ]-> [ Out()] rule B4: let m8 = enc(,kas) m9 = enc(,kbs) msg3= msg4= in [ Responder2($A,$B,RID,na,nb), In(),!SharedKeyWithServer($B,kbs) ] --[ KeySharedResp($B,$A,kab,RID,na,nb) , Secret($A,$B,kab) ,LogB4($A,$B,msg3,msg4)]-> [ Out() ] rule A5: let msg4= ,kas)> in [Initiator1($A,$B,RID,na),!SharedKeyWithServer($A,kas), In(,kas)>)] --[ LogA5($A,$B,msg4), Secret($B,$A,kab) ]-> [ ] lemma executable: exists-trace "Ex A B k #i #j. Secret(A,B,k)@i & Secret(B,A,k)@j" restriction singlesharedkeyperuser: "All A #i #j. KeyGen(A) @ i & KeyGen(A) @ j ==> #i = #j" lemma AuthenticatewithSamekey: " /* Whenever initiator initiates a key share , then*/ All A B key #i. Secret(A,B,key) @ i ==> /* there is somebody running a session */ (Ex #j. Secret(B,A,key) @ j & j < i ) " // Nonce secrecy from the perspective of both the initiator and the responder. lemma key_secrecy: " /* It cannot be that */ not( Ex A B s #i. /* somebody claims to have setup a shared secret, */ Secret(A, B, s) @ i /* but the adversary knows it */ & (Ex #j. K(s) @ j) /* without having performed a long-term key reveal. */ & not (Ex #r. Reveal(A) @ r) & not (Ex #r. Reveal(B) @ r) )" end