cpsa-3.3.0: doc/examples/blanchet.scm
(herald "Blanchet's Simple Example Protocol"
(comment "There is a flaw in this protocol by design"))
(defprotocol blanchet basic
(defrole init
(vars (a b akey) (s skey) (d data))
(trace
(send (enc (enc s (invk a)) b))
(recv (enc d s)))
(uniq-orig s))
(defrole resp
(vars (a b akey) (s skey) (d data))
(trace
(recv (enc (enc s (invk a)) b))
(send (enc d s)))
(uniq-orig d))
(comment "Blanchet's protocol"))
(defskeleton blanchet
(vars (a b akey) (s skey) (d data))
(defstrand init 2 (a a) (b b) (s s) (d d))
(non-orig (invk b))
(comment "Analyze from the initiator's perspective"))
(defskeleton blanchet
(vars (a b akey) (s skey) (d data))
(defstrand resp 2 (a a) (b b) (s s) (d d))
(non-orig (invk a) (invk b))
(comment "Analyze from the responder's perspective"))
(defskeleton blanchet
(vars (a b akey) (s skey) (d data))
(defstrand init 2 (a a) (b b) (s s) (d d))
(deflistener d)
(non-orig (invk b))
(comment "From the initiator's perspective, is the secret leaked?"))
(defskeleton blanchet
(vars (a b akey) (s skey) (d data))
(defstrand resp 2 (a a) (b b) (s s) (d d))
(deflistener d)
(non-orig (invk a) (invk b))
(comment "From the responders's perspective, is the secret leaked?"))
(defprotocol blanchet-corrected basic
(defrole init
(vars (a b akey) (s skey) (d data))
(trace
(send (enc (enc s b (invk a)) b))
(recv (enc d s)))
(uniq-orig s))
(defrole resp
(vars (a b akey) (s skey) (d data))
(trace
(recv (enc (enc s b (invk a)) b))
(send (enc d s)))
(uniq-orig d))
(comment "Corrected Blanchet's protocol"))
(defskeleton blanchet-corrected
(vars (a b akey) (s skey) (d data))
(defstrand init 2 (a a) (b b) (s s) (d d))
(non-orig (invk b))
(comment "Analyze from the initiator's perspective"))
(defskeleton blanchet-corrected
(vars (a b akey) (s skey) (d data))
(defstrand init 2 (a a) (b b) (s s) (d d))
(deflistener d)
(non-orig (invk b))
(comment "From the initiator's perspective, is the secret leaked?"))
(defskeleton blanchet-corrected
(vars (a b akey) (s skey) (d data))
(defstrand resp 2 (a a) (b b) (s s) (d d))
(non-orig (invk a) (invk b))
(comment "Analyze from the responder's perspective"))
(defskeleton blanchet-corrected
(vars (a b akey) (s skey) (d data))
(defstrand resp 2 (a a) (b b) (s s) (d d))
(deflistener d)
(non-orig (invk a) (invk b))
(comment "From the responders's perspective, is the secret leaked?"))