theory AliceBobCarol
begin
builtins: symmetric-encryption
rule shared_symmetric_keys:
[ Fr(~key) ]
--[ KeyGeneration($A) ]->
[ !SessionKey(~key, $A) ]
rule Init_Alice:
[ Fr(~idThreadAlice)]
-->
[ St_Alice_1($Alice, $Bob, $Carol, ~idThreadAlice) ]
rule Init_Bob:
[ Fr(~idThreadBob)]
-->
[ St_Bob_1($Alice, $Bob, ~idThreadBob) ]
rule Init_Carol:
[ Fr(~idThreadCarol) ]
-->
[ St_Carol_1($Alice, $Carol, ~idThreadCarol) ]
rule Alice_send_Bob_Carol:
[ St_Alice_1($Alice, $Bob, $Carol, ~idThreadAlice)
, Fr(~x)
, Fr(~y)
, !SessionKey(~kAB, $Bob)
, !SessionKey(~kAC, $Carol)]
--[ Sent_Bob(~x, ~kAB), Sent_Carol(~y, ~kAC)]->
[ Out(<'1', $Alice, $Bob, senc(~x, ~kAB)>), Out(<'2', $Alice, $Carol, senc(~y, ~kAC)>), St_Alice_2($Alice, $Bob, ~idThreadAlice, ~x, ~y)]
rule Bob_receive_Alice:
let
x = sdec(encryption_x, ~kAB)
in
[ St_Bob_1($Alice, $Bob, ~idThreadBob)
, !SessionKey(~kAB, $Bob)
, In(<'1', $Alice, $Bob, encryption_x>) ]
--[ Reveived_BAlice(x, ~kAB) ]->
[ St_Bob_2($Alice, $Bob, ~idThreadBob, x)]
rule Carol_receive_Alice:
let
y = sdec(encryption_y, ~kAC)
in
[ St_Carol_1($Alice, $Carol, ~idThreadCarol)
, !SessionKey(~kAC, $Carol)
, In(<'2', $Alice, $Carol, encryption_y>) ]
--[ Received_CAlice(y, ~kAC) ]->
[ St_Carol_2($Alice, $Carol, ~idThreadCarol, y)]
lemma executable:
exists-trace
"Ex x y kac kab #i #j #k #l. Sent_Bob(x, kab) @ i
& Sent_Carol(y, kac) @ j
& Reveived_BAlice(x, kab) @ #k
& Received_CAlice(y, kac) @ l
& i < k
& j < l"
end