---- CarlsenŐs Secret Key Initiator Protocol --------------------------------------------------- --- We modify only the relevant MAUDE-NPA modules --------------------------------------------------- fmod PROTOCOL-EXAMPLE-SYMBOLS is --- Importing sorts Msg, Fresh, Public protecting DEFINITION-PROTOCOL-RULES . ---------------------------------------------------------- --- Overwrite this module with the syntax of your protocol --- Notes: --- * Sort Msg and Fresh are special and imported --- * Every sort must be a subsort of Msg --- * No sort can be a supersort of Msg ---------------------------------------------------------- --- Sort Information sorts UName SName Name Key Nonce Masterkey Sessionkey . subsort Name Nonce Key < Msg . subsort Masterkey Sessionkey < Key . subsort SName UName < Name . subsort Name < Public . --- This is quite relevant and necessary --- Nonce operator op n : Name Fresh -> Nonce [frozen] . op mr : Name Fresh -> Nonce [frozen] . --- Nonce, run identifier --- User names ops a b i : -> UName . --- Server name op s : -> SName . --- MKey op mkey : Name Name -> Masterkey [frozen comm] . --- Seskey op seskey : Name Name Nonce -> Sessionkey [frozen] . ---encrypt op e : Key Msg -> Msg [frozen] . op d : Key Msg -> Msg [frozen] . --- successor op p : Msg -> Msg [frozen] . --- Concatenation op _;_ : Msg Msg -> Msg [frozen gather (e E)] . endfm fmod PROTOCOL-EXAMPLE-ALGEBRAIC is protecting PROTOCOL-EXAMPLE-SYMBOLS . ---------------------------------------------------------- --- Overwrite this module with the algebraic properties --- of your protocol ---------------------------------------------------------- eq d(K:Key, e(K:Key, Z:Msg)) = Z:Msg [variant] . eq e(K:Key, d(K:Key, Z:Msg)) = Z:Msg [variant] . endfm fmod PROTOCOL-SPECIFICATION is protecting PROTOCOL-EXAMPLE-SYMBOLS . protecting DEFINITION-PROTOCOL-RULES . protecting DEFINITION-CONSTRAINTS-INPUT . ---------------------------------------------------------- --- Overwrite this module with the strands --- of your protocol ---------------------------------------------------------- var A B S : UName . var r r' r'' r''' r# r## r1 rM : Fresh . vars TS NA NMA NB NMB NMS NB1 : Nonce . vars M1 M2 MA MB MS N M : Msg . var K : Key . var SK : Sessionkey . eq STRANDS-DOLEVYAO = :: nil :: [ nil | +(A), nil ] & :: nil :: [ nil | +(s), nil ] & :: nil :: [ nil | -(M), +(p(M)), nil ] & :: nil :: [ nil | -(K), -(M), +(d(K,M)), nil ] & :: nil :: [ nil | -(K), -(M), +(e(K,M)), nil ] & :: nil :: [ nil | -(N), -(M), +(M ; N) , nil ] & :: nil :: [ nil | -(M ; N), +(M) , nil ] & :: nil :: [ nil | -(M ; N), +(N) , nil ] & :: nil :: [ nil | +(mkey(i,A)), nil ] & :: nil :: [ nil | +(mkey(i,s)), nil ] [nonexec] . eq STRANDS-PROTOCOL --- Alice's Strand. = :: r :: [ nil | +(A ; n(A,r)), -(e(mkey(A,s) , n(A,r) ; B ; SK) ; e(SK , n(A,r)) ; NB1), +(e(SK , NB1)), nil ] & :: r , r1 :: --- Bob's Strand. [ nil | -(A ; NA), +(A ; NA ; B ; n(B,r)), -(e(mkey(B,s) , SK ; n(B,r) ; A) ; MA), +(MA ; e(SK, NA) ; n(B,r1)), -(e(SK , n(B,r1))), nil ] & :: r :: --- Server's Strand [ nil | -(A ; NA ; B ; NB), +( e(mkey(B,s), seskey(A, B, n(S,r)) ; NB ; A) ; e(mkey(A,s), NA ; B ; seskey(A, B, n(S,r)))), nil] [nonexec] . eq ATTACK-STATE(0) = --- A normal execution of the protocol :: r , r1 :: --- Bob's Strand. [ nil, -(a ; NA), +(a ; NA ; b ; n(b,r)), -(e(mkey(b,s) , SK ; n(b,r) ; a) ; MA), +(MA ; e(SK, NA) ; n(b,r1)), -(e(SK , n(b,r1))) | nil ] || empty || nil || nil || nil [nonexec] . endfm --- THIS HAS TO BE THE LAST LOADED MODULE !!!! fmod MAUDE-NPA is protecting GENERIC-TOOLS . endfm