0f54f2ed23
SPORE: - pk is not known to all agents, only pk(Simon) is known - Use new naming convention: - Protocol name starting with an @ means internal protocol - For non internal protocols naming is as follows: protocolname-variant^subprotocol For example: yahalom-Lowe^KeyCompromise meaning the key compromise sub protocol of the Lowe variant of the Yahalom protocol.
97 lines
2.3 KiB
Plaintext
97 lines
2.3 KiB
Plaintext
# Needham Schroeder Symmetric Key
|
|
#
|
|
# Modelled after the description in the SPORE library
|
|
# http://www.lsv.ens-cachan.fr/spore/nssk.html
|
|
#
|
|
#
|
|
# Note:
|
|
# This protocol uses a ticket so scyther will only be able to verify
|
|
# the protocol using the ARACHNE engine (-a)
|
|
#
|
|
|
|
|
|
secret k: Function;
|
|
# Model dec that is invertible by inc
|
|
const dec,inc: Function;
|
|
inversekeys(dec,inc);
|
|
usertype SessionKey;
|
|
const Fresh: Function;
|
|
const Compromised: Function;
|
|
|
|
protocol needhamschroedersk^KeyCompromise(C)
|
|
{
|
|
// Read the names of 3 agents and disclose a session between them including
|
|
// corresponding session key to simulate key compromise
|
|
role C {
|
|
const Ni,Nr: Nonce;
|
|
const Kir: SessionKey;
|
|
var I,R,S: Agent;
|
|
|
|
read_C1(C,C, I,R,S);
|
|
send_C2(C,C, (I,R,Ni),
|
|
{Ni,R,Kir,{Kir,I}k(R,S)}k(I,S),
|
|
{Kir,I}k(R,S),
|
|
{Nr}Kir,
|
|
{{Nr}dec}Kir,
|
|
Kir
|
|
);
|
|
claim_C3(C,Empty, (Compromised,Kir));
|
|
}
|
|
}
|
|
|
|
protocol needhamschroedersk(I,R,S)
|
|
{
|
|
role I
|
|
{
|
|
const Ni: Nonce;
|
|
var Nr: Nonce;
|
|
var Kir: SessionKey;
|
|
var T: Ticket;
|
|
|
|
send_1(I,S,(I,R,Ni));
|
|
read_2(S,I, {Ni,R,Kir,T}k(I,S));
|
|
send_3(I,R,T);
|
|
read_4(R,I,{Nr}Kir);
|
|
send_5(I,R,{{Nr}dec}Kir);
|
|
claim_I2(I,Secret,Kir);
|
|
claim_I3(I,Nisynch);
|
|
claim_I4(I,Empty,(Fresh,Kir));
|
|
}
|
|
|
|
role R
|
|
{
|
|
const Nr: Nonce;
|
|
var Kir: SessionKey;
|
|
|
|
read_3(I,R,{Kir,I}k(R,S));
|
|
send_4(R,I,{Nr}Kir);
|
|
read_5(I,R,{{Nr}dec}Kir);
|
|
claim_R1(R,Secret,Kir);
|
|
claim_R3(R,Nisynch);
|
|
claim_R4(R,Empty,(Fresh,Kir));
|
|
}
|
|
|
|
role S
|
|
{
|
|
var Ni: Nonce;
|
|
const Kir: SessionKey;
|
|
read_1(I,S,(I,R,Ni));
|
|
send_2(S,I,{Ni,R,Kir,{Kir,I}k(R,S)}k(I,S));
|
|
}
|
|
}
|
|
|
|
const Alice,Bob,Simon,Eve: Agent;
|
|
|
|
untrusted Eve;
|
|
const ne: Nonce;
|
|
compromised k(Eve,Simon);
|
|
|
|
# General scenario, 2 parallel runs of the protocol
|
|
|
|
run needhamschroedersk.I(Agent,Agent,Simon);
|
|
run needhamschroedersk.R(Agent,Agent,Simon);
|
|
run needhamschroedersk.S(Agent,Agent,Simon);
|
|
run needhamschroedersk.I(Agent,Agent,Simon);
|
|
run needhamschroedersk.R(Agent,Agent,Simon);
|
|
run needhamschroedersk.S(Agent,Agent,Simon);
|