scyther/testing/protocols/misc/bke-broken.spdl

45 lines
700 B
Plaintext
Raw Normal View History

2006-11-21 13:40:50 +00:00
/*
Bilateral Key Exchange with Public Key protocol (bkebroken)
Broken version with man in the middle attack.
*/
usertype Key;
const pk,h: Function;
secret sk,hinv: Function;
inversekeys (pk,sk);
inversekeys (h,hinv);
protocol bkebroken(I,R)
{
role I
{
fresh ni: Nonce;
2006-11-21 13:40:50 +00:00
var nr: Nonce;
var kir: Key;
send_1 (I,R, { ni,I }pk(R) );
2012-05-02 22:26:41 +01:00
recv_2 (R,I, { h(ni),nr,kir }pk(I) );
2006-11-21 13:40:50 +00:00
send_3 (I,R, { h(nr),kir }pk(R) );
claim_4 (I, Secret, kir );
}
role R
{
var ni: Nonce;
fresh nr: Nonce;
fresh kir: Key;
2006-11-21 13:40:50 +00:00
2012-05-02 22:26:41 +01:00
recv_1 (I,R, { ni,I }pk(R) );
2006-11-21 13:40:50 +00:00
send_2 (R,I, { h(ni),nr,kir }pk(I) );
2012-05-02 22:26:41 +01:00
recv_3 (I,R, { h(nr),kir }pk(R) );
2006-11-21 13:40:50 +00:00
claim_5 (R, Secret, kir );
}
}
untrusted e;
compromised sk(e);