2006-11-21 13:42:06 +00:00
|
|
|
# Lowe's fixed version of Needham Schroeder Public Key
|
|
|
|
#
|
|
|
|
# Modelled after the description in the SPORE library
|
|
|
|
# http://www.lsv.ens-cachan.fr/spore/nspkLowe.html
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Note:
|
|
|
|
# The modelling in SPORE includes a server to distribute the public keys
|
|
|
|
# of the agents, this is not necessary and it allows for attacks against
|
|
|
|
# synchronisation and agreement, because the keys that the server sends
|
|
|
|
# out can be replayed.
|
|
|
|
|
|
|
|
protocol needhamschroederpk-Lowe(I,R,S)
|
|
|
|
{
|
|
|
|
role I
|
|
|
|
{
|
2012-04-23 14:53:28 +01:00
|
|
|
fresh Ni: Nonce;
|
2006-11-21 13:42:06 +00:00
|
|
|
var Nr: Nonce;
|
|
|
|
|
|
|
|
send_1(I,S, (I,R));
|
2012-04-26 15:40:01 +01:00
|
|
|
recv_2(S,I, {pk(R), R}sk(S));
|
2006-11-21 13:42:06 +00:00
|
|
|
send_3(I,R,{Ni,I}pk(R));
|
2012-04-26 15:40:01 +01:00
|
|
|
recv_6(R,I, {Ni,Nr,R}pk(I));
|
2006-11-21 13:42:06 +00:00
|
|
|
send_7(I,R, {Nr}pk(R));
|
|
|
|
claim_I1(I,Secret,Ni);
|
|
|
|
claim_I2(I,Secret,Nr);
|
|
|
|
claim_I3(I,Nisynch);
|
|
|
|
}
|
|
|
|
|
|
|
|
role R
|
|
|
|
{
|
2012-04-23 14:53:28 +01:00
|
|
|
fresh Nr: Nonce;
|
2006-11-21 13:42:06 +00:00
|
|
|
var Ni: Nonce;
|
|
|
|
|
2012-04-26 15:40:01 +01:00
|
|
|
recv_3(I,R,{Ni,I}pk(R));
|
2006-11-21 13:42:06 +00:00
|
|
|
send_4(R,S,(R,I));
|
2012-04-26 15:40:01 +01:00
|
|
|
recv_5(S,R,{pk(I),I}sk(S));
|
2006-11-21 13:42:06 +00:00
|
|
|
send_6(R,I,{Ni,Nr,R}pk(I));
|
2012-04-26 15:40:01 +01:00
|
|
|
recv_7(I,R,{Nr}pk(R));
|
2006-11-21 13:42:06 +00:00
|
|
|
claim_R1(R,Secret,Nr);
|
|
|
|
claim_R2(R,Secret,Ni);
|
|
|
|
claim_R3(R,Nisynch);
|
|
|
|
}
|
|
|
|
|
|
|
|
role S
|
|
|
|
{
|
2012-04-26 15:40:01 +01:00
|
|
|
recv_1(I,S,(I,R));
|
2006-11-21 13:42:06 +00:00
|
|
|
send_2(S,I,{pk(R),R}sk(S));
|
2012-04-26 15:40:01 +01:00
|
|
|
recv_4(R,S,(R,I));
|
2006-11-21 13:42:06 +00:00
|
|
|
send_5(S,R,{pk(I),I}sk(S));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|