2005-05-12 13:27:18 +01: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.
|
|
|
|
|
2005-08-15 14:31:48 +01:00
|
|
|
secret pk: Function; # For some reason SPORE models it such that the agents
|
|
|
|
# do not know the public keys of the other agents
|
2005-05-12 13:27:18 +01:00
|
|
|
secret sk: Function;
|
|
|
|
inversekeys(pk,sk);
|
|
|
|
|
2005-08-15 14:31:48 +01:00
|
|
|
protocol needhamschroederpk-Lowe(I,R,S)
|
2005-05-12 13:27:18 +01:00
|
|
|
{
|
2005-05-23 13:35:58 +01:00
|
|
|
role I
|
|
|
|
{
|
2005-05-12 13:27:18 +01:00
|
|
|
const Ni: Nonce;
|
|
|
|
var Nr: Nonce;
|
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
send_1(I,S, (I,R));
|
2005-05-12 13:27:18 +01:00
|
|
|
read_2(S,I, {pk(R), R}sk(S));
|
|
|
|
send_3(I,R,{Ni,I}pk(R));
|
|
|
|
read_6(R,I, {Ni,Nr,R}pk(I));
|
|
|
|
send_7(I,R, {Nr}pk(R));
|
|
|
|
claim_I1(I,Secret,Ni);
|
|
|
|
claim_I2(I,Secret,Nr);
|
2005-08-15 14:31:48 +01:00
|
|
|
claim_I3(I,Nisynch);
|
2005-05-23 13:35:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
role R
|
|
|
|
{
|
2005-05-12 13:27:18 +01:00
|
|
|
const Nr: Nonce;
|
|
|
|
var Ni: Nonce;
|
|
|
|
|
|
|
|
read_3(I,R,{Ni,I}pk(R));
|
|
|
|
send_4(R,S,(R,I));
|
|
|
|
read_5(S,R,{pk(I),I}sk(S));
|
|
|
|
send_6(R,I,{Ni,Nr,R}pk(I));
|
|
|
|
read_7(I,R,{Nr}pk(R));
|
|
|
|
claim_R1(R,Secret,Nr);
|
|
|
|
claim_R2(R,Secret,Ni);
|
2005-08-15 14:31:48 +01:00
|
|
|
claim_R3(R,Nisynch);
|
2005-05-23 13:35:58 +01:00
|
|
|
}
|
2005-05-12 13:27:18 +01:00
|
|
|
|
|
|
|
role S
|
|
|
|
{
|
|
|
|
read_1(I,S,(I,R));
|
|
|
|
send_2(S,I,{pk(R),R}sk(S));
|
|
|
|
read_4(R,S,(R,I));
|
|
|
|
send_5(S,R,{pk(I),I}sk(S));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const Alice,Bob,Simon,Eve: Agent;
|
|
|
|
|
|
|
|
untrusted Eve;
|
|
|
|
const ne: Nonce;
|
|
|
|
compromised sk(Eve);
|
2005-08-15 14:31:48 +01:00
|
|
|
compromised pk(Eve);
|
|
|
|
compromised pk(Simon); # Needed because of the way SPORE models nsl
|
2005-05-12 13:27:18 +01:00
|
|
|
|
|
|
|
# General scenario, 2 parallel runs of the protocol
|
|
|
|
|
2005-08-15 14:31:48 +01:00
|
|
|
run needhamschroederpk-Lowe.I(Agent,Agent,Simon);
|
|
|
|
run needhamschroederpk-Lowe.S(Agent,Agent,Simon);
|
|
|
|
run needhamschroederpk-Lowe.R(Agent,Agent,Simon);
|
|
|
|
run needhamschroederpk-Lowe.I(Agent,Agent,Simon);
|
|
|
|
run needhamschroederpk-Lowe.R(Agent,Agent,Simon);
|
|
|
|
run needhamschroederpk-Lowe.S(Agent,Agent,Simon);
|