2005-05-18 12:43:42 +01:00
|
|
|
# TMN
|
|
|
|
#
|
|
|
|
# Modelled after the description in the SPORE library
|
|
|
|
# http://www.lsv.ens-cachan.fr/spore/tmn.html
|
|
|
|
#
|
|
|
|
|
|
|
|
usertype Key;
|
|
|
|
|
|
|
|
const pk: Function;
|
|
|
|
secret sk: Function;
|
|
|
|
inversekeys(pk,sk);
|
|
|
|
|
|
|
|
protocol tmn(I,R,S)
|
|
|
|
{
|
2005-05-23 13:35:58 +01:00
|
|
|
role I
|
|
|
|
{
|
|
|
|
const Ki: Key;
|
|
|
|
var Kr: Key;
|
|
|
|
|
|
|
|
send_1(I,S, R,{Ki}pk(S) );
|
|
|
|
read_4(S,I, R,{Kr}Ki );
|
|
|
|
|
|
|
|
claim_I1(I,Secret,Ki);
|
|
|
|
claim_I2(I,Secret,Kr);
|
|
|
|
}
|
|
|
|
|
|
|
|
role R
|
|
|
|
{
|
|
|
|
const Kr: Key;
|
|
|
|
|
|
|
|
read_2(S,R, I );
|
|
|
|
send_3(R,S, I, { Kr }pk(S) );
|
|
|
|
|
|
|
|
claim_R1(R,Secret,Kr);
|
|
|
|
}
|
|
|
|
|
|
|
|
role S
|
|
|
|
{
|
|
|
|
var Ki,Kr: Key;
|
|
|
|
|
|
|
|
read_1(I,S, R,{Ki}pk(S) );
|
|
|
|
send_2(S,R, I );
|
|
|
|
read_3(R,S, I, { Kr }pk(S) );
|
|
|
|
send_4(S,I, R,{Kr}Ki );
|
|
|
|
}
|
2005-05-18 12:43:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const Alice,Bob,Eve,Simon: Agent;
|
|
|
|
const Ke: Key;
|
|
|
|
|
|
|
|
|
|
|
|
untrusted Eve;
|
|
|
|
compromised sk(Eve);
|
|
|
|
|
|
|
|
# Scenario to recreate an attack in SPORE
|
|
|
|
#run tmn.I (Alice,Bob,Simon);
|
|
|
|
#run tmn.R (Alice,Bob,Simon);
|
|
|
|
#run tmn.S (Alice,Bob,Simon);
|
|
|
|
|
|
|
|
run tmn.I (Agent,Agent,Simon);
|
|
|
|
run tmn.R (Agent,Agent,Simon);
|
|
|
|
run tmn.S (Agent,Agent,Simon);
|
|
|
|
|
|
|
|
|
|
|
|
|