2005-05-02 11:44:07 +01:00
|
|
|
# KSL
|
|
|
|
#
|
|
|
|
# Modelled after the description in the SPORE library
|
|
|
|
# http://www.lsv.ens-cachan.fr/spore/ksl.html
|
|
|
|
#
|
|
|
|
# Note:
|
|
|
|
# This protocol uses a ticket so scyther will only be able to verify
|
2005-06-02 13:41:24 +01:00
|
|
|
# the protocol using the ARACHNE engine (-a)
|
2005-05-02 11:44:07 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2005-06-02 13:41:24 +01:00
|
|
|
usertype Server, SessionKey, GeneralizedTimestamp, TicketKey;
|
2005-05-02 11:44:07 +01:00
|
|
|
secret k: Function;
|
|
|
|
|
2005-06-27 12:50:24 +01:00
|
|
|
const Alice, Bob, Simon, Eve: Agent;
|
2005-06-23 13:45:32 +01:00
|
|
|
const Fresh: Function;
|
2005-06-24 11:53:15 +01:00
|
|
|
const Compromised: Function;
|
2005-05-02 11:44:07 +01:00
|
|
|
|
|
|
|
const ne: Nonce;
|
|
|
|
const kee: SessionKey;
|
2005-06-27 12:50:24 +01:00
|
|
|
untrusted Eve;
|
|
|
|
compromised k(Eve,Simon);
|
2005-05-02 11:44:07 +01:00
|
|
|
|
2005-06-24 11:53:15 +01:00
|
|
|
protocol kslSessionKeyCompromise(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,Nc,Ma,Mb: Nonce;
|
|
|
|
const Kir: SessionKey;
|
|
|
|
const Kbb: TicketKey;
|
|
|
|
const Tr: GeneralizedTimestamp;
|
|
|
|
var I,R,S: Agent;
|
|
|
|
|
|
|
|
read_C1(C,C, I,R,S);
|
|
|
|
send_C2(C,C, (Ni,I),
|
|
|
|
(Ni,I,Nr,R),
|
|
|
|
{Nr,I,Kir}k(R,S),{Ni,R,Kir}k(I,S),
|
2005-06-27 12:50:24 +01:00
|
|
|
{Tr,I,Kir}Kbb,Nc,{Ni}Kir,
|
2005-06-24 11:53:15 +01:00
|
|
|
{Nc}Kir,
|
|
|
|
Ma,
|
|
|
|
Mb,{Ma}Kir,
|
|
|
|
{Mb}Kir,
|
|
|
|
Kir,
|
|
|
|
Kbb
|
|
|
|
);
|
|
|
|
claim_C3(C,Empty, (Compromised,Kir));
|
|
|
|
claim_C4(C,Empty, (Compromised,Kbb));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-27 12:50:24 +01:00
|
|
|
protocol ksl(I,R,S)
|
2005-05-02 11:44:07 +01:00
|
|
|
{
|
2005-06-27 12:50:24 +01:00
|
|
|
role I
|
2005-05-23 13:35:58 +01:00
|
|
|
{
|
2005-06-27 12:50:24 +01:00
|
|
|
const Ni, Mi: Nonce;
|
|
|
|
var Nr2, Mr: Nonce;
|
2005-05-23 13:35:58 +01:00
|
|
|
var T: Ticket;
|
2005-06-27 12:50:24 +01:00
|
|
|
var Kir: SessionKey;
|
2005-05-23 13:35:58 +01:00
|
|
|
|
2005-06-27 12:50:24 +01:00
|
|
|
send_1(I,R, Ni, I);
|
|
|
|
read_4(R,I, {Ni,R,Kir}k(I,S), T, Nr2, {Ni}Kir);
|
|
|
|
send_5(I,R, {Nr2}Kir );
|
2005-05-23 13:35:58 +01:00
|
|
|
|
2005-06-27 12:50:24 +01:00
|
|
|
send_6(I,R, Mi,T );
|
|
|
|
read_7(R,I, Mr,{Mi}Kir );
|
|
|
|
send_8(I,R, {Mr}Kir );
|
2005-05-02 11:44:07 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
claim_A1(A,Secret, Kab);
|
|
|
|
claim_A2(A,Niagree);
|
|
|
|
claim_A3(A,Nisynch);
|
2005-06-23 13:45:32 +01:00
|
|
|
claim_A4(A,Empty, (Fresh, Kab));
|
2005-05-23 13:35:58 +01:00
|
|
|
}
|
2005-05-02 11:44:07 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
role B
|
|
|
|
{
|
|
|
|
var Na,Ma: Nonce;
|
2005-06-27 12:50:24 +01:00
|
|
|
const Nr,Nr2,Mr: Nonce;
|
|
|
|
var Kir: SessionKey;
|
2005-05-23 13:35:58 +01:00
|
|
|
const Kbb: TicketKey;
|
|
|
|
const Tb: GeneralizedTimestamp;
|
|
|
|
var T: Ticket;
|
|
|
|
|
|
|
|
read_1(A,B, Na, A);
|
|
|
|
send_2(B,S, Na, A, Nb, B );
|
|
|
|
read_3(S,B, { Nb, A, Kab }k(B,S), T );
|
|
|
|
send_4(B,A, T, { Tb, A, Kab }Kbb, Nc, {Na}Kab );
|
|
|
|
read_5(A,B, { Nc }Kab );
|
|
|
|
|
|
|
|
read_6(A,B, Ma,{ Tb, A, Kab }Kbb );
|
|
|
|
send_7(B,A, Mb,{Ma}Kab );
|
|
|
|
read_8(A,B, {Mb}Kab );
|
2005-05-02 11:44:07 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
claim_B1(B,Secret, Kab);
|
|
|
|
claim_B2(B,Niagree);
|
|
|
|
claim_B3(B,Nisynch);
|
2005-06-23 13:45:32 +01:00
|
|
|
claim_B4(B,Empty,(Fresh,Kab));
|
2005-05-23 13:35:58 +01:00
|
|
|
}
|
2005-05-02 11:44:07 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
role S
|
|
|
|
{
|
|
|
|
var Na, Nb: Nonce;
|
|
|
|
const Kab: SessionKey;
|
2005-05-02 11:44:07 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
read_2(B,S, Na, A, Nb, B );
|
|
|
|
send_3(S,B, { Nb, A, Kab }k(B,S), { Na,B,Kab }k(A,S) );
|
|
|
|
}
|
2005-05-02 11:44:07 +01:00
|
|
|
}
|
|
|
|
|
2005-06-27 12:50:24 +01:00
|
|
|
run ksl.A(Alice,Bob,Simon);
|
|
|
|
run ksl.B(Alice,Bob,Simon);
|
|
|
|
run ksl.S(Alice,Bob,Simon);
|
2005-05-02 11:44:07 +01:00
|
|
|
|