Avant-propos - Laboratoire Spécification et Vérification - ENS Cachan
Avant-propos - Laboratoire Spécification et Vérification - ENS Cachan
Avant-propos - Laboratoire Spécification et Vérification - ENS Cachan
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
<strong>Avant</strong>-<strong>propos</strong><br />
SECI’02 (SEcurité des Communications sur l’Intern<strong>et</strong>) est le premier atelier sur la sécurité des<br />
communications sur l’Intern<strong>et</strong>, <strong>et</strong> s’est tenu à l’hôtel El Mechtel à Tunis, en Tunisie, du 19 au 21<br />
septembre 2002. Tous les aspects de la sécurité sur l’Intern<strong>et</strong> étaient les bienvenus, notamment les protocoles<br />
cryptographiques, la détection d’intrusions, <strong>et</strong> les politiques de sécurité.<br />
Sur les 18 papiers soumis à c<strong>et</strong> atelier, 10 ont été r<strong>et</strong>enus, sur des thèmes variés :<br />
– Cryptologie : Hughes <strong>et</strong> Tannenbaum <strong>propos</strong>ent de nouvelles attaques contre la cryptographie à groupes<br />
de tresses, un suj<strong>et</strong> prom<strong>et</strong>teur <strong>et</strong> en pointe actuellement. Kanso d’une part, <strong>et</strong> Hussein, Dakroury, Hassen,<br />
<strong>et</strong> Badr d’autre part <strong>propos</strong>ent eux de nouveaux schémas de génération de nombres pseudo-aléatoires—<br />
un composant essentiel mais souvent négligé des systèmes cryptographiques.<br />
– Protocoles cryptographiques : Candolin, Lundberg <strong>et</strong> Nikander <strong>propos</strong>ent un protocole réaliste<br />
d’accord de clé entre deux systèmes informatiques perm<strong>et</strong>tant de bootstrapper une connexion sécurisée<br />
IPv6, alors que Benmeziane <strong>et</strong> Khelladi présentent un nouveau système de vote électronique. Du côté<br />
de la vérification de protocoles cryptographiques, Oehl <strong>et</strong> Sinclair <strong>propos</strong>ent de combiner les techniques<br />
de preuve assistée (le prouveur Isabelle) avec des techniques automatiques fondées sur des automates<br />
d’arbres (Timbuk) pour aider à vérifier formellement les protocoles cryptographiques.<br />
– Détection d’intrusion : AbdelallahElhadj, Khelalfa <strong>et</strong> Kortebi présentent un outil <strong>et</strong> une technique de<br />
détection de sniffers. Les sniffers perm<strong>et</strong>tent d’examiner le flux des paqu<strong>et</strong>s réseau, <strong>et</strong> sont par là-même<br />
des outils de choix pour les pirates ; il est donc important de savoir détecter qu’un intrus utilise un<br />
sniffer sur un réseau. Camus, Auroux <strong>et</strong> Gousseau s’intéressent eux au problème crucial en pratique<br />
de la collecte des informations de sécurité sur Intern<strong>et</strong> : l’activité d’un officier de sécurité consiste en<br />
eff<strong>et</strong> en premier lieu à s’informer des nouvelles attaques existantes, <strong>et</strong> les auteurs <strong>propos</strong>ent un système<br />
à agents perm<strong>et</strong>tant d’automatiser ce processus de collecte.<br />
– Sécurisation des systèmes d’information : Apvrille <strong>et</strong> Hughes <strong>propos</strong>ent une méthode de sauvegarde<br />
des informations qui perm<strong>et</strong> d’établir l’authenticitité de la sauvegarde, tant pour ce qui est du contenu que<br />
de la date du document, en utilisant des moyens cryptographiques ; les systèmes de sauvegarde actuels<br />
négligent en eff<strong>et</strong> totalement l’aspect sécurité. Cuillandre <strong>et</strong> Chabaud, d’un autre côté, s’intéresse à la<br />
vérification de l’intégrité des programmes de démarrage d’un ordinateur ; ceci perm<strong>et</strong> en particulier de<br />
contrer des attaques consistant à pirater les secteurs de démarrage de l’ordinateur cible pour y obtenir un<br />
accès privilégié.<br />
SECI’02 a d’autre part <strong>propos</strong>é cinq exposés invités à son audience, de la part du prof. Yassine Lakhnech,<br />
avec Liana Bozga <strong>et</strong> Mickaël Périn (Vérimag, Grenoble, France), du prof. Jean Goubault-Larrecq (LSV/CNRS<br />
UMR 8643 & <strong>ENS</strong> <strong>Cachan</strong>, France), du dr. Frédéric Cuppens (ONERA/DTIM, Toulouse, France), avec Fabien<br />
Autrel, Alexandre Miège <strong>et</strong> Salem Benferhat ; de Zakia Marrakchi (SupÉlec Rennes, France) ; <strong>et</strong> du prof. Jean-<br />
Jacques Quisquater <strong>et</strong> de David Samyde (Université Catholique de Louvain, Belgique).<br />
Figurait aussi à SECI’02 un tutorial de Vianney Rancurel (LSE/EPITECH, Paris, France) sur la<br />
classification des attaques <strong>et</strong> des intrusions, ainsi que trois posters :<br />
– H. Trichili, M.-S. Bouhlel, N. Derbel, L. Kamoun, Évaluation <strong>et</strong> optimisation des méthodes de tatouage<br />
d’images par ondel<strong>et</strong>tes pour l’authentification des documents numériques.<br />
– R. Ben Younès, Implémentation du DES (Data Encryption Standard) en Java.<br />
– T. Candebat, D. Gray, Public key certification for small devices.<br />
Sur le plan géographique, l’atelier SECI’02 se voulait d’autre part international, en attirant au moins des<br />
chercheurs tant européens que nord-africains. Sur ce plan, SECI’02 est un succès compl<strong>et</strong> ; les pays d’où les<br />
auteurs des papiers (autres qu’invités) au sommaire de ce volume sont originaires sont en eff<strong>et</strong> divers :<br />
1
Algérie Arabie Saoudite Égypte Finlande<br />
France Irlande USA<br />
Nous tenons à remercier tout particulièrement les relecteurs des papiers soumis à SECI’02 :<br />
Fabien Autrel Frédéric Blanqui Frédéric Cuppens Nabil El Kadhi<br />
Yousser Jarraya Yassine Lakhnech Jean Goubault-Larrecq Xavier Leroy<br />
Ludovic Mé Alexandre Miège Rodolphe Ortalo Larry Paulson<br />
David Pointcheval Jean-Jacques Quisquater P<strong>et</strong>er Selinger Sami Tabbane<br />
Comité d’organisation :<br />
Jean GOUBAULT-LARRECQ<br />
Nabil EL KADHI<br />
Naceur Amar Henda Ben Ghezala Noureddine Boudrigua Nabil El Kadhi<br />
Nadia Essoussi Faranak Grange Mona Laroussi Abdelwahed Trabelsi<br />
2
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
Sommaire<br />
Atelier SEcurité des Communications sur Intern<strong>et</strong> (SECI’02)<br />
Hôtel El Mechtel, Tunis, Tunisie<br />
19–21 septembre 2002<br />
CRYPTOLOGIE<br />
J. HUGHES <strong>et</strong> A. TANNENBAUM<br />
Length-based attacks for certain group based encryption rewriting systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
G. HUSSEIN, Y. DAKROURY, B. HASSEN, <strong>et</strong> A. BADR<br />
Two-stage random generator (TSRG) ; Attack-oriented design and implementation . . . . . . . . . . . . . . . . . . . . . . 13<br />
A.A. KANSO<br />
The alternating Step(r, s) generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29<br />
PROTOCOLES CRYPTOGRAPHIQUES<br />
C. CANDOLIN, J. LUNDBERG, <strong>et</strong> P. NIKANDER<br />
Experimenting with early opportunistic key agreement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39<br />
S. BENMEZIANE <strong>et</strong> L. KHELLADI<br />
I-Vote : Un système de vote électronique hautement sécurisé . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47<br />
F. OEHL <strong>et</strong> D. SINCLAIR<br />
Combining ISABELLE and Timbuk for cryptographic protocol verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57<br />
DÉTECTION D’INTRUSION<br />
H. ABDELALLAHELHADJ, H.M. KHELALFA, H.M. KORTEBI<br />
An experimental sniffer d<strong>et</strong>ector : SnifferWall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69<br />
M. CAMUS, L. AUROUX, <strong>et</strong> D. GOUSSEAU<br />
Vers une collecte pertinente des informations de sécurité sur Intern<strong>et</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81<br />
SÉCURISATION DES SYSTÈMES D’INFORMATION<br />
A. APVRILLE <strong>et</strong> J. HUGHES<br />
A time stamped virtual WORM system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93<br />
3
N. CUILLANDRE <strong>et</strong> F. CHABAUD<br />
Contrôle d’intégrité de la séquence de démarrage d’un ordinateur . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105<br />
PAPIERS INVITÉS<br />
L. BOZGA, Y. LAKHNECH, <strong>et</strong> M. PÉRIN<br />
Verifying Secrecy by Abstract Interpr<strong>et</strong>ation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115<br />
J. GOUBAULT-LARRECQ<br />
Protocoles cryptographiques : la logique à la rescousse ! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119<br />
F. CUPP<strong>ENS</strong>, F. AUTREL, A. MIÈGE, <strong>et</strong> S. BENFERHAT<br />
Recognizing Malicious Intention in an Intrusion D<strong>et</strong>ection Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153<br />
J.-J. QUISQUATER <strong>et</strong> D. SAMYDE<br />
Cryptanalyse par side channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173<br />
Side-Channel Cryptanalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179<br />
4
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
Length-Based Attacks for Certain Group Based<br />
Encryption Rewriting Systems<br />
J. Hughes & A. Tannenbaum ¡<br />
1: Storage Technology Corporation,<br />
7600 Boone Ave No<br />
Minneapolis, MN 55428 USA<br />
jim@n<strong>et</strong>work.com<br />
2: Department of Electrical and Computer Engineering,<br />
Georgia Institute of Technology,<br />
Atlanta, GA 30332-0250 USA<br />
tannenba@ece.gatech.edu<br />
Abstract<br />
In this note, we describe a probabilistic attack on public key cryptosystems based on the word/conjugacy<br />
problems for finitely presented groups of the type <strong>propos</strong>ed recently by Anshel, Anshel and Goldfeld. In such<br />
a scheme, one makes use of the property that in the given group the word problem has a polynomial time<br />
solution, while the conjugacy problem has no known polynomial solution. An example is the braid group<br />
from topology in which the word problem is solvable in polynomial time while the only known solutions to<br />
the conjugacy problem are exponential. The attack in this paper is based on having a canonical representative<br />
of each string relative to which a length function may be computed. Hence the term length attack. Such<br />
canonical representatives are known to exist for the braid group.<br />
1. Introduction<br />
Recently, a novel approach to public key encryption based on the algorithmic difficulty of solving the word and<br />
conjugacy problems for finitely presented groups has been <strong>propos</strong>ed in [1, 2, 20, 21]. The m<strong>et</strong>hod is based on<br />
having a canonical minimal length form for words in a given finitely presented group, which can be computed<br />
rather rapidly, and in which there is no corresponding fast solution for the conjugacy problem. A key example<br />
is the braid group. In this note, we will indicate a possible probabilistic attack on such a system, using the<br />
length function on the s<strong>et</strong> of conjugates defining the public key. Note that since each word has a canonical<br />
representative, the length function is well-defined and for the braid group can be computed in polynomial time<br />
in the word length according to the results in [6]. The attack may be relevant to more general types of string<br />
rewriting cryptosystems, and so we give some of the relevant background. Thus this note will also have a<br />
tutorial flavor.<br />
The contents of this paper are as follows. In Section 2, we make some general remarks are rewriting<br />
systems, and the notion of ”length” of a word. In Section 3, we define the Artin and Cox<strong>et</strong>er groups. In Section<br />
4, we discuss the classical word and conjugacy problems for finitely presented groups. In Section 5, the braid<br />
cryptosystem of [1] is described. In Section 6, we give the length attack for possibly compromising such a<br />
cryptosystem, and finally in Section 7 we draw some general conclusions, and directions for further research<br />
for group rewriting based encryption systems.<br />
5
Hughes & Tannenbaum<br />
2. Background on Monoid and Group Based Rewriting Systems<br />
In this section, we review some of the relevant concepts from group theory for rewriting based encryption. We<br />
work in this section over a monoid, but similar remarks hold for group based rewriting systems as well.<br />
L<strong>et</strong> ¢ be an arbitrary field, and £¥¤§¦©¨�������������¨���� a finite s<strong>et</strong>. L<strong>et</strong> £�� be the finite monoid generated by £ ,<br />
that is,<br />
� ¤�¦©¨���� ��� ��������� ¨���� ��� ��� ���<br />
£<br />
Elements £ � of are called words. We then define the free algebra generated £ by to be<br />
�<br />
¤<br />
£ ��� ¤<br />
¢��<br />
¢��<br />
£���¤�¦��<br />
�����<br />
where ��� denotes the symm<strong>et</strong>ric group on � l<strong>et</strong>ters.<br />
�<br />
¢<br />
������� � ���<br />
� ��� ��������� ¨�� � ��� ��� ��� ¨��<br />
We are now ready to define precisely the key notion of rewriting system. L<strong>et</strong> �§��£�����£�� . We call � the<br />
s<strong>et</strong> of replacement rules. Many times the pair ������������� is denoted by ������� The idea is that when the word<br />
� appears inside a larger word, we replace it with � . More precisely, for any ��������£�� , we write<br />
���������������<br />
and say that the word ����� has been re-written or reduced to ��������� is irreducible or normal if it cannot be<br />
rewritten.<br />
We will still need a few more concepts. We say that the rewriting system ��£������ is terminating if there is<br />
no infinite chain ��������������� ����� of re-writings. We then say that the partial ordering ����� defined by<br />
��� ����� ��� is well-founded. � is confluent if a word � which can be re-written in two different ways ��� and<br />
��� , the re-writings ��� and ��� can be re-written to a common word � .<br />
Note that if � is terminating, confluence means that there exists a unique irreducible word, ������� representing<br />
each element of the monoid presented by the re-writing system. Such a system is called compl<strong>et</strong>e. Given a<br />
word ����£�� , we define the length of � or ������� , to be the number of generators in ������� .<br />
Remark:<br />
In the case of groups, the basic outline just given is valid. A key example of a group in which one can assign a<br />
length function is the braid group via the results in [6]. This is the basis of the cryptosystem <strong>propos</strong>ed in [1].<br />
3. Artin and Cox<strong>et</strong>er Groups<br />
In this section, we review some of the pertinent background on Artin and Cox<strong>et</strong>er groups. An excellence<br />
reference for this material in [5], especially for the braid groups.<br />
L<strong>et</strong> � be a group. For ¨�������� we define<br />
For example,<br />
�<br />
�<br />
¨���������¤�¨���¨�������� product with � factors.<br />
An Artin group is a � group which admits a s<strong>et</strong> of ¦©¨ generators<br />
with relations of the form<br />
for any ��������� and with �<br />
�<br />
¨���������¤�¨���¨��<br />
�<br />
¨<br />
�<br />
¨���������¤�¨���¨����<br />
¨�������� ��¤<br />
�<br />
�<br />
¨���¨<br />
�<br />
�<br />
��¨�������¤���¨���¨��©�<br />
�<br />
� �<br />
���������<br />
non-negative integers. The matrix ����¤<br />
�<br />
6<br />
��� with � a totally ordered index s<strong>et</strong>, and<br />
�<br />
�<br />
� �<br />
�<br />
���<br />
� ��� is called the Cox<strong>et</strong>er matrix.
Length-Based Attacks for Certain Group Based Encryption Rewriting Systems<br />
The braid group, ��� , is defined by taking the indexing s<strong>et</strong> ����¤�¦���������������� , and<br />
�<br />
�<br />
��¤ � for � �������������<br />
�<br />
���<br />
��¤ �<br />
���<br />
�<br />
� � ���<br />
¤����<br />
Thus the braid group ��� is a special case of an Artin group defined by the generators ���©������������� , with the<br />
relations<br />
�<br />
����¤ �����<br />
�<br />
��������������������������<br />
�<br />
�<br />
�<br />
���<br />
���<br />
�<br />
¤ �<br />
���<br />
���<br />
�<br />
�<br />
���<br />
�©�<br />
�<br />
Given an Artin � group with Cox<strong>et</strong>er ����¤<br />
�<br />
�<br />
�<br />
� �<br />
���<br />
� ��� matrix the associated Cox<strong>et</strong>er group is defined by<br />
adding the ¨ � ¤§��� relations ������� for One can easily show them that a Cox<strong>et</strong>er group is equivalently defined<br />
by the relations<br />
�<br />
¤����<br />
Artin groups and their associated Cox<strong>et</strong>er groups have some nice properties which could make them quite<br />
useful in potential rewriting based systems as we will now see.<br />
��¨<br />
¨�������� ��¤���������������� with �<br />
�<br />
4. Word and Conjugacy Problems for Finitely Presented Groups<br />
L<strong>et</strong><br />
be a finitely presented group. � L<strong>et</strong> be the free monoid generated by �<br />
� and ��� � . Then the word problem is<br />
given two strings (words), ��������� , decide if ��¤�� in � . The conjugacy problem is to decide if there exists<br />
�<br />
such that ��¤�¨���¨<br />
� � , i.e., � and � are conjugates.<br />
¨����<br />
It is well-known that both these problems are algorithmically unsolvable for general finitely presented<br />
groups. However, for some very important groups they are solvable, e.g., for Artin groups with finite Cox<strong>et</strong>er<br />
groups. In fact, Brieskorn and Saito [8] give an explicit solution to the word and conjugacy problems for this<br />
class of groups. Their algorithm runs in exponential time however. See also [13, 14] and the references therein<br />
for some recent results on the word and conjugacy problems for Cox<strong>et</strong>er groups.<br />
��¤<br />
�©�<br />
�<br />
���<br />
���<br />
�<br />
�<br />
��������� ����� �������<br />
�����<br />
In some recent work, Birman-Ko-Lee [6] show that for the braid group, the word problem is solvable in<br />
polynomial time (in fact, it is quadratic in the word length). Given the results just described, it has been<br />
conjectured that the techniques of [6] are extendable to Artin groups with finite Cox<strong>et</strong>er groups. For another<br />
solution to this problem see [11].<br />
At this point, there is no known polynomial time algorithm known for the conjugacy problem, as originally<br />
posed by Artin [3], for the braid group ����� with strands; see [6]. It seems that it is the possible complexity of<br />
this form of the conjugacy problem which is the basis of the claim of security made by the authors of the braid<br />
cryptosystem in [1]. (The original conjugacy problem posed by Artin is a decision problem. ����������� Given ,<br />
is there ¨ an such ��¤�¨<br />
� � ��¨ that ? In the <strong>propos</strong>ed cryptosystems, the public and private keys are known to be<br />
conjugates, so these systems are not based on such a decision problem. )<br />
For the braid group itself, little work has been accomplished on the lower and average bounds of the<br />
conjugacy search problem for known conjugates (as in [21]) or a system of known conjugates (as in [2]).<br />
There are no proofs that the conjugacy problem is hard all the time. The motivation to do any of this work has<br />
only occurred recently because these cryptosystems have been <strong>propos</strong>ed. Some of this work includes a brief<br />
look at the probabilities of colored Burau representation [17], and other work attempting to demonstrate the<br />
average complexity of the conjugacy problem [23] using a s<strong>et</strong> measurement techniques for infinite groups [7].<br />
Other work has begun on calculating the normalizer s<strong>et</strong> to solve the conjugacy problem [15] (but this does not<br />
help solve the crypto-problem because it assumes a known conjugator exists.)<br />
7<br />
���
Hughes & Tannenbaum<br />
It is important to note that there are some important linear representations of the braid group namely,<br />
the Burau, the colored Burau and the Lawrence-Krammer. In [2], it is suggested that the colored Burau<br />
representation made be used to quickly solve the word problem. The Burau representation was originally<br />
formulated to prove that the braid group was linear, but it now is known to have a non-trivial kernel and as<br />
such, cannot be used to solve the general conjugacy problem. Finally, using a more general representation due<br />
to Lawrence-Krammer, it has been proven that the braid group is indeed linear [4]. This allows linear algebraic<br />
m<strong>et</strong>hods to be used now in studying the word and conjugacy problems, and possibly could lead to y<strong>et</strong> another<br />
attack on braid cryptosystems.<br />
Finally, note that if one can find a unique irreducible word from which one can derive a length function, then<br />
one can give a natural distance b<strong>et</strong>ween words in a given group � . Indeed, l<strong>et</strong> ��������� denote words relative to<br />
a finite presentation of the group � . L<strong>et</strong> � denote the length function which we assume exists. Then we define<br />
the distance � b<strong>et</strong>ween the words ����� as<br />
� � ���<br />
It is trivial to check that ��� is a distance function function b<strong>et</strong>ween words. See also [13]. We will see that this<br />
is the case for the braid group via the results of Birman-Ko-Lee [6].<br />
5. Braid Cryptosystem<br />
����������������¤��������<br />
In some very interesting recent work, Anshel <strong>et</strong> al. [1, 2] <strong>propos</strong>e a new twist to rewriting systems for public<br />
key encryption. We will first state their approach over a general group. We should first note however that the<br />
use of the word and conjugacy problems for public-key cryptosystems is not new. An early reference is [25].<br />
� ,<br />
The general idea is as follows: Alice ( �<br />
£���¤<br />
���<br />
) and Bob (� ) have as their public keys subgroups of a given group<br />
chooses a secr<strong>et</strong> element ¨���£�� and � chooses a secr<strong>et</strong> element ����£�� .<br />
�<br />
�<br />
transmits the s<strong>et</strong> of elements<br />
� � � � � �<br />
� ¨ and � transmits the s<strong>et</strong> of elements �<br />
� � � � � �<br />
��� . (The elements are rewritten is<br />
¨<br />
some fashion before transmission.)<br />
Now suppose that<br />
��¨�����������¨<br />
Then note that<br />
�<br />
� ¨���¤ �<br />
�<br />
� ¤<br />
�<br />
����� �©���������<br />
¨�¤<br />
�<br />
���<br />
�<br />
��� ��� ��� � ��������� ���<br />
� �<br />
� � ���<br />
� �<br />
� � ��� ��� � ���������<br />
� � � � � �<br />
�©�������<br />
� �¥�<br />
��� �<br />
���©�����������<br />
� � �<br />
��� ��� ��� ��� ��� ��� � ����� � ��� ��� ��� �<br />
���<br />
���<br />
� � � ��� ��� ��� ��� ����� ���<br />
� � � ��� ��� ��� ��� �<br />
¤<br />
(The conjugate of the product of two elements is the product of the conjugates.) Thus �<br />
and � similarly can ¨<br />
� � ��¨ compute . The common key then is<br />
the commutator of the two secr<strong>et</strong> elements.<br />
¨<br />
� �<br />
� � ¨���¤<br />
�<br />
¨���� � �<br />
�<br />
can compute �<br />
Note that since the two users have the common key written in different forms, in order to extract the<br />
message, it must be reduced to an identical group element. For the braid group, this can be accomplished by<br />
reducing the commutator to the Birman-Ko-Lee canonical form [6], colored Burau [2] or Dehornoy [1].<br />
The braid group is particularly attractive for this protocol since one has a quadratic time solution for the<br />
word problem, and the only known solution to the conjugacy problem is exponential.<br />
8<br />
� � ¨�� ,
Remark:<br />
Length-Based Attacks for Certain Group Based Encryption Rewriting Systems<br />
The key properties that underlie this cryptosystem are having a group in which the word problem is easy to<br />
solve (and in fact each word has a canonical form) and in which the conjugacy problem is difficult (at least via<br />
known techniques). The canonical form is important as well since it allows a simple m<strong>et</strong>hod for the extraction<br />
of the common key.<br />
5.1. Another Braid Cryptosystem<br />
Another possible cryptosystem based on the word and conjugacy problems in the braid group has been <strong>propos</strong>ed<br />
in [20, 21]. In this case, the authors <strong>propos</strong>e the following scheme: Consider the braid ���<br />
� � group on<br />
braids. One considers two subgroups: ����� generated by ���©������������� � � and ��� � generated by<br />
�¥���<br />
�©� Note that given ¨�������� and ������� � , ¨���¤���¨ . This is essential for their scheme.<br />
�<br />
�<br />
The protocol for creating a common key then works as follows: The public key is a pair of ��������� integers ,<br />
and �§�����<br />
� � braid . Alice choose a secr<strong>et</strong> ¨�������� element and ¨���¨<br />
� � sends to Bob. Bob chooses a<br />
secr<strong>et</strong> ������� � element , and �����<br />
� � sends to Alice. Alice can ¨��������<br />
� � ��¨<br />
� � compute and Bob can � �<br />
compute<br />
. ¨ Since � and commute this is the common key. Being able to solve the Generalized Conjugacy<br />
Problem would be enough to break this system. It is not known if the converse is true.<br />
���<br />
����¨���¨<br />
�©�����������<br />
� � ���<br />
� �<br />
Remark:<br />
It is an interesting open question to see if the length attack <strong>propos</strong>ed below may be suitably modified to be<br />
relevant to the protocol in [20]. It may be also be of interest to consider some the strong convergent gam<strong>et</strong>heor<strong>et</strong>ic<br />
techniques in [13, 14] to study this protocol as well as that in [1].<br />
6. The Length Attack<br />
In this section, we describe the length attack on word/conjugacy based encryption systems of the type<br />
<strong>propos</strong>ed in [1] in which one can associate a canonical representative, and therefore a length function � of<br />
the type described above. For concr<strong>et</strong>eness, we focus on the braid group here which has a canonical length<br />
function as noted above. We should note that the arguments of this section are speculative, and certainly not<br />
mathematically rigorous.<br />
Research on the length of random words has been done in the mathematical physics community where braid<br />
group has been valuable in studying certain physical phenomena [9, 12, 24]. Recall that a symm<strong>et</strong>ric random<br />
walk on a free group ��� with � generators is a cross product of a nonsymm<strong>et</strong>ric N-step random walk on a<br />
half–line � � and a layer over ����� � giving a s<strong>et</strong> of all words of length � with the uniform distribution (see<br />
[24] for the d<strong>et</strong>ails). The transition probabilities in a base are:<br />
���<br />
�<br />
� ����� with the probability � ��� � �<br />
���<br />
with the probability ����� �<br />
���<br />
It is easy to show then that the expectation of a word’s length � after steps is<br />
and hence the drift is<br />
�<br />
�����<br />
�<br />
�<br />
In [24], the authors show that while the statistical properties of random walks (Markov chains) on locally<br />
free and braid groups are not the same as uniform statistics on these groups, nevertheless the statistical<br />
���¥�<br />
�<br />
9
Hughes & Tannenbaum<br />
characteristics stabilize as the number of � generators grows. From this fact, for � large (see [24], Theorem<br />
11) given two generic ����������� words , the length ��� of will be ����������������� approximately . (The genericity is<br />
important here. For example, ��¤��<br />
� � if ����������¤�� then .) This does give some statistical backing to the length<br />
attack which we are about to formulate.<br />
Given ��������� we say that � is a reducing with respect to � (or a reducing element if � is understood), if<br />
���������<br />
The remainder of this discussion will be a way of using substantial reducing strings in a length attack, and<br />
calculating an upper bound for the actual difficulty of this attack. It is important to emphasize that the ability<br />
of removing large reducing elements is not a general solution to the braid conjugacy problem. It is a specific<br />
attack on word/conjugates encryption systems of the type defined [1]. Indeed, for such cryptosystems one has<br />
the some key information about the secr<strong>et</strong> elements, namely, the factors are known and their number bounded.<br />
L<strong>et</strong><br />
�����<br />
¨���£���¤<br />
� � �����<br />
�<br />
����� �©���������<br />
be the secr<strong>et</strong> element. Recall that in the above ¨<br />
� � �<br />
��¨ protocol, and �<br />
also assume that the factors �<br />
have lengths large relative ¨ to . For � given , s<strong>et</strong><br />
Then the idea is to compute<br />
�<br />
���<br />
����¤�¨<br />
���<br />
� ���<br />
��� �<br />
�<br />
� �<br />
��¨��<br />
�<br />
� �©�<br />
��� �<br />
� (��¤������������ ) are publicly given. We<br />
repeatedly. If �<br />
is a reducing string with respect to ����� then one has found a correct factor of ¨ with a certain<br />
�<br />
probability which will depend on the ���<br />
�<br />
�<br />
� lengths ��¤���������������� for The key is that the canonical ���<br />
�<br />
�<br />
� lengths<br />
should be large. In this case, there is the greatest probability of a reducing string being formed which can be<br />
used to glean information ¨ about .<br />
We can estimate the workload in carrying out such a procedure. Without loss of generality we can assume<br />
¨ that is made up � of distinct factors combined � in ways. If the length of the �<br />
is large, then one join a<br />
small number of these factors tog<strong>et</strong>her to create a substantial reducing string. If we include the inverses of<br />
�<br />
the generators, we should ��� consider factors. L<strong>et</strong> us call the number of factors necessary to make a reducing<br />
string ¢<br />
Thus we can create ������� � reducing factors to try.<br />
�<br />
By trying all reducing elements, a pattern that there are certain factors which annihilate b<strong>et</strong>ter than others<br />
should be observed. One can do this on a single public conjugate ������� � in operations. This pattern can be<br />
significantly reinforced by repeating � this times on each public ¨<br />
� � � � conjugate Combining all the steps<br />
above brings us ���������<br />
�<br />
to operations.<br />
Relative to the ���<br />
�<br />
�<br />
� lengths of the generators �<br />
(and the specific group chosen), we conjecture that in<br />
a number of cases this will be sufficiently reliable to removing a given<br />
� �<br />
so that backtracking will not be<br />
�<br />
necessary. We can now do ��� this times bringing the total ����������� � to operations.<br />
This is polynomial to the number of different factors, and linear to the number of factors in the public keys.<br />
This is the basis of the length attack.<br />
Another demonstration of this idea is trivial. If one s<strong>et</strong>s ¢<br />
then the first of the ��� passes will solve<br />
¤��<br />
the system in the expected exponential ��� � time steps. This is simply an enumeration of all possible values of<br />
. If one s<strong>et</strong>s ¨ ¢<br />
then, if individual factors are not significant, this attack will not work. If there is a value<br />
¤��<br />
of ¢��<br />
that works, this attack significantly reduces the strength of the result. Once this attack is valid, then<br />
�<br />
lengthening the private key only linearly increases the time to solution.<br />
Depending on the values chosen for the cryptosystem in [1], ¢ may need to be longer than the actual word<br />
¨ , as has been suggested in [2] 1 . Y<strong>et</strong> another potential problem is that if the factors are simple, other attacks<br />
such as those <strong>propos</strong>ed in [19] may be effective.<br />
1 This attack was known to the authors before that paper was written<br />
10<br />
�<br />
��¨
Length-Based Attacks for Certain Group Based Encryption Rewriting Systems<br />
In some sense, the length attack is reminiscent of the “smoothness” attack for the Diffie-Hellman public key<br />
exchange system based on the discr<strong>et</strong>e logarithm [22]. In this case, the protocol may be vulnerable when all of<br />
the prime factors of ����� (where the base field for the discr<strong>et</strong>e logarithm has � elements) are small. (Such a<br />
number is called smooth.)<br />
7. Conclusions<br />
We have made a computation which indicates that a length attack on a conjugacy/word problem cryptosystem<br />
of the type defined in [1] has difficulty bounded above �����������<br />
�<br />
� by Given this conjecture, the only exponential<br />
aspect is the number of factors necessary to form a reliable reducing string. To make this secure, ¢ needs to be<br />
100 or larger.<br />
In addition, as described, this attack does not use many tricks that one can use in order to speed up this<br />
length algorithm by several orders of magnitude. These include randomized and/or gen<strong>et</strong>ic algorithms which<br />
lead to more probabilistic solutions.<br />
The bottom line is that the length attack forces one to take generators of not too long canonical length.<br />
Dorian Goldfeld reports that experimental evidence suggests that if each of the generators � �<br />
� is of �©���������<br />
length �<br />
in the Artin generators, then this may foil the attack. All of this still must be tested.<br />
���<br />
Finally, it is important to note that this attack does not solve the general conjugacy problem for the braid<br />
group. Indeed, in this case the factors ¨ of are known and bounded. In the general conjugacy problem, the<br />
number of possible factors ¨ of is infinite. Consequently, the the conjugacy problem seems to be much harder<br />
and not amenable to this technique. The key exchange of the type <strong>propos</strong>ed in [1] requires the factors be known<br />
and communicated, and give the attacker far more information than is known to the general conjugacy problem.<br />
8. Acknowledgments<br />
We wish to thank the principals of Arithm<strong>et</strong>ica Inc., Mike and Iris Anshel and Dorian Goldfeld who introduced<br />
some of us to the braid group, invented this interesting cryptosystem, took the ideas seriously and whose claims<br />
motivate this work.<br />
References<br />
[1] I. Anshel, M. Anshel, and D. Goldfeld. An algebraic m<strong>et</strong>hod for public-key cryptography. Mathematical<br />
Research L<strong>et</strong>ters, vol. 6, 1999, pp. 1–5.<br />
[2] I. Anshel, M. Anshel, B. Fisher, and D. Goldfeld. New key agreement protocol in braid group<br />
cryptography. In Topics in Cryptology - CT-RSA2001, Lecture Notes in Computer Science 2020, pp.<br />
13-27, Springer-Verlag, New York. 2001.<br />
[3] E. Artin. Theorie der Zopfe. Hamburg Abh., vol. 4, 1925, pp. 47–72.<br />
[4] S. Bigelow. Homological Representation of braid groups. Ph.D. Thesis, Dept. of Mathematics, Berkeley<br />
Univ., 2000.<br />
[5] J. Birman. braids, Links, and Mapping Class Groups. Annals of Mathematics Studies, Princ<strong>et</strong>on<br />
University Press, Princ<strong>et</strong>on, New Jersey, 1975.<br />
[6] J. Birman, K. Ko, and S. Lee. A new approach to the word and conjugacy problems in the braid groups.<br />
Advances in Math., vol. 139, 1998, pp. 322–353.<br />
11
Hughes & Tannenbaum<br />
[7] A.V. Borovik, A.G. Myasnikov, and V. Shpilrain. Measuring s<strong>et</strong>s in infinite groups. Contemporary<br />
Mathematics, American Mathematical Soci<strong>et</strong>y, vol. 298, 2002, pp. 21–42.<br />
[8] E. Brieskorn and K. Saito. Artin Gruppen und Cox<strong>et</strong>er Gruppen. Inventiones Mathematicae, vol. 17, 1972,<br />
pp. 245–271.<br />
[9] A. Comt<strong>et</strong> and S. Nechaev. Random operator approach for word enumeration in braid groups. Journal of<br />
Physics A, Mathematical and General, vol. 31, no. 26, 1998, pp. 5609–5630.<br />
[10] D. Cox, J. Little, and D. O’Shea. Using Algebraic Geom<strong>et</strong>ry. Springer-Verlag, New York, 1998.<br />
[11] P. Dehornoy. A fast m<strong>et</strong>hod for comparing braids. Advances in Mathematics, vol. 127, 1997, pp. 200–235.<br />
[12] J. Desbois and S. Nechaev. Statistics of reduced words in locally free and braid groups: abstract studies<br />
and applications to ballistic growth model. Journal of Physics A, Mathematical and General, vol. 31, no.<br />
12, 1998, pp. 2767–2789.<br />
[13] H. Eriksson. Computational and Combinatorial Aspects of Cox<strong>et</strong>er Groups. Doctoral Dissertation,<br />
NADA, KTH, Sweden, September 1994.<br />
[14] K. Eriksson. Strongly Convergent Games and Cox<strong>et</strong>er Groups. Doctoral Dissertation, NADA, KTH,<br />
Sweden, May 1993.<br />
[15] N. Franco, and J. Gonzalez-Meneses. Computation of normalizers in braid groups and Garside groups.<br />
Technical Report from http://xxx.lanl.gov/abs/math.GT/0201243.<br />
[16] D. Goldfeld. GT-1 technology and the braid KAP. Lecture Notes from presentation at Storag<strong>et</strong>ek, New<br />
York, January 2000.<br />
[17] S.G. Hahn, E.K. Lee, J.H. Park. The generalized conjugacy search problem and the Burau representation.<br />
Technical Report from http://crypt.kaist.ac.kr/pre papers/hlp revised1.ps.<br />
[18] J. Hughes. The LeftSSS attack on Ko-Lee-Cheon-Han-Kang-Park Key Agreement Protocol in B45. Rump<br />
Session, in Advances in Cryptology: Proceedings of Crypto 2000, Santa Barbara, CA, May 2000. Also<br />
on http://www.n<strong>et</strong>work.com/hughes/Crypt2000.pdf.<br />
[19] J. Hughes. A linear algebraic attack on the AAFG1 braid group cryptosystem. In 7th<br />
Australasian Conference on Information Security and Privacy, ACISP’02, Lecture Notes in<br />
Computer Science, vol. 2384, pp. 176–189, Springer-Verlag, New York 2002. Also on<br />
http://www.n<strong>et</strong>work.com/hughes/ACISP02.pdf.<br />
[20] K. Ko, S. Lee, J. Cheon, J. Han, J. Kang, and C. Park. New public-key cryptosystem using braid groups.<br />
Technical Report, Korea Advance Institute of Science and Technology, Taejon, Korea, February 2000.<br />
[21] K. Ko, S. Lee, J. Cheon, J. Han, J. Kang, and C. Park. New public-key cryptosystem using braid groups.<br />
In Advances in Cryptology: Proceedings of Crypto 2000, Lecture Notes in Computer Science, vol. 1880,<br />
pp. 166–183, Springer-Verlag, New York, 2000.<br />
[22] B. Schneier. Applied Cryptography. Second edition, Wiley Publishing, New York, 1996.<br />
[23] V. Shpilrain. Average case complexity of the word and conjugacy problems in the braid groups. Technical<br />
Report, from http://zebra.sci.ccny.cuny.edu/web/shpil/complexity.ps.<br />
[24] A. Vershik, S. Nechaev, R. Bikbov. Statistical properties of braid groups in locally free approximation.<br />
Communications in Mathematical Physics, vol. 212, 2000, pp. 469–501.<br />
[25] N. Wagner and M. Magyarik. A public key cryptosystem based on the word problem. In Advances in<br />
Cryptology: Proceedings of Crypto’84, Lecture Notes in Computer Science, vol. 196, 1985, pp. 19–36,<br />
Springer, New York.<br />
12
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
Two-Stage Random Generator (TSRG);<br />
Attack-Oriented Design and Implementation<br />
Gamal Hussein, Yasser Dakroury, Bahaa Hassen, Ahmed Badr<br />
Abstract<br />
Computer and Systems Engineering, Faculty of Eng.,<br />
Ain Shams Uni., Cairo, Egypt<br />
Email:ams@idsc.n<strong>et</strong>.eg<br />
This paper presents the design principles and an implementation for one of the TSRG family members.<br />
The <strong>propos</strong>ed new TSRG family utilizes the output of any PRNG called Randomizer as an auxiliary<br />
synchronized input to a second adapted suitable PRNG. TSRG output is modified to be a function of the<br />
output of the randomizer as well as its original variables. An instance of TSRG family, which consists of<br />
a cryptographic key stream randomizer (IDEA algorithm in OFB mode) and an adapted Lehmer generator,<br />
has been implemented as one of the possible family members. The implemented model components are<br />
studied with their rational and their working procedures are illustrated. An Attack-Oriented design considers<br />
the TSRG mathematical model and characteristics, the Randomizer systematic reseeding, the dynamic key<br />
updating, and the operating system features to inhibit all known PRNG attacks, enlarge TSRG overall period,<br />
and achieve functionally unpredictable PRNG output. To test its strength, all the TSRG defenses against<br />
attacks are thoroughly discussed and the major randomness tests are applied.<br />
Keywords: PRNG, randomness, key generators, OTP, statistical tests, Lehmer, attack.<br />
1. Introduction<br />
It is hard to imagine a well designed cryptographic application that does not use random numbers generating<br />
secr<strong>et</strong> values. For example, RNGs are required to generate session keys, initialization vectors, seeds, padding<br />
bytes and challenges. These values must be unknown to attackers. The one time pad, the only provably<br />
secure encryption system, uses as much key material as ciphertext and requires generated key stream from<br />
a truly random process [1]. Because security protocols rely on the unpredictability of the used keys, RNGs<br />
for cryptographic applications must me<strong>et</strong> rigorous requirements. Common PRNG design is based on heuristic<br />
approaches. These approaches consider PRNG as a program for generating a sequence of bits that passes a s<strong>et</strong><br />
of selected randomness tests. Since the s<strong>et</strong> of randomness tests are arbitrary, it is possible to construct a s<strong>et</strong><br />
of efficient tests to foil the commonly used PRNG. Consequently, before using PRNG in a new application,<br />
extensive tests have to be conducted in order to d<strong>et</strong>ect the difference in behavior b<strong>et</strong>ween the application with<br />
PRNG and the same application with True Random Data. In the case of using PRNG in cryptographic purposes,<br />
the situation becomes highly risky since the adversary may concentrate on the known weakness of the PRNG<br />
[2]. Random numbers are very difficult to generate, especially on computers, which are d<strong>et</strong>erministic with<br />
low entropy input sources. This condition directs the design of PRNG towards distilling these sources to g<strong>et</strong><br />
high entropy values to be used in PRNG key param<strong>et</strong>ers like the seed and keys. For example, Yarrow-160 [3]<br />
assumes it can accumulate enough entropy to g<strong>et</strong> the PRNG in unguessable state. At this point, it is assumed<br />
that the cryptographic PRNG cannot be attacked while producing a limited number of output samples. Then,<br />
the PRNG must be reseeded to another unguessable state using new distilled entropy with a computationally<br />
expensive reseeding process to raise the cost of attempting to guess the PRNG’s key. Non-d<strong>et</strong>erministic output<br />
13
G. Hussein & Y. Dakroury & B. Hassan & A. Badr<br />
can be obtained through restarting the algorithm at unguessable instances with unguessable initial conditions<br />
and adequately large period. PRNGs are hardware, software or hybrid. Software generators are either based on<br />
using a mathematical formula relating the output of the generator with its previous outputs (e.g., congruential,<br />
BBS, MWC), or based on using encryption and/or hash techniques in a particular way to obtain unpredictable<br />
output (cryptographic PRNG). The first type suffers from relatively easy cracking as in the case of congruential<br />
equations [4] or relative slowness of generation time as in the case of BBS [5]. Cryptographic PRNGs depend<br />
on the strength of the used encryption technique and/or the one-way hash function as well as its design is<br />
predominantly ad hoc (i.e., not based on a mathematical model, without proof of security or randomness [6]).<br />
The concept of entropy is usually introduced to enhance PRNG against attacks, especially key compromise<br />
attacks. A s<strong>et</strong> of good ideas and m<strong>et</strong>hodologies for designing PRNGs can be found in RFC 170. Bruce Schneier<br />
and John Kelsey also have introduced a very useful discussion of various cryptographic attacks on PRNG.<br />
Compounding and combining different PRNGs enhance their statistical output and enhance the resistance to<br />
cracking. To attack the compound generator, the d<strong>et</strong>ermination of which output portion is related to which<br />
PRNG is the first step to crack, then the problem is reduced to cracking a single generator with known output.<br />
Fourier analysis may be very helpful in case of cracking combined generators [7, 8, 9].<br />
Why a TSRG. True random numbers are needed for initial conditions and the whole sequence may depend<br />
on it as in the V1.1 N<strong>et</strong>scape browser flaw, which is based on seed compromise [10]. Consequently even these<br />
types of PRNG must have true random initial conditions.<br />
PRNG attacks, specially key and internal state compromise, as well as the enormous resources of current<br />
processing power make the design of PRNGs very hard. Good PRNGs based on mathematical theories either<br />
suffer from easy cracking or long s<strong>et</strong>up and/or generation time. Propri<strong>et</strong>ary of some of strong PRNGs is another<br />
problem. Experience states that who makes security, can break it or even know shortcuts to do (e.g., trap door,<br />
S-boxes).<br />
TSRG attack oriented design have been created using new available technology, especially Intel RNG, and<br />
appropriate mathematical models to produce functionally provably unpredictable and sufficient long period<br />
outputs. Its implementation model survives against attacks and suitable for the task it is made for (i.e.,<br />
Pluggable Secured Email Client PSEC). At last, there is no such a thing as an ideal pseudo-random generator,<br />
but there are less and less excuses to use any generator based on an ad-hoc or obscure design.<br />
Paper Outline. In Section 2, a definition of basic theories and the mathematical model on which TSRG<br />
is based are given. Section 3 discusses the statistical characteristics of the generator outputs and param<strong>et</strong>ers<br />
affecting it and how it gives directions of the design approach. In Section 4, the components of the generator are<br />
described with their rationale. The evaluation of the generator defenses against all known attacks are illustrated<br />
in d<strong>et</strong>ails in Section 5. Testing results are listed in Section 6 and finally the conclusion is presented in Section 7.<br />
2. Two-Stage Random Number Generators<br />
The basic idea of TSRG family is to suitably modify transition and/or output functions of a PRNG (adapted<br />
generator) to additionally depend on a new random variable (i.e., randomizer output). In cases of changing<br />
the PRNG output function by just combining its original output with the randomizer output using convenient<br />
computer operator, the family shrinks to combination generator. The implemented model adapts the Linear<br />
Congruential Generator (LCG) equation by replacing its constant term with the randomizer output. Dynamic<br />
reseeding of the cryptographic randomizer defends against attacks and makes the adapted generator works as<br />
PRNG period amplifier. At last, there is no such a thing as an ideal pseudo-random generator, but there are less<br />
and less excuses to use any generator based on an ad-hoc or obscure design [11].<br />
14
2.1. TSRG Mathematical Model<br />
TSRG: Attack Oriented Design and Implementation<br />
Cryptosystems based on a One Time Pad (OTP) depend on identical copies of random data either generated<br />
from PRNGs or real pre-prepared true random data saved on their system database (usually on CDs). These<br />
copies are being securely exchanged b<strong>et</strong>ween subscribers. The probability of copying these true random data<br />
and the ease of predicting the output of PRNGs, create the need to deduce PRNGs preserving the accepted<br />
statistical features, their outputs cannot be predicted and its generation time is accepted. The desired PRNG<br />
output must be reproducible with identical patterns at the parties. Its outputted OTP may be sent with the<br />
message, which means sending double the length of the message or sending a digest from which the original<br />
OTP can be reproduced. Suppose the following PRNG whose output is giving by �������������������������������������<br />
and another PRNG with output ������� , where � is the state number. ������� can be modified to: ���������<br />
. The output of this equation is not guaranteed to be random but it is worse to apply<br />
�����������������������������������������<br />
the concept to one of the well-known tested polynomial congruent equations (i.e., LCG). Lehmer <strong>propos</strong>ed<br />
the congruential m<strong>et</strong>hod of generating a sequence of pseudo-random ���©������������������� numbers . In this m<strong>et</strong>hod,<br />
each member of the sequence generates its successor by means of the following algorithm. The ��� integer is<br />
multiplied by a � constant then added to a � constant . The result is divided by a � constant , and the resulting<br />
remainder is taken ������� as . Thus<br />
��������� �������¥� ����������� (1)<br />
This param<strong>et</strong>ric multiplicative LCG algorithm has withstood the test of time. It can be implemented<br />
efficiently, numerous empirical tests of the randomness of its output have been published, and its important<br />
theor<strong>et</strong>ical properties have been analyzed [12]. Although Lehmer’s algorithm has some statistical defects like<br />
ease of prediction of its param<strong>et</strong>ers y<strong>et</strong>, if the algorithm param<strong>et</strong>ers are chosen properly and the software<br />
implementation of the algorithm is correct, the resulting generator can produce a virtually infinite sequence<br />
of numbers that will satisfy almost any statistical test of randomness [13, 14]. The available theory is still<br />
somewhat incompl<strong>et</strong>e and implicit. It has not emerged clearly how one calculates the period of sequence in<br />
the important case when the modulus � is a large prime or has a large prime as a factor (composite modulus)<br />
[15]. Newer empirical tests, especially in [16], show that some of other PRNGs like Combo, NCOMBO and<br />
Lagged-Fibonacci using *, are statistically b<strong>et</strong>ter than LCG.<br />
2.2. Basic Theorem<br />
In the subsequent treatment, all numbers are integers, the modulus � is a prime number. Suppose a sequence<br />
of � ’s satisfies:<br />
��������� ����� ����������� ������������������������� (2)<br />
The basic theory behind Lehmer’s equation states that the sequence begins to repeat for a value of � which<br />
satisfies :<br />
� � � � ����������� (3)<br />
Suppose the smallest positive integer � satisfying (3) is � . Then � is called the period of the sequence, and<br />
it must divide �����¥��� and be equal to it in case of a primitive root. All deductions concerning the multiplier<br />
primitive roots and composite modulus are thoroughly discussed in [15].<br />
2.3. Modified Lehmer Equation<br />
The objective of this section is to modify Lehmer’s equation to survive attacks trying to predict its outputs using<br />
the previously read samples without sacrificing its statistical features. From equation (1),<br />
15
G. Hussein & Y. Dakroury & B. Hassan & A. Badr<br />
��� � � � ������� ����� �����������¥� ����������� (4)<br />
Equation (4) has four unknowns (� , � , ��� , � ), so four consecutive samples are enough to crack. In the<br />
<strong>propos</strong>ed model, the randomizer is a key stream PRNG that consists of IDEA cipher algorithm in OFB mode.<br />
A relatively large true random seed which is called Basic Random Data (BRD) must be prepared. The BRD<br />
is fed in sequence to the encryption technique and its output is fed back again to the input of the encryption<br />
technique. The randomizer output is denoted by � . A s<strong>et</strong> of operators and processes are defined as follows:<br />
BRD: Basic Random Data with length of 2048 bytes or 512 four-byte words.<br />
�<br />
: encryption key used in calculating the actual IDEA encryption key.<br />
�¥���<br />
: Computationally expensive function of ��� ��� and others, for simplicity denoted as � ��� � (see �<br />
Section 4.3.4).<br />
IDEA: IDEA encryption algorithm operator with actual key � � ��� � . It operates on ��� at stage � to<br />
�<br />
������� generate . The length of the � array is 512 four-byte words.<br />
L<strong>et</strong> ����������� , ��� is the concatenation operator, ��������������������� � � ��� ��������������������� � � ��� ��� ,<br />
��������������������� � � ��� ��� , in general:<br />
��������� ��������������� � � ��� ��� (5)<br />
For any ����� , ��� is 2048 bytes and is grouped in 512 four-byte words. The general equation for � is:<br />
�������©��������������� ��������������������� �����������������������©����� �����������¥����� � � ��� ��� ����������������������������� (6)<br />
TSRG output is generated by replacing the constant � in Equation (1) by the output of the randomizer � :<br />
��� � � � ������� ����� ����������� ����� �������������©����������� ����������� (7)<br />
where ����������������� , �������§�������¥������������� , ���������������©� and ���������������������©��� .<br />
It is clear that Equation (7) is a generalized form of Equation (4) where the constant � is replaced by random<br />
values (the � s). The statistical features of samples generated by Equation (4) are accepted while � is constant.<br />
Since ��������� is independent variable and based on random data then replacing � s with � s logically enhance or<br />
keep the PRNG’s statistical features [17]. In fact, ��� is generated by combining (adding) delayed Lehmer<br />
PRNG outputs with random initial conditions. Marsaglia in [16] gives the theor<strong>et</strong>ical support that the output<br />
of combining two or more simple generators, by means of a convenient computer operation such as � , � or<br />
exclusive-or, provides a composite with b<strong>et</strong>ter randomness than either of the components. This explains why<br />
TSRG output in Equation (7) has b<strong>et</strong>ter randomness features than LCG. To g<strong>et</strong> the minimum number of samples<br />
to crack, the number of equations must equal the number of unknowns (� s, � , ��� , ��� , � ). If the number of<br />
output samples is � , then:<br />
number of equations ����������� � number of unknown variables �¡ ������¥���©� (8)<br />
The solution for � is 1032 and number of equations = number of variables = 1548 of which 516 are nonlinear<br />
equations of the form (6). The previous s<strong>et</strong> of equations cannot easily be solved depending on the strength<br />
of used encryption and hash algorithms. If the opponent has a solution for the previous number of equations,<br />
a limited number of bytes per message in the same session must be sent. Each ��� is a four-byte word. The<br />
opponent may guess, control or know part of BRD and ��� , use it in one of input attacks, so it is preferred to<br />
define a factor of saf<strong>et</strong>y �£¢�� such that:<br />
16
Implementation Notes.<br />
� �<br />
TSRG: Attack Oriented Design and Implementation<br />
Theor<strong>et</strong>ical Required Samples to Crack<br />
Actual Required Ssamples to Crack<br />
1. Using IDEA encryption can be changed to other encryption technique. This would change the minimum<br />
number samples required to crack if the encrypted data word length differs from 8 bytes.<br />
2. In this implementation,we have used Lehmer’s equation but the concept can be applied to other PRNGs<br />
(e.g., congruential equations) to create random data of any length using limited size of basic random<br />
data.<br />
3. The used Randomizer is a key stream PRNG which is slower one. It is appropriate to Email client<br />
application where speed is not the first issue. For application which need higher speeds, we may use<br />
other efficient Randomizer PRNG like Marsaglia, MWC or Lagged-Fibonacci PRNGs.<br />
In all previous cases, all derivations about PRNG security and characteristics have to be redeveloped as will<br />
be shown in next sections.<br />
3. TSRG Characteristics<br />
In this section, the TSRG period, modular sum and arithm<strong>et</strong>ic average over a compl<strong>et</strong>e period are summarized<br />
and compared to that of LCG. Attention is paid to the initial condition x� and its effect on the output samples.<br />
3.1. TSRG Period<br />
TSRG output is generated through Equation (1) by replacing the constant � with the output of the randomizer<br />
�¥¤ . This implies that �����������������¥������� . For ¦���� , the output sample � � is given by:<br />
� �<br />
������� ��� �©�����<br />
� ���<br />
L<strong>et</strong> the � � randomizer output be repeated § after period , � � �¨§���� � so that . Consequently<br />
����©����¥���<br />
�<br />
�����<br />
�<br />
�<br />
� ��� �������������¥� �<br />
� �<br />
��� ��¤ ��¤����������¥��� ��� � � � ����������� (10)<br />
¤����<br />
It’s easy now to deduce that the TSRG period � is given by Equation (11):<br />
17<br />
� � Least Common Multiple� Randomizer period� Original Lehmer Generator Period� (11)<br />
(9)
G. Hussein & Y. Dakroury & B. Hassan & A. Badr<br />
3.2. TSRG Modular Sum Over a Compl<strong>et</strong>e Period<br />
To g<strong>et</strong> the modular sum of a sequence, the sum of all output samples must be calculated over a compl<strong>et</strong>e period.<br />
The modular sum equals<br />
3.3. TSRG Average Over a Compl<strong>et</strong>e Period<br />
By similar deductions, it can be proved that the average is §���������§ , where<br />
� ��������� ��� � ��<br />
��<br />
§����<br />
���<br />
�<br />
�� �<br />
��¤������������ ��� (12)<br />
���<br />
�<br />
������������������� � ����� ��� ��� � ��� ��¤�� � �����<br />
�<br />
©�� �©���<br />
� ���<br />
���<br />
���§� � � ��¤������������<br />
� �<br />
��� ��������� �<br />
�����<br />
��� �<br />
����� � ���<br />
©�� � �����<br />
It is clear that for the same randomizer and modified Lehmer generator, its biased average only depends on<br />
��� .<br />
3.4. TSRG Total Average Over a Compl<strong>et</strong>e Period<br />
The total average is defined as the sum of all possible outputs over compl<strong>et</strong>e periods for all initial conditions<br />
divided by the number of summed elements. The sum of all initial conditions is the sum of all values from zero<br />
up to � ��� , which equals ����� ���©����� . Figure 1 illustrates the process of the generation of TSRG for all<br />
initial conditions. All elements are modulo � .<br />
1st sample 2nd sample �����<br />
���<br />
�©� ���©���¥��� �����<br />
�<br />
�����©� � � �����©���¥��� �����<br />
�<br />
����� ����� �����<br />
�����<br />
� ��� � � �����¥�©� �������������©���¥��� �����<br />
�<br />
����� ����� �����<br />
�����<br />
���¥� ���������©���¥�©� � � ��� �����������©���¥��� �����<br />
Figure 1: TSRG Generation Process<br />
The first column is clear to be all numbers from � to ����� , so its average is ��� ��������� . The second column<br />
consists of � elements of an LCG generator with constant ��� and multiplier � and the sample ��������� ��� �©�<br />
). The average can also be proved to be ������������� and for large � the average converges to ����� . The<br />
(�������<br />
same results can be proved for other columns. Here after a d<strong>et</strong>ailed example of a PRNG in the TSRG family<br />
whose randomizer is LCG with modulus 5 and multiplier 3 with initial condition 1 denoted ��������������� as and<br />
adapted Lehmer ����������� generator . Table 1 summarizes the results, which imply that 3 is the total average and<br />
2 is the bad initial condition and TSRG ���������� ����������©� period .<br />
18<br />
�����<br />
�<br />
���<br />
�<br />
(13)
TSRG: Attack Oriented Design and Implementation<br />
Arth. Avr x� Mod. Sum O. Avr O. Std 0 1 2 3 4 5 6<br />
2.5833 0 3 1.714286 1.380131 2 4 1 0 1 3 1<br />
2.5833 1 3 1.714286 1.380131 2 4 1 0 1 3 1<br />
2 2 3 1.714286 1.380131 3 0 6 0 3 0 0<br />
3.75 3 3 1.714286 1.380131 1 0 1 4 2 1 3<br />
3.75 4 3 1.714286 1.380131 1 0 1 4 2 1 3<br />
2.5833 5 3 1.714286 1.380131 2 4 1 0 1 3 1<br />
3.75 6 3 1.714286 1.380131 1 0 1 4 2 1 3<br />
3 12 12 12 12 12 12 12<br />
Table 1: Two-Stage LCGs Statistics<br />
Where: Arth. Avr = Arithmatic Average, O. Std. =Occurences Standard Deviation, Mod. Sum = Modular<br />
Sum, O. Avr = Occurences Average.<br />
For the bad initial condition ������� , the period is reduced to 4 which is less than modulus 7, so not all s<strong>et</strong> of<br />
outputs ������������� are generated. The output sequence has � ��� with a rate double that of others (i.e., redundancy<br />
is higher). The apparent entropy of the output is highly affected, which may help in d<strong>et</strong>ecting bad initial<br />
conditions and trigger dynamic reseeding at shorter periods. The calculated total average is ��� �������������<br />
which is unbiased. So, to obtain unbiased TSRG output, the randomizer is reseeded preserving the current ���<br />
as new initial condition.<br />
4. TSRG Design and Components<br />
In this section, the design perspectives are introduced followed by TSRG implementation considerations,<br />
components and working procedure. The basic idea of TSRG is to use some initial random data (BRD; basic<br />
random data) and feed it to a block cipher such as IDEA to obtain random looking ��¤ numbers . ��¤ Here,<br />
is basically obtained by applying IDEA to ��¤������ ���<br />
. The key to IDEA is obtained by hashing previous key,<br />
internal state and TSRG outputs. The result is then used to feed a generalized Lehmer generator to generate<br />
output. The entropy estimators on the ��¤ and �¥¤ are used to control the period of a specific key before its<br />
updating. A systematic randomizer reseeding occurs every � samples to unbias TSRG output and enlarge its<br />
period.<br />
In the next subsections, the components of the <strong>propos</strong>ed generator are discussed in d<strong>et</strong>ail.<br />
4.1. Design Perspectives<br />
A PRNG depends on cryptographic or polynomial algorithms with random initial conditions or continuous<br />
distilled sources of entropy. In the last case, RNG can be designed using collecting and distillation of enough<br />
entropy from various independent sources. If the number of independent sources are very large and the entropy<br />
distillation of them is accurate then a nearly perfect RNG is obtained. If the sources have no new entropy<br />
bits, a choice is available to switch to cryptographic mode until enough entropy is available or stop producing<br />
output. Stopping producing output is perfect but not practical. Cryptographic mode associates the ability to be<br />
attacked depending on the number of samples cryptographically produced and the used generation technique.<br />
In the OTP cryptosystem, identical copies of the random data must be available to the sender and receiver.<br />
If PRNG is used for OTP cryptosystem then identical objects including data and programs must be available<br />
to them both. In case of using continuous sources of entropy, the receiver must know exactly the points of<br />
switching and the new states after switching to cryptographic mode. This can be done using a special script<br />
language. The format of the script language may consist of delimited entropy bits concatenated with number<br />
of samples to be produced using new resulting state. The length of script program is less than the length of the<br />
outputted generated random data and the ratio b<strong>et</strong>ween them is inversely proportional to number of switches.<br />
The minimum value of the previous ratio is obtained when PRNG permanently work in cryptographic mode<br />
which can be attacked. In this case the script program is one record that consists of the initial condition and the<br />
19
G. Hussein & Y. Dakroury & B. Hassan & A. Badr<br />
number of the desired PRNG output samples. If the switching is very intensive then the script program length<br />
may be huge and comparable with the length of random data length itself.<br />
The very pr<strong>et</strong>ty Yarrow PRNG [3] suffers from this problem when it is used in OTP security as well as its<br />
ad hoc design. This means there must be another approach with minimum sacrifices. The <strong>propos</strong>ed approach<br />
is to gather enough entropy and save it in what is called a limited length Pool and use it adequately to generate<br />
cryptographic random data while dynamic reseedings to unguessable states are occurred before generating<br />
enough samples sufficient to crack. The Pool of random bits (BRD and IDEA key) is securely transferred to<br />
receiver. The number of samples sufficient to crack is achieved from the generator mathematical model and<br />
dynamic reseeding to unguessable state is made using computationally expensive calculation depending of the<br />
apparent entropy of previous internal states and output of the generator itself. TSRG has two types of reseeding<br />
mechanisms. The first changes the key of the randomizer to a new unguessable state. The other occurs after<br />
every � samples to force the cycle length of the randomizer to � . In this case the initial pool is reloaded<br />
while the current ��� is used as initial condition to the next run.<br />
4.2. TSRG Implementation Considerations<br />
The coding of PRNGs is another source of weaknesses. The programmer must be sure that the output of<br />
the generator is exactly the same as he expects. This can be done using well tested composing modules and<br />
testing vectors. TSRG composing modules are LCG module, IDEA cipher technique, Intel RNG driver [18]<br />
and FIPS-140-1 randomness testing modules. All the previous modules are produced by reliable sources and<br />
published in source code on the Intern<strong>et</strong> to be reviewed and tested [16, 19, 20, 21]. Marsaglia diehard rigorous<br />
randomness testing modules includes source code for all well known polynomial generators and the crypto32<br />
library contains all known ciphering techniques including IDEA. The Intel driver can be downloaded free from<br />
Intel’s site. In designing TSRG, the following factors are guidelines that are considered [22]:<br />
1. Attack-Oriented design: which means that every known attack is considered while designing process.<br />
2. Use of well tested primitives (encryption, LCG, Intel RNG driver,...).<br />
3. Base the PRNG on som<strong>et</strong>hing strong (IDEA is strong encryption technique and not old like DES and not<br />
new like AES).<br />
4. Independent components: which can be easily maintained and /or modified.<br />
5. Efficiency : each needed component is implemented however its performance degradation.<br />
6. Resist backtracking: Key updating through irreversible process.<br />
7. Resist Chosen-Input Attacks : PRNG inputs is scattered in the application (PSEC) to resist control and<br />
then internally tested for randomness.<br />
8. Quick Recover from Compromises: key lasts for controlled period that is accepted by the designer to be<br />
useless for the attacker.<br />
9. Dynamically generate a new starting PRNG state: The used hash functions help in switching to<br />
unguessable sate with dynamic periods that depend on entropy of selected points.<br />
10. Good statistical characteristics (large period, pass randomness tests, ...).<br />
11. Theor<strong>et</strong>ical Support: It is not ad hoc design. Characteristics (like repeatability, portability, jumping<br />
ahead, ease of implementation, easy to generate, hardness of prediction and memory and speed<br />
requirements) are thoroughly discussed and evaluated.<br />
20
4.3. TSRG Components<br />
TSRG: Attack Oriented Design and Implementation<br />
The TSRG components are shown in Figure 2. It basically consists of Randomizer, Modified Lehmer Generator,<br />
Entropy Estimator, Key Updating module and Reseeding Mechanism.<br />
BRD<br />
4.3.1. Randomizer<br />
Reseeding<br />
Mechanism<br />
Randomizer<br />
reseed K u<br />
update<br />
Key<br />
Updating<br />
Module<br />
Randomizer<br />
output y n<br />
k r<br />
Figure 2: TSRG Block Diagram<br />
Adapted Lehmer<br />
Generator<br />
Entropy Estimator<br />
TSRG output x n<br />
The randomizer is stream generator designed using encryption technique in feedback mode. Its initial vector is<br />
not one encryption block (8 bytes in case of IDEA cipher) but it is 2048 bytes that are fed to be encrypted in<br />
sequence then fed back to the input again. The output of encryption algorithm in OFB mode after every iteration<br />
can be approximated by a random-draw-without-replacement process. From the previous correspondence the<br />
average cycle size for DES encryption in OFB mode without key reseeding nearly equals ��� � [23, 24]. While<br />
the previous result is made by approximation and for DES, it is usually stated in general for other encryption<br />
techniques that “the average cycle size of encryption technique with input block of size m bits in OFB mode<br />
equals � © ��� ”. The theor<strong>et</strong>ical and actual experiments performed by Davis and Parkin proved that OFB with<br />
full output block is more secure than using OFB of part of the output [24]. In our model, the BRD array is<br />
divided into input blocks which are fed to the encryption technique in sequence and its corresponding output<br />
is fed again at its order in its turn. It is clear that the average cycle size in this case is not as that of OFB of<br />
one block. This issue is under consideration and will be dealt in further study. The use of multi-block here is<br />
made to make the generator resist key-compromise attacks and even the case when the attacker has a tool to<br />
break the encryption algorithm itself. Referring to the mathematical model in the previous section, the s<strong>et</strong> of<br />
output samples using specific key before reseeding is not sufficient to solve the s<strong>et</strong> of equations independent of<br />
the encryption technique used or wh<strong>et</strong>her it can be cracked or not.<br />
Implementation Notes. While randomness testing of many security techniques is well tested by NIST,<br />
especially the finalist candidates (Twofish, Serpent, Rijndael, RC6 and Mars) [25], IDEA is the implemented<br />
one in TSRG.<br />
IDEA is the encryption technique used to in OFB mode for the following reasons:<br />
1. The TSRG implementation allows any other encryption technique to be easily implemented.<br />
2. It is designed to be efficient in software, encrypting 64 bits with 128 bits key [26].<br />
21
G. Hussein & Y. Dakroury & B. Hassan & A. Badr<br />
3. It is well tested with sufficiently published results since development 1990.<br />
4. Its weak keys are studied and published as in [27]. The key verification module is not implemented y<strong>et</strong>.<br />
4.3.2. Modified Lehmer Generator<br />
The task of this module is to ensure randomness of the output and add complexity for cracking trials. Another<br />
advantage is that it works as period amplifier with amplification factor � . The paid processing cost can be<br />
relatively neglected relative to encryption processing time. Since the randomizer is reseeded every M samples<br />
and using Equation (11) the period of TSRG is in the order of � � . After reseeding, the Lehmer initial condition<br />
is the last generated one to amplify the period by � times. For all initial conditions with fixed key updating<br />
and randomizer reseeding every � samples, the expected period in the order of � � and the output is unbiased.<br />
4.3.3. Entropy Estimator Module<br />
The task of this module is to calculate the apparent entropies of the randomizer and TSRG outputs. Key<br />
updating module and reseeding mechanism exploit its outputs using Equations (15, 14) respectively. TSRG<br />
and Randomizer output apparent entropies values can be calculated using the equation � ��� � ������������� ,<br />
where p is probability of generation of any character. And the function � is applied for all characters from<br />
ASCII 0 up to 255. The apparent entropy calculations are done as the output is generated in the following<br />
manner:<br />
1. Two 256 entry tables (entropy tables) are allocated to randomizer and TSRG outputs respectively and all<br />
their entries are initialized to zero.<br />
2. Each character is generated either in randomizer or TSRG, its ASCII value is calculated and its entry in<br />
its table whose address equal to that ASCII is incremented by one.<br />
3. At specific points, when the entropy value is required to be calculated ,the probability � of each character<br />
is calculated which equals to the value of its entry divided by the sum of all entries of its table.<br />
4. Calculate the entropy � ����������� ������� for 256 characters.<br />
The specific points of calculating the entropy is one of the adjustable system param<strong>et</strong>ers, In TSRG<br />
implementation it is adjusted to test at half of expected key update period defined in Equation (14).<br />
At TSRG starting, the two entropy tables are initialized to zero (reseeded) and BRD entropy is calculated.<br />
The randomizer entropy and TSRG entropy are assigned to the BRD entropy.<br />
The first estimate of key reseed period is calculated. After one half of it another trial, based on the generated<br />
output, is performed. When the key update period is encountered, the key is updated to unguessable state and<br />
the entropy tables are reinitialized.<br />
4.3.4. Key Updating Module<br />
It is responsible for changing the key ��� to an unguessable state key ��� using computationally expensive<br />
functions. Updating to new state uses TSRG output combined with randomizer output (not observable by the<br />
attacker) and current key to obtain new key. Although key updating occurs every period � � d<strong>et</strong>ermined by<br />
Equation (14), it is prepared while the output is generated.<br />
� � �<br />
� � � �<br />
�<br />
Key Update Period<br />
Min Samples To Crack<br />
Randomizer Output Apparent Entropy<br />
Factor Of Saf<strong>et</strong>y<br />
(14)<br />
TSRG Output Apparent Entropy<br />
22
TSRG: Attack Oriented Design and Implementation<br />
The first two factors are given in Section 2. In Equation (14), we assume linear dependency b<strong>et</strong>ween key<br />
updating periods and apparent entropies (less than 1). Bad initial conditions and randomizer short cycles force<br />
the key updating at smaller periods. The new key is produced by Equation (15):<br />
��� ����������� ����§���� ��� ��������� ��������� ������������������� ��������������� ����������������� (15)<br />
Where ����§�� is a modified SHA hash function r<strong>et</strong>urning 128 bits, � is the update number, ����� and ����� are<br />
last output samples before key updating as defined in Equation (14).<br />
4.3.5. Reseeding Mechanism<br />
This module has two functions, the first is to reseed the randomizer every � samples and the second to<br />
dynamically trigger key updating. Randomizer reseeding uses the value of the output ��� as the new initial<br />
condition of the next run to g<strong>et</strong> unbiased output.<br />
4.4. TSRG Working Procedures<br />
The following Algorithm describes the generation mechanism for TSRG.<br />
Algorithm TSRG(Tsrg-Length,X0)<br />
Generator_Initial_Condition = X0<br />
Re_Seed ()<br />
Tsrg_Absolute_Counter = 0<br />
Ku_Temp = Kr<br />
DO WHILE Tsrg_Absolute_Counter = 0.5*Key_Update_Period)<br />
Toggle = False<br />
Recalculate_Key_Update_Period()<br />
ENDIF<br />
ENDIF<br />
IF MOD(Tsrg_Absolute_Counter = 0)<br />
ReSeed()<br />
ENDIF<br />
IF (Tsrg_Modulr_Counter >= Key_Update_Period)<br />
Update_Key ()<br />
ENDIF<br />
ENDDO<br />
END TSRG<br />
Algorithm Re_Seed ()<br />
Toggle = True<br />
Randomizer_Input_Data = Basic_Random_Data<br />
Er = Apparent_Entropy (Randomizer_Input_Data)<br />
23
G. Hussein & Y. Dakroury & B. Hassan & A. Badr<br />
Eg = Er<br />
Key_Update_Period = Max_Samples*Eg*Er/Factor_Of_Saf<strong>et</strong>y<br />
Tsrg_Module_Counter = 0<br />
Initialize (Generator_Entropy_Table)<br />
Initialize (Randomizer_Entropy_Table)<br />
END Re_Seed<br />
Algorithm Recalculate_Key_Update_Period ()<br />
Er = Apparent_Entropy (Generator_Entropy_Table)<br />
Eg = Apparent_Entropy (Randomizer_Entropy_Table)<br />
Key_Update_Period= Min_Samples_To_Crack*Eg*Er/Factor_Of_Saf<strong>et</strong>y<br />
END Recalculate_Key_Update_Period<br />
Algorithm Update_Key ()<br />
Toggle = True<br />
Randomizer_Key= Size_Adaptor (Ku_Temp)<br />
Er = Apparent_Entropy (Randomizer_Input_Data)<br />
Eg = Er<br />
Key_Update_Period= Max_Samples*Eg*Er/Factor_Of_Saf<strong>et</strong>y<br />
Tsrg_Module_Counter = 0<br />
Initialize (Generator_Entropy_Table)<br />
Initialize (Randomizer_Entropy_Table)<br />
END Update_Key<br />
5. TSRG Attack Defences<br />
The most important issue is that attackers, including those who know the RNG design, must not be able to make<br />
any useful predictions about the RNG outputs before and after the samples he already knows. The apparent<br />
entropy of the RNG output should be as close as possible to the bit length itself. The previous statement is<br />
essential but not sufficient since many statistically accepted PRNGs are easily cracked. For example, techniques<br />
are now known for breaking all polynomial congruent generators [3, 4, 7, 8]. Since there is no universally<br />
applicable and practical criteria to certify the security of PRNGs, attack defense against all known attacks may<br />
be employed for this task that holds true till new attacks appear or some security factor is discovered to be<br />
overestimated. In the following, a discussion of how the <strong>propos</strong>ed generator resists various attacks:<br />
5.1. Direct Cryptanalysis Attack Defence<br />
Most cryptographic PRNGs mainly depend on the strength of the encryption and hash techniques to defend<br />
against this attack (e.g., ANSI9.17, DSA). TSRG outputs as shown in Section 2, cannot be used to mount this<br />
attack since there are enough read samples to solve the s<strong>et</strong> of equations irrespective of the used encryption and<br />
hash functions. The expensive key updating algorithm forces the attacker to solve a new s<strong>et</strong> of equations with<br />
number of unknowns greater than the number of equations. This means that TSRG does not depend entirely on<br />
the encryption and hash algorithms to defend against this attack.<br />
5.2. Input Attack Defence<br />
TSRG g<strong>et</strong>s its input from three sources (Intel RNG, mouse movements and key strokes timings). It accepts<br />
2500-byte input only once from Intel RNG. Maximized number of apparent random bits, gathered from mouse<br />
movements and key stroke timings then distilled. Intel RNG high entropy source data is combined with<br />
24
TSRG: Attack Oriented Design and Implementation<br />
distilled data of the low entropy sources. Although Intel RNG output is guaranteed to be accepted using<br />
FIPS 140-1 randomness test, the combined data must be tested again, using FIPS 140-1, in this module to<br />
be sure that no attacker demon program is mounted to emulate generation of the required random data. An<br />
exclusive-or b<strong>et</strong>ween random data from the Intel generator and that of low entropy sources is used to combine<br />
them. The exclusive-or is not securely perfect but its response time is optimum. The tested combined data<br />
is used to generate BRD and ��� . Testing the randomness of BRD and scattering entropy gathering modules<br />
in the application defends against chosen-input attacks. If the attacker knows all three sources, there is no<br />
cryptanalysis to be performed. If he knows part of them and has a direct observation of TSRG output, he has a<br />
chance to mount combined cryptanalysis known-input attacks.<br />
5.3. Combined Cryptanalysis Known-Input Attacks<br />
Suppose the attacker knows part of the inputs which can be a portion of BRD and at the same time TSRG output<br />
can be read. Knowing the TSRG design, if the portion of BRD greater than ����� defined in Equation (14) the<br />
attack can succeed. This explains why we introduce this factor of saf<strong>et</strong>y param<strong>et</strong>er in this equation.<br />
5.4. State-Compromise Attack Defence<br />
Suppose that, for whatever reason, the adversary manages to learn the internal state � , exploiting some<br />
inadvertent leak, temporary pen<strong>et</strong>ration, cryptanalysis success, <strong>et</strong>c. Once the state is known, one or more<br />
of the following attacks can be mounted.<br />
5.4.1. Backtracking Attacks<br />
A Backtracking attack uses the compromise of the PRNG state � at time � to learn previous PRNG outputs.<br />
Key updating algorithm is an irreversible process through using truncation of the output of the hash function.<br />
So, it is impossible to g<strong>et</strong> the previous key, hence the previous samples, when state-compromise attack has<br />
succeeded. This is another reason for using IDEA encryption technique whose key is 128 bits while the output<br />
of the hash function is 160 bits.<br />
5.4.2. Permanent-Compromise Attacks<br />
A permanent compromise attack occurs if, once an attacker compromises � at time � , all future and past � values<br />
are vulnerable to attack. Past values cannot be predicted as shown in Section 5.4.1 but future values can succeed<br />
if TSRG output can be observed or calculated (e.g., the param<strong>et</strong>ers � and � in Lehmer’s equation are known).<br />
TSRG does not process input and so can never recover from state compromise attack. It is clear that TSRG<br />
should resist state compromise extension attack as thoroughly as possible. In the <strong>propos</strong>ed implementation<br />
model, the internal state and key variables are saved in Windows virtual memory. Memory manager swaps<br />
them from memory page to the hard disk of which the state can be compromised. State compromise attack<br />
may be resisted by allocating the internal state variables (Key and � s) in memory pages that are extensively<br />
referenced. The following code shows the memory requirements for TSRG static data segment and how the<br />
attack can be avoided.<br />
BYTE Generator_Entropy_Table [256];<br />
BYTE Basic_Random_Data [2048];<br />
BYTE Key_Random [16];<br />
BYTE Key_Updated [16];<br />
BYTE Internal_State[2048];<br />
BYTE Randomizer_Entropy_Table[256];<br />
For every generated character, the entropy tables are updated avoiding probable disk swapping of this page.<br />
25
G. Hussein & Y. Dakroury & B. Hassan & A. Badr<br />
5.4.3. Other State-Compromise Attacks<br />
Iterative-guessing attacks and me<strong>et</strong>–in–the–middle attacks usually associated with input attacks are not<br />
applicatable to TSRG.<br />
6. TSRG Randomness Testing<br />
In this part, four randomness testing programs (OTP [28], ENT [20], FIPS140-1,2 [29, 30] and Diehard [31])<br />
are used to evaluate randomness of TSRG output. With the same BRD, initial condition and initial key, different<br />
lengths of outputs are generated to observe changes of randomness test results. The 2500-byte array from which<br />
all initial conditions are obtained must pass FIPS140-1 test. The same test is applied to every TSRG 2500-byte<br />
output blocks. Applying ENT program to 40000-byte sample output result in passing the test. 1 mega bytes<br />
random output passes FIPS 140-2 tests by using OTP program. For Marsaglia Diehard test, the following<br />
table 2 summarizes the result compared to original LCG. The result of the above tests is ”TSRG passes all<br />
randomness tests while others may fail”.<br />
LATTIC PARKLOT MTUPLE OPSO BDAY OPERM RUNS RANK<br />
LCG Fail PASS Fial Fail PASS PASS PASS PASS<br />
TSRG PASS PASS PASS PASS PASS PASS PASS PASS<br />
Table 2: Diehard Randomness Test Results<br />
7. Conclusion<br />
TSRG is a <strong>propos</strong>ed approach for the chaining of two interacting PRNGs. The first stage generator is any<br />
PRNG (Randomizer) whose output is fed to modify transition and/or output function of the second stage PRNG<br />
(adapted generator) to additionally depend on randomizer output. Many of the well known families of PRNGs<br />
(i.e., shrinking, compound and combination PRNGs) can be considered as instances of the TSRG family.<br />
TSRG characteristics (repeatability, jumping ahead, ease of implementation, ease of generating, hardness<br />
of prediction, memory and speed requirements) are studied and evaluated. One of the implemented family<br />
members, a hybrid PRNG, is obtained through modifying a Lehmer generator with the output of a cryptographic<br />
randomizer. The implemented randomizer is a key stream generator that uses IDEA algorithm in OFB mode<br />
with dynamic key updating and synchronous reseeding to inhibit output prediction, g<strong>et</strong> unbiased output and<br />
elongate the TSRG overall period. The attack oriented design of this instance is thoroughly considered<br />
and studied. Cryptanalysis attack is defended by reseeding the randomizer before the minimum number<br />
of samples sufficient to crack, based on the deduced mathematical model. Dynamic Key updating resists<br />
permanent-compromise, backtracking and iterative-guessing attacks. Testing the randomness of the BRD fed<br />
as input to the randomizer from the Intel RNG generaor and scattering the entropy gathering modules in the<br />
implementation defends against chosen-input attack. Depending on the application environment (e.g., PRNGbased<br />
cryptosystem), the required characteristics can be obtained from a suitable selection of the randomizer<br />
and a clever modification of the adapted generator function.<br />
References<br />
[1] C. Shannon. Communication theory of secrecy systems. Bell System Technical Journal, vol. 28, October<br />
1949, pages 656-715. http://www3.edgen<strong>et</strong>.n<strong>et</strong>/dcowley/docs.html.<br />
[2] O. Goldreich. Foundations of Cryptography. Weizman Institute of Science and Applied Mathematics,<br />
Rehovot, Israel, 2001. http://www.wisdom.weizmann.ac.il/˜oded/foc-vol2.html.<br />
26
TSRG: Attack Oriented Design and Implementation<br />
[3] J. Kelsey. B. Schneier and N. Ferguson. Notes on the design and analysis of the Yarrow cryptographic<br />
pseudorandom number generator. Sixth Annual Workshop on Selected Areas in Cryptography, Springer<br />
Verlag, August 1999. http://www.counterpane.com/yarrow-notes.html.<br />
[4] H. Krawczyk. How to predict congruential generators. Journal of Algorithms, vol. 13, no.4, December<br />
1992.<br />
[5] T. Ritter. Random/pseudo random number generator. http://www.ciphersbyritter.com/<br />
NEWS2/94061801.HTM. sci.crypt forum, June 1994.<br />
[6] J. H˚astad and M. Näslund. Key feedback mode: A keystream generator with provable security. NIST,<br />
2000. http://csrc.nist.gov/encryption/modes/<strong>propos</strong>edmodes/kfb/kfb-spec.<br />
pdf.<br />
[7] D. Eastlake, S. Crocker, and J. Schiller. Randomness recommendations for security. RFC 1750, N<strong>et</strong>work<br />
Working Group, December 1994. http://www.i<strong>et</strong>f.org/rfc/rfc1750.txt.<br />
[8] J. Kelsey, B. Schneier, D. Wagner, and C. Hall. Cryptanalytic attacks on pseudorandom number<br />
generators. In Fast Software Encryption, Fifth International Workshop. Springer Verlag Lecture Notes<br />
in Computer Science 1372, March 1998, pages 168–188. http://www.counterpane.com/<br />
pseudorandom_number.pdf.<br />
[9] R.R. Coveyou and R.D. Macpherson. Fourier analysis of uniform random number generators. Journal<br />
of the ACM, vol. 14, no. 1, January 1967, pages 100–119. http://portal.acm.org/citation.<br />
cfm?id=321379&coll=portal&dl=ACM&CFID=1840718&CFTOKEN=33814197<br />
[10] D.A. Pinnavaia. Generating good random numbers. http://www.rit.edu/˜dap0637/<br />
numbers.html. Cryptography 0603-482, Fall 2001.<br />
[11] T. Moreau. Pseudo-random generators, a high-level survey-in-progress. CONNOTECH Experts-conseils<br />
Inc., March 1997. http://www.connotech.com/rng.htm.<br />
[12] C.H. Sauer and K.M. Chandy. Computer Systems Performance Modeling. Prentice-Hall, Englewood<br />
Cliffs, N.J., 1981.<br />
[13] W. Stallings. N<strong>et</strong>work and Intern<strong>et</strong>work Security. Prentice-Hall, Englewood Cliffs, N.J., 1995.<br />
[14] S.K. Park and K.W. Miller. Random number generators: Good ones are hard to find. Communications of<br />
the ACM, vol. 31, no. 2, October 1988.<br />
[15] A.T. Fuller. The period of pseudorandom numbers generated by Lehmer’s congruential m<strong>et</strong>hod. The<br />
Computer Journal, vol. 19, no. 2, 1976.<br />
[16] G. Marsaglia. A current view of random number generators. In Computer Science and Statistics:<br />
Proceedings of the 16th Symposium on the Interface, Atlanta, Georgia, USA, March 1984. L. Billard,<br />
ed. Elsevier, New York, 1985. http://stat.fsu.edu/˜geo/diehard.html.<br />
[17] A. Papoulis. Probability, Random Variables, and Stochastic Processes. McGraw-Hill Book Company,<br />
1965.<br />
[18] B. Jun and P. Kocher. The Intel random number generator. Cryptography Research Inc., April 1999.<br />
http://developer.intel.com/design/security/rng/rng.htm.<br />
[19] W. Dai. Crypto++, version 4.2. http://www.eskimo.com/˜weidai/cryptlib.html.<br />
[20] J. Walker. A pseudorandom number sequence test program. October 1998. http://www.<br />
fourmilab.ch/random/.<br />
27
G. Hussein & Y. Dakroury & B. Hassan & A. Badr<br />
[21] Intel Inc. Intel 820 chips<strong>et</strong> system driver and utilities. http://www.intel.com/design/<br />
software/drivers/platform/820.htm.<br />
[22] P. Gutmann. Software generation of practically strong random numbers. In 7th USENIX Security<br />
Symposium, San Antonio, Texas, USA, 1998. http://www.usenix.org/publications/<br />
library/proceedings/sec98/gutmann.html.<br />
[23] R.R. Jueneman. Analysis of certain aspects of output feedback mode. In D. Chaum and R.L. Rivest and<br />
A.T. Sherman, eds., Advances in Cryptology: Proceedings of Crypto’82, pages 99-127, August 1982.<br />
Plenum Press, New York and London, 1983. http://dsns.csie.nctu.edu.tw/research/<br />
crypto/HTML/PDF/C82/99.PDF.<br />
[24] D.W. Davies and G.I. Parkin. The average cycle size of the key stream in output feedback encipherment.<br />
In D. Chaum and R.L. Rivest and A.T. Sherman, eds., Advances in Cryptology: Proceedings of Crypto’82,<br />
pages 99-127, August 1982. Plenum Press, New York and London, 1983. http://cnscenter.<br />
future.co.kr/resource/crypto/algorithm/block/cr82Davies.pdf.<br />
[25] J. Soto. Randomness testing for the Advanced Encryption Standard finalist candidates. March 2000.<br />
http://csrc.nist.gov/rng/aes-report-final.doc.<br />
[26] C. Kaufman, R. Perlman, and M. Speciner. N<strong>et</strong>work Security, Private Communication in a Public World.<br />
Prentice-Hall, 1995.<br />
[27] J. Daemen. Cipher and Hash Function Design, Strategies Based on Linear and Differential Cryptanalysis.<br />
Doctoral Dissertation, Katolische Universiteit Leuven, Belgium, March 1995. http://www.esat.<br />
kuleuven.ac.be/˜cosicart/ps/JD-9500/.<br />
[28] One Time Pad Encryption —0.9.4— Test Run. http://www.vidwest.com/otp/testrun.htm.<br />
[29] N. Bridges. FIPS140-1, FIPS140-2 randomness tests. http://www.quartus.n<strong>et</strong>/files/Misc/<br />
fips140x.zip.<br />
[30] W. N. Havener, R. J. Medlock, L.D. Mitchell, and R.J. Walcott. Derived test requirements for FIPS PUB<br />
140-1, security requirements for cryptographic modules. Part 1. NIST, March 1995. http://csrc.<br />
ncsl.nist.gov/cryptval/140-1/140test1.htm.<br />
[31] G. Marsaglia. Diehard battery of tests. http://wwws.irb.hr/˜stipy/random/Diehard.<br />
html.<br />
28
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
The Alternating Step(r, s) Generator<br />
Abstract<br />
A. A. Kanso�<br />
1: King Fahd University of P<strong>et</strong>roleum and Minerals<br />
P. O. Box 2440, Hail, Saudi Arabia<br />
akanso@hotmail.com<br />
A new construction of a pseudo-random generator based on a simple combination of three feedback shift<br />
registers (FSRs) is introduced. The main characteristic of its structure is that the output of one of the three<br />
FSRs controls the clocking of the other two FSRs. This construction allows users to generate a large family<br />
of sequences using the same initial states and the same feedback functions of the three combined FSRs. The<br />
construction is related to the Alternating Step Generator that is a special case of this construction. The period,<br />
and the lower and upper bound of the linear complexity of the output sequences of the construction whose<br />
control FSR generates a de Bruijn sequence and the other two FSRs generate m-sequences are established.<br />
Furthermore, it is established that the distribution of short patterns in these output sequences occur equally<br />
likely and that they are secure against correlation attacks. All these properties make it a suitable cryptogenerator<br />
for stream cipher applications.<br />
Keywords. Feedback Shift Registers, Stream Ciphers, Clock-Controlled Registers, Alternating Step<br />
Generator.<br />
1. Introduction<br />
A � -stage feedback shift register (FSR) is a device that generates binary sequences.<br />
An FSR is made up of two parts: a shift register � , and a feedback function � . The shift register � consists<br />
of � stages �����¥��������������������� which contains one bit 0 or 1. The contents of these stages at a given time � is<br />
known as the state of the register � and is denoted by: � �������������¥�����������¥����������������������� . (Where at time �����<br />
the state � � �����������¥�����������¥����������������������� is called the initial state of � ).<br />
The feedback function � is a function that maps the state of the register � to the bit 0 or 1. At time � ,<br />
�������������¥������������������������������� or � .<br />
The shift register � is clocked at a time interval, when this happens the contents of � are shifted one bit<br />
to the left (i.e., the content of ��� is transferred into �������������������������������¡����� and the new content of ������� is<br />
computed by applying the feedback function � to the old contents of � .<br />
The above can be expressed as follows:<br />
�<br />
������������� for �������������������������<br />
���������¡�����<br />
�������������¥���������������������������<br />
�������������¡�����<br />
The binary ��� � � sequence generated by this device is the sequence of contents of �<br />
���<br />
the ��� stage � of for<br />
� all (i.e., the binary ��� � ��������������������������������� sequence � � ����������������������� where ��������������������� for ).<br />
The state sequence of this device is given by the sequence of states of the register � :<br />
� ����� � ��� � �����������<br />
���<br />
29
Kanso<br />
� � �����������¥����������������������� where ���������������������<br />
for<br />
Since the output sequence of a feedback shift register is the content of �<br />
���<br />
the stage of the register then<br />
clearly each of the output ��� � � sequence and the state ��� ��� sequence d<strong>et</strong>ermine the other.<br />
If the feedback � function of a feedback shift register can be written in the �������������¥���������������������������<br />
form:<br />
for a given time � , for some binary constants ��������������������������� called the<br />
�������������������������������������������������<br />
feedback coefficients, then the shift register is called linear, � where denotes addition modulo 2.<br />
The feedback coefficients ��������������������� d<strong>et</strong>ermine a polynomial ����������� � ������������������� ����� ��� � of<br />
degree � associated with the feedback function � . We write ������� to denote this polynomial and call it the<br />
characteristic feedback polynomial of the linear feedback shift register.<br />
Any � -stage linear feedback shift register can be uniquely described by a characteristic feedback polynomial<br />
������� over the finite field of order � of the form: ��������������������� � ������������������� ����� ��� � .<br />
1.1. Construction<br />
Keystream sequence generators that produce sequences with large periods, high linear complexities and good<br />
statistical properties are very useful as building blocks for stream cipher applications. The use of clockcontrolled<br />
generators in keystream generators appears to be a good way of achieving sequences with these<br />
properties [1].<br />
In this paper, a new clock-controlled generator that is called the Alternating Step(����� ) Generator (and<br />
referred to as ASG(���¥� )) is introduced. The ASG(����� ) is a sequence generator composed of three FSRs A, B<br />
and C [2] which are interconnected such that B is clocked by the constant � integer and C is not clocked if the<br />
content of �<br />
���<br />
the stage of A is 1, otherwise, B is not clocked and C is clocked by the constant � integer . FSR<br />
A is called the control register and FSRs B and C are called the generating registers. The output bits of the<br />
ASG(���¥�<br />
� �<br />
� � �<br />
� � � �����������¥�����������¥����������������������� � � �����������¥�����������¥����������������������� � � �<br />
) are produced by adding modulo 2 the output bits of FSRs B andC under the control of FSR A.<br />
Suppose that the control register FSR A has stages and feedback function . Similarly, suppose<br />
that the generating registers FSRs B and C have and stages respectively and feedback functions<br />
and respectively. L<strong>et</strong> , and<br />
be the initial states of A, B and C respectively.<br />
���������¥�����������¥�����������������������<br />
The initial state of ASG(����� the ) at ����� time is given � � ����� � ��� � ��� � � by: .<br />
Define a function � that acts on the state of FSR A at a given time � to d<strong>et</strong>ermine the number of times FSR<br />
B or FSR C is clocked such that: at any time � , ����� �����¡�������������¨������������������� .<br />
and<br />
Define two cumulative functions of FSR A, ��� and ��� : ��������������������������������������������� such that:<br />
�����������<br />
�����������<br />
��� ��<br />
��� ��<br />
�����<br />
��������������� � ���¡�<br />
����������������������� � �����<br />
��� ��<br />
�����<br />
��� ��<br />
���������¥� for ���¨��� and ���������������<br />
�������������¡���¥� for ���¨��� and ���������������<br />
�����<br />
�����<br />
Thus, with initial � � ����� � ��� � ��� � � state , at � time the state of ASG(����� the ) is given � ��� by:<br />
� ��� ����� ��� ��� ����� ��� � .<br />
���<br />
At any � time , the output of ASG(����� the ) is the content of �<br />
���<br />
the stage of B added modulo 2 to the content<br />
of �<br />
���<br />
the stage of C, �������������������������������������¥�<br />
i.e.,<br />
ASG(����� The ) may also be described in terms of the three output ��� � �¥����� � � sequences ��� � � and of the<br />
feedback shift registers A, B and C respectively.<br />
Acting on their own, suppose that FSR A, FSR B and FSR C produce output sequences ��� � ��������������������� ,<br />
��� � ��������������������� , and ��� � ��������������������� respectively. The sequence ��� � � is called the control sequence, and<br />
30
The Alternating Step(r, s) Generator<br />
the sequences ��� � � and ��� � � are called the generating sequences of the ASG(���¥� ) respectively and referred to<br />
as component sequences.<br />
The output ��� � � sequence of ASG(����� the ) whose control and generating sequences ��� � � are ��� � � , ��� � � and<br />
respectively is given � � ��� ����� ��� ��� ����� ��� by: where:<br />
�����������¡�<br />
��� ��<br />
��� and �������������<br />
�����<br />
�����<br />
2. Properties of the Output ��� ��� Sequence of ASG(����� the )<br />
��� ��<br />
�������¡���¥� for ���¨��� and ���������������������������<br />
Suppose that A is an FSR with initial state � � and feedback function � such that the output sequence ��� � � of A<br />
is a de Bruijn sequence of span � and it has period ������� [2]. Suppose that the feedback shift registers B and<br />
C are primitive linear feedback shift registers (LFSRs) with non-zero initial states � � and � � respectively, and<br />
primitive characteristic feedback polynomials ������� of degree � and ������� of degree � respectively (where<br />
������� � � ��� � � ��� � ������� �<br />
� � ��� ��� � �<br />
and are associated with the feedback functions and respectively) [2]. L<strong>et</strong> and<br />
denote the output sequences of LFSRs B and C respectively. Then and are m-sequences of periods<br />
component sequences ��� � � are ��� � � , ��� � �¥� and<br />
Note that a de Bruijn sequence of � span can be easily obtained from an m-sequence generated by � a -stage<br />
primitive LFSR by simply adding � a to the end of each subsequence ��������� of 0s occurring in the m-sequence.<br />
�<br />
����� � �¡��� and ������� � �¡��� respectively [2]. L<strong>et</strong> ��� � � be the output sequence of the ASG(����� ) whose<br />
In a full period ������� of ��� � � the number of ones and zeroes is ��������������� ��� [2]. Thus, after<br />
clocking FSR A � times, LFSR B is clocked �����������¡����� ��� times and LFSR C is clocked ����������������� ���<br />
times.<br />
In this section, some properties of the output sequences such as period and linear complexity are established.<br />
It is shown that, when � and � are positive integers greater than 1 satisfying ���¥��������������� , and � and � satisfy<br />
������������� � �¡������������������� � �¡������� , then the period of the output sequences is exponential in � , � and � ,<br />
and that the linear complexity is exponential in � . Finally, it is established that the distribution of short patterns<br />
in the output sequences of this ASG(���¥� ) turns out to be ideal.<br />
2.1. Period and Linear Complexity ������� of<br />
The output ��� � � sequence can be seen as two sequences added modulo ��� � ������� ����� ��� ���¡��� ����� ��� � 2, , where<br />
����� ��� � and ��� ����� ��� � are generated by the sub-generators whose component sequences are ��� � � , ��� � � and<br />
���<br />
� � , ��� � � respectively.<br />
���<br />
In order to establish the period and the linear complexity ��� � � of one needs to first consider the periods and<br />
the linear complexities of the two ��� ����� ��� � sequences ��� ����� ��� � and .<br />
In the following two lemmas, the periods of the sequences ��� � � � ��� � and ��� � � � ��� � are considered. Tr<strong>et</strong>ter<br />
[3] has considered this proof for the output sequences of the stop and go generator [4]. His proof is also valid<br />
for the sequences ��� ����� ��� � and ��� ����� ��� � .<br />
Lemma 1 If ���¥��������� � �¨������� , then the period � � of the sequence ��� ����� ��� � is ������� � ����� .<br />
Proof. The sequence ��� ����� ��� � will repeat whenever the states of the shift registers A and B r<strong>et</strong>urn to their<br />
initial states � � and � � respectively. The register A r<strong>et</strong>urns to its initial state once every ������� clock pulses.<br />
Thus, for � cycles of register A, register B is clocked ����������� times.<br />
Therefore, if for some � integers � and ���������������<br />
�<br />
, , then the feedback shift registers A and B will<br />
simultaneously be in their initial states. The period of the ��� ����� ��� � sequence corresponds to the smallest integer<br />
value that the � integer can take.<br />
31
Kanso<br />
�����������������<br />
���¥�������������¥�<br />
�<br />
����� ���¥������� ��� �<br />
��������� ��� � �<br />
� ���<br />
��������� ���¥������� ���¥��������� ��� � ��� ��������� �<br />
Now . Therefore, if i.e., , then the smallest<br />
value that can take is when . Clearly , hence, if then<br />
�<br />
�����������������¥�<br />
����� .<br />
�<br />
Thus, in �<br />
cycles of register A, register B ��������� cycles times and the period ��� ����� ��� � of � is<br />
� �¨��� . �������<br />
Lemma 2 ���¥��������� � �¨������� If , then the � � period of the ��� ����� ��� � sequence ������� � �¨���¥�<br />
is<br />
Proof. Similar to the proof of the above lemma.<br />
Definition 3 The linear complexity of a purely periodic sequence is equal to the degree of its minimal<br />
polynomial. The minimal polynomial is the characteristic feedback polynomial of the shortest LFSR that can<br />
produce the given sequence.<br />
In the following two lemmas, the minimal polynomials of ��� ����� ��� � and ��� ����� ��� � are considered.<br />
Lemma 4 ���¥��������� � �¨������� If , then the minimal polynomial of the ��� ����� ��� � sequence is of the ��������� form<br />
��� �����¡��� ��� where ������� and is an irreducible polynomial of � degree . In particular, the linear complexity<br />
��� ����� ��� � of ��� is such �£��� ����� ��� � ����� that: .<br />
Proof. First, recall that ���¥��������� � ��������� if ���¥�������������¥�<br />
�<br />
�������¥����������������� � �¨������� then .<br />
Upper Bound on L1: If one starts at � location in the ��� ����� ��� � sequence for a fixed value � of with<br />
� � � � and chooses every �<br />
���<br />
element in the sequence ��� ����� ��� � , then this is equivalent to starting at<br />
�<br />
������������� position ��� � � in and choosing ���������<br />
���<br />
every element. Such a sequence is ��������� a -decimation<br />
��� � � of . All ��������� the -decimation ��� � � of have the same minimal ������� polynomial whose roots are the<br />
���<br />
powers of the roots of ������� [5]. The final sequence ��� ����� ��� � consists of � such sequences<br />
���������<br />
interleaved. (In other words, ��� ����� ��� � if is written by rows into an � array columns wide, then each column<br />
is a sequence produced ������� by ). Hence, the ��� ����� ��� � sequence may be produced by an LFSR constructed as<br />
follows [6].<br />
Take an LFSR with feedback polynomial ������� and replace each delay by a chain of � delays and only the<br />
left most of each such group of � delays is tapped and input to the feedback function with a non-zero feedback<br />
coefficient. Thus, ��� ����� ��� � is produced by an LFSR with the feedback polynomial ��������� . Hence, the minimal<br />
polynomial of ��� ����� ��� � divides ����� � ��������� �¥� ����������� ��� . Hence, ��� ����� ��� � has linear complexity ���<br />
bounded from above by �����¡�£��� .<br />
������� � Furthermore, Chambers [6] has shown that, if is irreducible, with degree and exponent �<br />
������� ������� � ����� , then the polynomial , like is irreducible of degree and exponent �<br />
.<br />
Lower Bound on L1: ������� L<strong>et</strong> denote the minimal polynomial ��� � � � ��� � of . The ��� � � � ��� �<br />
sequence<br />
������� � � ��� ����� ��� ��������� satisfies for � all , ����� where is the all-zero sequence � and is the shift operator. Since<br />
the ������� polynomial is irreducible then the ������� polynomial must be of the ��������� form for ��� . ���<br />
�<br />
�����������������¥�<br />
Assume ��� ������� ������� ��� � ������� ��� �������<br />
�������£� ������� ��� ������� �����£����� �����£����� �¥�����<br />
��� ��� � � ��� � ��� �<br />
�<br />
. Then divides . Since is an irreducible polynomial of degree it<br />
divides the polynomial . Therefore, divides , but then the period<br />
of is at most [5] contradicting lemma 1. Therefore � ����� ��� and the lower bound follows.<br />
Lemma 5 ���¥��������� � ��������� If , then the minimal polynomial of the ��� ����� ��� � sequence is of the ��������� form<br />
��� ��������� ��� where ������� and is an irreducible polynomial of � degree . In particular, the linear complexity<br />
��� ����� ��� � of ��� is such ����� ����� ��� � ����� that: .<br />
Proof. Similar to the proof of the above lemma.<br />
32<br />
�<br />
and<br />
�
The Alternating Step(r, s) Generator<br />
Therefore, if ���¥��������� � �����������¥��������� � ��������� then the periods of ��� ����� ��� � and ��� ����� ��� � are<br />
� ��������� � ����� and � � ��������� � ����� respectively and the minimal polynomials of ��� ����� ��� � and ��� ����� ��� �<br />
�<br />
are equal ��������� to ��������� and respectively ��� ������� � ��� ��� where ������� and ������� , are irreducible polynomials<br />
of � degree � and respectively.<br />
Theorem 6 � If � , are positive integers greater than 1 ���¥��������������� satisfying � and � , ���¥��������� � �<br />
satisfy<br />
� ��������� , then the output sequence ��� � � has period ������� � ��� � ��������� � ����� and linear<br />
���������¥���������<br />
� complexity such ������������� ����� � � ������������� that: .<br />
Proof. From the above lemmas, the minimal polynomials ��� ����� ��� � of ��������� is and that ��� ����� ��� � of ��������� is<br />
��� �����¡� � ��� ��� where . ������� Since ������� and are irreducible of different degrees ���������������¥�¥������������� then ,<br />
���¥���������������¥��������������� hence [5]. Therefore, the period ��� � � of ��������������� � ��� � � is [5, theorem 3.9] and<br />
the minimal polynomial ��� � � of ������������������� is of ������� � ��� � � degree [5, theorem 6.57].<br />
Hence, the period ��� � � of ��������������������� � �����¥��������� � ������������� ������� � ��������� � �������������������<br />
� ��� � �<br />
is<br />
[7, lemma 5.9]. Thus, the period ��� � � of ������������� � �¨������� � �¨���¥� is and the linear complexity ��� � � of � is<br />
such ������������� ����� � � ������������� that: .<br />
2.2. The Statistical Properties of �������<br />
������������� � ��������� � ����� ��� � �<br />
� � ����������������� �<br />
� ���¥��������� �����������¥��������� � ������� � � �<br />
In this section, the number of ones and zeroes in a full period of the sequence<br />
are counted. It also shown that when and are positive integers greater than 1 satisfying<br />
and the positive integers and satisfy , then any pattern of length<br />
�£¢¥¤§¦ where¨���� are positive that¨������������������������ and������������������������� integers �©¨������ such occurs<br />
with probability ������� ����� ������������� ����� � , the integer part<br />
¡<br />
of� for any real number� .<br />
� where����� ��� ���<br />
��� � ��� � � �<br />
is<br />
Since and are m-sequences then in a full period �<br />
�¨��� ����� ��� � � � of the number of ones and<br />
zeroes is �<br />
����� � � � ����� ��� ��� � �<br />
����� ��� ��� ��� � � �����<br />
����� ����� ��������� � ����� �¨���<br />
and respectively, and in a full period of the<br />
number of ones and zeroes is and respectively [2].<br />
If the period of ��� � � attains its maximum value ������������� � � ������� � � ��� , then it is obvious that the number<br />
of ones and zeroes in a full period of ��� � � is ��������� � ������� ����� ��� ����� � and ��������� � ������� ����� ����� ����� �������<br />
respectively.<br />
In the following theorem, similar techniques to the ones used by Gunther [8] are applied to d<strong>et</strong>ermine the<br />
distribution of short patterns in the output sequences of the ASG(����� ).<br />
Theorem 7 L<strong>et</strong> ����� be positive integers greater than 1 satisfying ���¥������������� � and l<strong>et</strong> � , � satisfy<br />
The probability of occurrence pattern�������������������������������������������������� of length¡<br />
any of<br />
the ��� � � sequence � is up to an error of order��������� ����� ������������� ����� � .<br />
��� ��¢¥¤�¦<br />
� �����������¥��������� � ������� � . L<strong>et</strong>¨ and� be positive integers such that¨������������������������<br />
�������������<br />
and�����������¨���������¡�����<br />
in �©¨������<br />
Proof. The proof is given in the appendix.<br />
Clearly, the smaller the values for � and � compared to � and � are, the b<strong>et</strong>ter the above result is. This<br />
does not mean that it is suggested to take � and � to be very small, for example � ������� . For more security<br />
it is b<strong>et</strong>ter to irregularly clock the generating registers by large values, so that the gap b<strong>et</strong>ween the bits selected<br />
from the generating sequences is large.<br />
Experiments have shown that ���¥��������������� if , then for any values � of � and ���¥��������� � �������<br />
satisfying<br />
� �¨������� , the output sequences of the ASG(����� ) have good statistical properties.<br />
�������������<br />
Therefore, when � and � are positive integers greater than 1 satisfying ����������������� � and ����� satisfy<br />
������������� � ��������������������� � ��������� , then an ASG(����� ) with a de Bruijn sequence as the control sequence and<br />
33<br />
�������
Kanso<br />
m-sequences as the generating sequences generates sequences with period ������� � ��� � ��������� � �¡��� , linear<br />
complexity � such that ������������� ����� � � ������������� , and these sequences have good statistical properties.<br />
In practice, one can choose � and � to be powers of 2 in which case ���¥��������� � �¨���������¥��������� � �¨������� .<br />
In the following section, some correlation attacks on the ASG(����� ) are considered.<br />
3. Attacks<br />
A suitable stream cipher should be resistant against a “known-plaintext” attack. In a known-plaintext attack the<br />
cryptanalyst is given a plaintext and the corresponding cipher-text (in another word, the cryptanalyst is given a<br />
keystream), and the task is to reproduce the keystream somehow.<br />
The most important general attacks on LFSR-based stream ciphers are correlation attacks. Basically, if a<br />
cryptanalyst can in some way d<strong>et</strong>ect a correlation b<strong>et</strong>ween the known output sequence and the output of one<br />
individual LFSR, this can be used in a divide and conquer attack on the individual LFSR [9, 10, 11, 12].<br />
The output sequence of the ASG(���¥� ) is an addition modulo 2 of its two irregularly decimated generating<br />
sequences ��� ����� ��� � and ��� ����� ��� � . Thus, one would not expect a strong correlation to be obtained efficiently,<br />
especially, if primitive feedback polynomials of high Hamming weight are associated with the feedback<br />
functions of the registers B and C [11], and the values of � and � which are used to clock the generating<br />
registers are considered as part of the key (i.e., � and � are kept secr<strong>et</strong>).<br />
If the characteristic feedback functions of A, B and C are known then a cryptanalyst can exhaustively<br />
search for initial state of A, each such state can be expanded to a prefix of the ��� � � control sequence using the<br />
characteristic feedback function of A. Suppose that one expands ��� � � the its�<br />
���<br />
� sequence � until and are<br />
produced ��������� . From this prefix, and from the knowledge of a corresponding� -long prefix<br />
where���<br />
of the output sequence ��� � � of , one can derive the value non-consecutive bits of the generating sequences<br />
��� � � and ��� � � using the following relation:<br />
¢����<br />
of�<br />
� � ��� � �����<br />
�<br />
����� ��� ��� ����� � ��� � if � � �����<br />
�<br />
����� ��� ��� ����� � ��� � if � � �����<br />
�<br />
Since the characteristic feedback functions of B and C are known, then the initial states of B and C can<br />
be revealed given these non-consecutive� -bits of ��� � � and ��� � � respectively by solving a system of linear<br />
equations, but first one has to reveal the values of � and � in order to d<strong>et</strong>ermine the locations of these non<br />
consecutive� -bits in ��� � � and ��� � � . Therefore, the attack takes approximately������������������� steps where<br />
����������� ,��� is the number of possible values for � such that ���¥��������� � �¡������� and��� is the number of<br />
possible values for � such that ������������� � �¨������� .<br />
The probability of two random numbers being relatively primes is 60.8% [13]. Thus,����� � ����� and<br />
������� ����� , and the above attack takes approximately����� � ����������� � � � � � steps.<br />
For �������, and �������<br />
�������, the<br />
attack takes approximately����� ����� � steps. Thus, this ASG(���¥� )<br />
appears to be secure against this attack. Moreover, it appears to be secure against all correlation attacks<br />
introduced in [9, 10,11,12,14, 15, 16, 17,18,19].<br />
There is also another attack that can be applied to the ASG(���¥� ) through the linear complexity, but this<br />
attack requires ������������� consecutive bits of the output sequence.<br />
For maximum ASG(���¥� security, the ) should be used with secr<strong>et</strong> initial states, secr<strong>et</strong> characteristic feedback<br />
���¥� functions, ���¥��������� � ������� ���¥��������� � ��������� secr<strong>et</strong> satisfying ����� , and greater than 1 satisfying<br />
. Subject to these constraints, an ASG(���¥� ) with �������, ����������������� and appears � to be<br />
secure against all presently known attacks.<br />
������� �������<br />
34
4. Related Work<br />
The Alternating Step(r, s) Generator<br />
An interesting example of existing FSR-based construction for comparison with the ASG(���¥� ) is the Alternating<br />
Step Generator (ASG) of Gunther [8].<br />
The ASG is a special case of the ASG(����� ); it is actually an ASG(����� ). Although the ASG(����� ) is slower<br />
than the ASG, its advantage is that it provides more security. For an ASG with ����� , ����� and ����� , if<br />
the characteristic feedback functions of A, B and C are known, then in order to reveal the initial states of the<br />
three registers the attack mentioned in section 3 approximately������� takes � steps, whereas for the ASG(����� ),<br />
��<br />
the attack takes approximately� ����� � �� � steps. Moreover, for the ASG in order to produce a new sequence,<br />
one has to choose a new initial state and/or a new characteristic feedback function for at least one of the FSRs,<br />
whereas for the ASG(����� ) in order to produce a new sequence, it suffices to assign new value(s) for � and/or � .<br />
5. Conclusion<br />
From the theor<strong>et</strong>ical results established, it is concluded that an ASG(���¥� ) whose control FSR generates a de<br />
Bruijn sequence and generating FSRs generate m-sequences produces sequences with large periods, high linear<br />
complexities, good statistical properties, and they are secure against correlation attacks. Furthermore, using the<br />
same initial states and the same characteristic feedback functions, the ASG(���¥� ) produces a new sequence each<br />
time one assigns new value(s) for � and/or � . These characteristics and properties enhance its use as a suitable<br />
crypto-generator for stream cipher applications.<br />
Acknowledgement<br />
I would like to thank Prof. P<strong>et</strong>er Wild for his helpful comments.<br />
References<br />
[1] D. Gollmann and W. Chambers. Clock-controlled shift register: A review. IEEE Journal on Selected<br />
Areas in Communications, vol. 7, no. 4, May 1989, pp. 525–533.<br />
[2] S. W. Golomb. Shift Register Sequences. Aegean Park Press, 1982.<br />
[3] Steven A. Tr<strong>et</strong>ter. Properties of PN2 sequences. IEEE Transactions on Information Theory, vol. IT-20,<br />
March 1974, pp. 295–297.<br />
[4] T. B<strong>et</strong>h and F. Piper. The stop and go generator. In Advances in Cryptology: Proceedings of EuroCrypt<br />
84, Lecture Notes in Computer Science, Berlin: Springer-Verlag 1985, vol. 209, pp. 88–92.<br />
[5] R. Lidl, H. Niederreiter. Introduction to Finite Fields and Their Applications. Cambridge University Press,<br />
1986.<br />
[6] W. Chambers. Clock-controlled shift registers in binary sequence generators. IEE Proceedings E, vol.<br />
135, Jan 1988, pp. 17–24.<br />
[7] R. Ruppell. Analysis and Design of Stream Ciphers. Berlin, Heidelberg, New York: Springer-Verlag,<br />
1986.<br />
[8] C. G. Gunther. Alternating step generators controlled by de Bruijn sequences. In Advances in Cryptology:<br />
Proceedings of EuroCrypt 87, Lecture Notes in Computer Science, Berlin: Springer-Verlag, vol. 309,<br />
1988, pp. 5–14.<br />
35
Kanso<br />
[9] J. Golic, M. Mihaljevic. A generalized correlation attack on a class of stream ciphers based on the<br />
Levenstein distance. Journal of Cryptology, vol. 3, 1991, pp. 201–212.<br />
[10] J.Golic. Towards fast correlation attacks on irregularly clocked shift registers. In Advances in Cryptology:<br />
Proceedings of EuroCrypt 95, Lecture Notes in Computer Science, Berlin: Springer-Verlag, vol. 921,<br />
1995, pp. 248–262.<br />
[11] W. Meir, O. Staffelbach. Fast correlation attacks on certain stream ciphers. Journal of Cryptology, vol. 1,<br />
1989, pp. 159–176.<br />
[12] T. Siegenthaler. Correlation-immunity of non-linear combining functions for cryptographic applications.<br />
IEEE Transactions On Information Theory, vol. IT-30, no. 5, 1984, pp.776–779.<br />
[13] www.utm.edu/research/primes/notes/relprimr.html.<br />
[14] J. Golic. On the security of shift register based keystream generators. In R. Anderson, Editor, Fast<br />
Software Encryption, Cambridge Security Workshop, Lecture Notes in Computer Science, Berlin:<br />
Springer-Verlag, vol. 809, 1994, pp. 90–100.<br />
[15] T. Johansson. Reduced complexity correlation attacks on two clock-controlled generators. In Advances of<br />
Cryptology: Proceedings of AsiaCrypt 98, Berlin: Lecture Notes in Computer Science, vol. 1514, 1998,<br />
pp. 342–356.<br />
[16] M. Mihaljevic. An approach to the initial state reconstruction of a clock-controlled shift register based on<br />
a novel distance measure. In Advances in Cryptology: AusCrypt 92, Berlin: Lecture Notes in Computer<br />
Science, vol. 178, 1993, pp. 349–356.<br />
[17] J. Golic, L. O’Connor. Embedding probabilistic correlation attacks on clock-controlled shift registers. In<br />
Advances in Cryptology: EuroCrypt 94, Berlin: Lecture Notes in Computer Science, vol. 950, 1995, pp.<br />
230–243.<br />
[18] T. Johansson, F.Jonsson. Improved fast correlation attacks on certain stream ciphers via convolutional<br />
codes. In Advances in Cryptology: EuroCrypt 99, Berlin: Lecture Notes in Computer Science, vol. 1592,<br />
Springer-Verlag, 1999, pp. 347–362.<br />
[19] T. Johansson, F.Jonsson. Fast correlation attacks through reconstruction of linear polynomials. In<br />
Advances in Cryptology: Crypto 2000, Berlin: Lecture Notes in Computer Science, vol. 1880, Springer-<br />
Verlag, 2000, pp. 300–315.<br />
A. Proof of Theorem 7<br />
Proof. Since ����������������� � and ���¥��������� � � ����� ���¥��������� � � ����� � , then the period of ��� � �<br />
� �¨������� � �¨���¥�<br />
�������������<br />
��� ������������������������� L<strong>et</strong> be represented in the �¡����� form<br />
� �©�����<br />
, ������������������������� ,<br />
�����<br />
������������������������� ����� and l<strong>et</strong> us first consider the frequency of patterns among subsequences<br />
,� �<br />
�<br />
�������������������<br />
� ��� � ����������������� � ������� for a fixed������������������������� �¨��� .<br />
�<br />
L<strong>et</strong>� �����©��� and�������©��� be defined by:<br />
� � (1)<br />
���<br />
� ��� ���<br />
� ������������������������������� �������<br />
� ��������������������������������������� �������<br />
36
for ���������������������¡ ����� .<br />
can be written as<br />
Then�<br />
���������������������¡ ����� for .<br />
The matching condition at time � is:<br />
for ���������������������¡ ����� .<br />
This is equivalent to:<br />
for ���������������������¡ ����� .<br />
Using the following relations:<br />
The Alternating Step(r, s) Generator<br />
����� ��������� (2)<br />
� � ��� � ��� (3)<br />
� ����� � ��� � ��� � ����������� � ��������� (4)<br />
��������� � �����©� ������������� (5)<br />
�����©� ��������� � �����©���������¨�������������<br />
�����©�<br />
the sum of Equation (4) and of the corresponding equation ��������� for becomes:<br />
����� � ������� � ��� ����� � ��� � � ������������� (6)<br />
�<br />
����� � ������� � ��� ����� � ��� � � �������������<br />
�<br />
since, when ����� � , �������������¨��� ����� � ������� � ��� ����� � ��� � � � , and when ������� , �������������¡�<br />
� � � � � ������� � ��� � � � � ��� � ��� .<br />
and<br />
This has two solutions:<br />
for ���������������������¡ ����� .<br />
� � � � ��� � � ��� (7)<br />
�<br />
����� � ��� � � ��� �<br />
����� � ��� � � ������� (8)<br />
�<br />
����� � ��� � � �������<br />
�<br />
The number of solutions to this equation is equal to the number of occurrences of pattern� the in the<br />
��� � � sequence ���������©�����<br />
�<br />
�<br />
����� ,�����������������������¨��� (where ), i.e., to the quantity<br />
we want to d<strong>et</strong>ermine.<br />
Without restricting ourselves we consider the solution of Equation (7). Making use of the fact ������� that<br />
and �����������¡��� � ��� that ��������������� � ��� and , this equation becomes:<br />
where �������������������¡ �¨��� . (The term� �<br />
��� � ,�������������������<br />
is omitted since ��� � � has period �<br />
� ���������� � �����¥� ����� � ��� (9)<br />
���������� � � � � � ����� � ��� (10)<br />
L<strong>et</strong>���©����� � �����©���<br />
������<br />
�������������©��������� which is less than �<br />
���<br />
��¢¥¤§¦ �©¨������ where¨��<br />
since¡ ¡<br />
��������������� , then the assumptions ��� � � that is an m-sequence imply ����� that<br />
Equation � ����� (9)<br />
� ��� has ��� solutions . if���<br />
and������������������������� ��<br />
37<br />
.)
Kanso<br />
�����©� ¡ �������������©��������� , then similarly, ��� � � is an m-sequence and ���¥��������������� imply<br />
L<strong>et</strong>���©������� �<br />
that Equation � ����� (10)<br />
� ��� has ��� solutions . if���<br />
��<br />
This remains for����� and/or����� true if we accept an error most��������� ����� ������������� ����� � at .<br />
that���©���������©�������¡<br />
Note<br />
. �����<br />
Clearly, the same result also holds for Equation (8).<br />
Hence, the total number of solutions to Equation (3) is:<br />
which is independent of� .<br />
����� �<br />
�����<br />
����� � ��� ���<br />
�����<br />
��������� �� �� �����<br />
This finally implies that the frequency of the pattern� is given by:<br />
���������<br />
�<br />
�<br />
�����������<br />
�����<br />
�������������<br />
�<br />
Therefore, in a full period ��� � � of any pattern of length ¡<br />
������� ����� ������������� ����� � .<br />
�������������<br />
38<br />
����� �<br />
��¢¥¤§¦ �©¨������ occurs with a probability
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
Experimenting with early opportunistic key<br />
agreement<br />
Candolin� Catharina & Lundberg� Janne & Nikander�<br />
Pekka<br />
1: Laboratory for Theor<strong>et</strong>ical Computer Science,<br />
Helsinki University of Technology,<br />
P.B. 5400, FIN-02015 HUT, Finland<br />
catharina.candolin,janne.lundberg@hut.fi<br />
2: Ericsson Research NomadicLab,<br />
LMF/TR, FIN-02420 Jorvas, Finland<br />
pekka.nikander@nomadiclab.com<br />
Abstract<br />
IPv6 is used for a vari<strong>et</strong>y of tasks, such as autoconfiguration, neighbor d<strong>et</strong>ection, and router discovery.<br />
The often recommended or required approach to secure these functions is to use IPSec. However, in order to<br />
use IPSec, a protocol for establishing Security Associations is needed. The currently prominent m<strong>et</strong>hod for<br />
dynamically creating the Security Associations is to use the Intern<strong>et</strong> Key Exchange (IKE) protocol. However,<br />
IKE requires that the underlying IP stack is functional to the extent that UDP can be used. Thus, a chickenand-egg<br />
problem arises from the fact that IPSec is needed to configure IP, and IP is needed to configure IPSec.<br />
To overcome this problem, a weak and cheap key agreement protocol can be utilized to create temporary,<br />
initial Security Associations that are used until a proper key agreement protocol can be run. In this paper, we<br />
present a protocol that can be used prior to e.g. IKE, and describe our implementation as a proof of concept.<br />
The protocol is designed to provide protection against resource exhausting denial-of-service attacks as well<br />
as reachability information with as few protocol rounds as possible. Thus, the protocol is especially suitable<br />
for wireless n<strong>et</strong>works, for example, ad hoc n<strong>et</strong>works.<br />
1. Introduction<br />
IPv6 [4] is used for a number of functions, including address configuration, neighbor d<strong>et</strong>ection, and router<br />
discovery. To protect these functions, it is either suggested or recommended to use IPSec [8]. The currently<br />
prominent m<strong>et</strong>hod for creating IPSec Security Associations, the Intern<strong>et</strong> Key Exchange (IKE) [6] protocol,<br />
requires that the underlying IP stack is fully functional, at least to the point that UDP may be used. Another<br />
problem with the IKE protocol is that it is relatively heavy. These two problems open up a potential source for<br />
various denial-of-service attacks. Furthermore, a chicken-and-egg problem arises from the fact that IPSec is<br />
needed to configure IP, and fully configured IP is needed to establish the IPSec Security Associations.<br />
To solve the problems presented above, a weak early key agreement protocol can be used, as suggested in<br />
[10]. The purpose of the protocol is to establish initial Security Associations that can be used, for example, for<br />
autoconfiguration purposes. In this paper, we introduce a DoS-resistant anonymous key agreement protocol that<br />
establishes such initial Security Associations before it is possible to run a full blown key agreement protocol,<br />
for example IKE. We also briefly describe our implementation, which was made as an experiment to show that<br />
the protocol can be realized fairly easily.<br />
The rest of this paper is organized as follows: in Section 2, the previously mentioned chicken-and-egg<br />
problem is further analysed and previous work done for an authentication protocol is presented. In Section 3,<br />
our early key agreement protocol is described and analyzed with respect to the requirements specified. Section<br />
4 contains a description of our implementation, and Section 5 concludes the paper.<br />
39
Candolin & Lundberg & Nikander<br />
2. Background<br />
The stateless autoconfiguration specification [12] defines a m<strong>et</strong>hod of providing initial boot time configuration<br />
for IP hosts. If autoconfiguration is to be used over wireless n<strong>et</strong>works, such as ad hoc n<strong>et</strong>works, a wide vari<strong>et</strong>y<br />
of security attacks become possible due to the lack of physical protection of the n<strong>et</strong>work medium. To protect<br />
wireless hosts from becoming victims to masquerading or denial-of-service attacks, security can be provided<br />
on the link layer, or the autoconfiguration mechanism can be improved to deal with potential threats. The<br />
protocol described in this paper adopts the latter approach.<br />
In the stateless autoconfiguration mechanism, a host sends a series of Neighbor Solicitations [9] to the local<br />
link. These messages contain a tentative IP address that the host would like to use as its link local address.<br />
If the address is already in use by another host, that host will send a Neighbor Advertisement as a reply, and<br />
the booting host must choose a new address. If no replies are received, the host may start using the selected<br />
address. Once the host has acquired its address, it sends a series of Route Solicitation messages to find the<br />
local routers. The local routers reply with Route Advertisement messages. The Router Advertisement typically<br />
contains a s<strong>et</strong> of routing prefixes that the host can use for creating a globally routable address.<br />
To provide security, IPSec AH [7] can be used to protect the Neighbor Discovery messages. AH can also be<br />
used to verify that the Neighbor and Router Advertisements came from valid and authorized hosts. However,<br />
this requires manually configured Security Associations, since the only way of automatically creating Security<br />
Associations is by using IKE, but IKE in turn requires an IP address in order to be functional.<br />
Due to this chicken-and-egg problem, IKE cannot be used in the initial phase to provide security for IP<br />
configuration. A simple key agreement protocol is thus needed prior to running IKE.<br />
2.1. Previous work<br />
In [1][2], a DoS-resistant authentication protocol using puzzles is introduced. The main idea is to allow the<br />
server to generate puzzles that the client must solve before the server creates any protocol state or performs<br />
heavy computations. Creating a puzzle and verifying the solution must be inexpensive for the server, and the<br />
cost of solving the puzzle should be adjustable by the server. The client should not be able to precompute<br />
solutions to the puzzle, and the server must be able to give the same puzzle to several clients. However, if one<br />
client knows the solution to the puzzle, it should not be able to help another client to solve the puzzle.<br />
The puzzle used is a brute force reversal of a hash function, such as MD5 [11] or SHA1 [5]. The main<br />
criteria of the hash function is that the cost of reversing it should be adjustable by the server. Both MD5 and<br />
SHA1 me<strong>et</strong> this requirement. To create new puzzles, the nonce��� server periodically generates a , which it<br />
sends to the clients. The server also level� decides upon the difficulty of the puzzle. The cost of solving the<br />
puzzle is exponentially dependent on�. If�����, no work is required, and (in the case of MD5),<br />
the client would have to reverse the whole hash function. The latter is assumed to be impossible, and suitable<br />
values are thus 0–64 bits. The tog<strong>et</strong>her form the puzzle that the client must solve.<br />
if���������<br />
with� nonce��� for�<br />
Upon reception of the puzzle, the client generates nonce�¥� a . If the reuses��� client , the client creates a<br />
new puzzle by creating new values . Furthermore, including the client nonce prevents an attacker from<br />
consuming a specific client’s puzzles by computing solutions and submitting them to the server prior to the<br />
given client. The client proceeds by repeating the following operation until it finds the correct solution:<br />
of���<br />
result = hash(client identity, ���<br />
���<br />
solution)<br />
, ,<br />
In order to prevent clients from impersonating other clients, the identity is included as a param<strong>et</strong>er in<br />
the puzzle. Solving the puzzle for one client does not help in finding solutions for other clients. Thus,<br />
impersonation attacks become infeasible, as the solution must be recomputed for each client separately.<br />
Furthermore, since the server refreshes the value periodically, it is impossible to precompute the<br />
solutions. However, a client may reuse by solving the puzzle with a . new��� the�¥� of�¥�<br />
The client sends the solution of the puzzle back to the server. The server verifies that the solution is correct<br />
and checks that it came within a valid time frame. For each value , the server keeps track of correctly<br />
of���<br />
40
solved instances of the puzzle to prevent solutions from being reused.<br />
Opportunistic key agreement<br />
The puzzle presented in [2] is assumed to satisfy the criteria for good puzzles. Due to the nonce created<br />
by the server combined with the time limit, the solution to the puzzle cannot be precomputed. The protocol<br />
includes the identity of the client, so that the solution computed by one client does not help another.<br />
3. A weak key agreement protocol<br />
To solve the chicken-and-egg problem presented in Section 2, a key agreement protocol is needed to establish<br />
initial Security Associations. To provide denial-of-service protection, we adopt the puzzle based approach<br />
described in Section 2.1.<br />
The purpose of the protocol is to create key material that is to be used only for a short period of time. Thus,<br />
the protocol does not need to withstand active attacks, but should rather be simple and efficient to implement.<br />
The goals of the protocol are the following:<br />
1. To establish an unauthenticated (or partially authenticated) secr<strong>et</strong> shared key for the client and server.<br />
The key should have the following properties:<br />
key<br />
key<br />
�<br />
�<br />
freshness: the key should not have been used in previous runs of the protocol.<br />
control: both parties should participate in creating the key.<br />
Properties such as key authentication and forward secrecy are not needed for the initial security<br />
associations and can therefore be neglected.<br />
2. To provide the server with some level of protection against resource consuming denial-of-service attacks<br />
launched by the client. The client should commit to the communications before the server will create any<br />
state or perform heavy computations.<br />
3. To ensure to both the client and the server that the other party is reachable at the claimed location.<br />
3.1. Protocol description<br />
To create the keying material b<strong>et</strong>ween the client and the server, the protocol relies on Diffie-Hellman based<br />
key agreement. Both parties possess a public/private Diffie-Hellman key pair. The server also holds two other<br />
cryptographic keys: the state key and the signature key. The former is used to calculate a MAC over the current<br />
state of the server and the latter is used for creating signatures.<br />
To provide protection against denial-of-service attacks, a puzzle based on a cryptographic hash function<br />
(MD5 or SHA1) is used. The server generates a nonce and applies the hash function to it. It then zeroes the<br />
first bits of the result and sends the resulting string tog<strong>et</strong>her with the of� value to the client. This puzzle is<br />
recomputed within a certain time interval to avoid replay or masquerading attacks. The client solves the puzzle<br />
by computing bits by brute-force. Once it succeeds, it sends the result to the server, which verifies that<br />
the solution is correct. Only then will the server commit itself to the communication.<br />
�<br />
the�<br />
The protocol is depicted in Figure 1. To ensure both parties about the reachability of the other party, a three<br />
round protocol is needed. When the client wishes to engage in a communication with the server, it sends a<br />
Trigger message, which initializes the connection. The message does not cause the server to store any state.<br />
Upon reception of the Trigger, the server sends the puzzle to the client by generating a Request pack<strong>et</strong><br />
containing the time information, the MAC, its public key, the puzzle, and the signature. The state information<br />
is thus passed to the client instead of being stored at the server. Also, the format of the time information does<br />
not need to be d<strong>et</strong>ermined, as it is only used by the server.<br />
41
Candolin & Lundberg & Nikander<br />
CLIENT<br />
<br />
dhc := new Diffie−Hellman private key<br />
DHC := new Diffie−Hellman public key<br />
optional: verify SIGS<br />
SOLUTION := solve(PUZZLE, addr_client)<br />
KEYMAT := Diffie−Hellman(dhc, DHS)<br />
SIGC := SIGN(KEYMAT,<br />
)<br />
Trigger<br />
REQUEST = <br />
RESPONSE = <br />
Figure 1: The protocol messages<br />
SERVER<br />
<br />
<br />
<br />
dhs := new Diffie−Hellman private key<br />
DHS := new Diffie−Hellman public key<br />
UTC_TIME := current time<br />
PUZZLE := create_new<br />
STATE := <br />
MAC := HMAC(state_key_server, STATE)<br />
SIGS := SIGN(sign_key_server, )<br />
verify SOLUTION(PUZZLE, addr_client)<br />
STATE := <br />
verify MAC<br />
KEYMAT := Diffie−Hellman(dhs, DHC)<br />
verify SIGC<br />
When the client receives the Request, it may verify the signature to check that it was created by the server.<br />
This feature is optional. It then solves the puzzle, generates the shared secr<strong>et</strong> key (according to Diffie-Hellman<br />
key generation), and creates a signature with the shared key of the puzzle, the corresponding solution, the MAC,<br />
and the state information sent by the server. This is added to the Response pack<strong>et</strong>, which is sent back to the<br />
server.<br />
The server now knows that the client was reachable at the given address. It then proceeds to verify the<br />
solution and generates the shared key. After that, the signature is checked. If all checks succeed, then the<br />
protocol terminates successfully.<br />
3.2. Analysis<br />
It can be stated that the protocol me<strong>et</strong>s its goals if the following assumptions hold:<br />
1. The Diffie-Hellman key exchange establishes a shared secr<strong>et</strong> key that is known to both the client and the<br />
server, but cannot be computed by a passive adversary. This property has been previously proved in the<br />
literature, and the proof is thus omitted from this paper.<br />
2. Solving the puzzle in fact is hard. This can be proved by showing that the chosen hash function is indeed<br />
a one-way function, and thus the only way to solve the puzzle is by brute force, which has complexity<br />
O(�������), is the number of bits to r<strong>et</strong>rieve.<br />
where�<br />
The reachability of the client and server is verified by the three round nature of the protocol. Once the<br />
client receives the Request message, it is assured of the fact that the server is residing at the claimed location.<br />
Furthermore, upon receiving the Response message, the server can verify that the client in turn is reachable.<br />
42
Client port Server port<br />
Server SPI<br />
MAC type Group type Sig req type Sig resp type<br />
Time<br />
Puzzle type K Zero<br />
Puzzle−R<br />
Puzzle−bits<br />
Server public DH key<br />
SigS<br />
MAC<br />
Figure 2: The request message<br />
Opportunistic key agreement<br />
Protection against denial-of-service attacks is provided, since the server does not store any state before it<br />
has verified the solution to the puzzle, and the puzzle in turn is assumed to be hard to solve. Furthermore, the<br />
time limit deployed ensures that previous solutions cannot be reused, and the added client identity ensures that<br />
a solution cannot be redistributed to other clients.<br />
4. Implementation<br />
As a proof of concept, we implemented the key agreement protocol as a user space program in Linux. The<br />
implementation takes advantage of ICMPv6 [3] messages to simplify communication with the IPv6 layer. The<br />
Trigger is implemented as an Echo Request message.<br />
The server uses a time interval of one minute to generate a puzzle and a time stamp, which it signs using<br />
its private signature key. The signature covers the pack<strong>et</strong> depicted in Figure 2, starting from the MAC-type<br />
field until and including the Server public DH key field. The IPv6 address of the server is appended to<br />
the data. Upon reception of a Trigger, the server sends the same puzzle as a response to all clients until the<br />
puzzle is changed.<br />
The format of the Request message is depicted in Figure 2. The Request message is carried in an ICMP<br />
pack<strong>et</strong>, which is omitted from the picture for simplicity.<br />
The puzzle contains three fields: the number of bits to solve,� , a random 64-bit value Puzzle-R,<br />
and the targ<strong>et</strong> bits, Puzzle-bits. The client must find such a 32-bit number, Puzzle-x, that the�<br />
least significant bits of result = hash(Puzzle-R | Client address | Puzzle-x) matches<br />
the value of Puzzle-bits. The only efficient way of solving the puzzle is by brute force, and the solution<br />
cannot be shared by several clients as it is dependent on the IP address of the client.<br />
The MAC-field is an HMAC-value which is calculated over the whole message in Figure 2, using the private<br />
state key of the server. Upon reception of a Trigger, the server signs its state and adds it to the Request<br />
message. However, the server does not store this state at this point of the protocol run. The field is later used<br />
by the server to authenticate the state when it is sent back by the client in the Response message.<br />
The client may verify the signature that it receives in the Request pack<strong>et</strong>, but this check is optional. It<br />
then solves the puzzle and computes a shared secr<strong>et</strong> key using its own private key and the public Diffie-Hellman<br />
key of the server. The entire Request message is inserted into the Server state field of the Response<br />
message depicted in Figure 3. Finally, the Response message is signed with the shared secr<strong>et</strong> key that was<br />
43
Candolin & Lundberg & Nikander<br />
Server state<br />
Client SPI<br />
Puzzle−x<br />
Client public DH key<br />
Signature<br />
Figure 3: The response message<br />
created as a result of the Diffie-Hellman exchange, and the message is sent to the server.<br />
When the server receives a Response message, it first checks that a solution for the current puzzle has not<br />
been received from the client before, and that the state information that was sent in the Request message has<br />
not been modified. Next, the time stamp and the puzzle solution are verified. If the time stamp has not expired<br />
and the puzzle solution is correct, the server computes the shared secr<strong>et</strong> key using the public Diffie-Hellman<br />
key of the client and its own private Diffie-Hellman key. Finally, the server checks the signature in the response<br />
message.<br />
The Security Association is created once the steps described above have been successfully compl<strong>et</strong>ed.<br />
5. Conclusion<br />
A major problem with IPv6 autoconfiguration, especially when performed over wireless n<strong>et</strong>works, is the<br />
chicken-and-egg problem related to security. In order to securely provide an IP address, the IPSec IKE protocol<br />
is needed, but in order to run IKE, an IP address is needed. To overcome this problem, a simple protocol for<br />
establishing initial security associations is needed. The protocol does not need to withstand active attacks, but<br />
it must provide protection from resource consuming denial-of-service attacks launched by a malicious initiator.<br />
In this paper, we have described a Diffie-Hellman based protocol, which relies on three round messaging to<br />
prove reachability and client puzzles to provide protection against denial-of-service.<br />
References<br />
[1] T. Aura. Authorization and availability—Aspects of Open N<strong>et</strong>work Security. PhD thesis, Helsinki<br />
University of Technology, 2000.<br />
[2] T. Aura, P. Nikander, and J. Leiwo. DoS-resistant Authentication with Client Puzzles. In Cambridge<br />
Security Protocols Workshop 2000, 2000.<br />
[3] A. Conta and S. Deering. Intern<strong>et</strong> Control Message Protocol (ICMPv6) for the Intern<strong>et</strong> Protocol Version<br />
6 (IPv6) Specification. Request for Comments 2463, 1998.<br />
[4] S. Deering and R. Hinden. Intern<strong>et</strong> Protocol, Version 6 (IPv6) Specification. Request for Comments 2460,<br />
December 1998.<br />
[5] D. Eastlake and P. Jones. US Secure Hash Algorithm 1 (SHA1). Request for Comments 3174, 2001.<br />
[6] D. Harkins and D. Carrel. The Intern<strong>et</strong> Key Exchange (IKE). Request for Comments 2409, 1998.<br />
[7] S. Kent and R. Atkinson. IP Authentication Header. Request for Comments 2402, 1998.<br />
44
Opportunistic key agreement<br />
[8] S. Kent and R. Atkinson. Security Architecture for the Intern<strong>et</strong> Protocol. Request for Comments 2401,<br />
1998.<br />
[9] T. Narten, E. Nordmark, and W. Simpson. Neighbor Discovery for IP Version 6 (IPv6). Request for<br />
Comments 2461, 1998.<br />
[10] P. Nikander. Denial-of-Service, Address Ownership, and Early Authentication in the IPv6 World. In<br />
Cambridge Security Protocols Workshop 2001, 2001.<br />
[11] R. Rivest. The MD5 Message-Digest Algorithm. RFC 1321, IETF, April 1992.<br />
[12] S. Thomson and T. Narten. IPv6 Stateless Address Autoconfiguration. Request for Comments 2462,<br />
1998.<br />
45
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
46
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
I-Vote: Un système de vote électronique hautement<br />
sécurisé<br />
Résumé<br />
Benmeziane� S. & Khelladi� L.<br />
1: <strong>Laboratoire</strong> des Logiciels de Base, CERIST,<br />
3 Rue des Frères Aissou Ben Aknoun, Alger<br />
sbenmeziane@mail.cerist.dz<br />
2: <strong>Laboratoire</strong> des Logiciels de Base, CERIST,<br />
3 Rue des Frères Aissou Ben Aknoun, Alger<br />
lkhelladi@mail.cerist.dz<br />
Nous présentons dans c<strong>et</strong> article la conception <strong>et</strong> l’implémentation de i-vote, un prototype de système<br />
de vote électronique sur Intern<strong>et</strong>. Le prototype implémenté encapsule un protocole de vote reposant sur<br />
l’utilisation d’outils de cryptographie avancées pour assurer l’intégrité <strong>et</strong> la confidentialité du vote d’une<br />
part, l’authentification <strong>et</strong> l’anonymat des électeurs d’autre part.<br />
Basé sur les travaux de Fujioka, Okamoto <strong>et</strong> Ohta <strong>et</strong> du protocole Sensus, i-vote applique la technique de<br />
signature en aveugle au bull<strong>et</strong>in du votant. Ainsi, il est impossible de tracer le bull<strong>et</strong>in de vote pour savoir le<br />
votant associé, par conséquent le système garantit l’anonymat du votant.<br />
Mots clés : vote, anonymat, vérifiabilité, signature en aveugle.<br />
1. Introduction<br />
L’interconnexion des réseaux <strong>et</strong> l’expansion rapide du Web ont permis le développement d’un grand nombre<br />
d’applications que l’utilisateur peut exécuter à distance sans se déplacer physiquement. L’une des applications<br />
qui devrait profiter actuellement de ces avancées technologiques est le vote. En eff<strong>et</strong>, les élections <strong>et</strong> les<br />
référendums traditionnels nécessitent le déplacement de tous les participants au vote or, il est difficile de<br />
convaincre tout le monde de faire le déplacement alors qu’il serait si facile de voter de chez soi, de façon<br />
électronique. Les avantages seraient multiples : un plus grand nombre de participants grâce à l’aisance de c<strong>et</strong>te<br />
opération impliquée par le non-déplacement <strong>et</strong> la simplicité du processus, le dépouillement automatisé <strong>et</strong> donc<br />
plus rapide, le coût d’organisation réduit à cause de l’élimination des dépenses associées à l’établissement<br />
des bureaux de vote <strong>et</strong> le personnel qu’ils requièrent, <strong>et</strong>c. Néanmoins, la réalisation d’un système de vote<br />
électronique n’est pas une tâche facile, car le vote électronique pose un double problème qui est celui de<br />
l’anonymat <strong>et</strong> la confidentialité [1].<br />
En eff<strong>et</strong>, une telle procédure nécessite la satisfaction d’au moins deux propriétés essentielles :<br />
La vérifiabilité : chacun doit être en mesure de vérifier la validité du scrutin, <strong>et</strong><br />
L’anonymat : ou chacun veut conserver le secr<strong>et</strong> de son vote.<br />
Ces deux propriétés semblent contradictoires, car pour vérifier le résultat du scrutin, il faut voir toutes les<br />
étapes de calcul. Dans c<strong>et</strong> article, nous allons présenter une solution à ce problème qui consiste à utiliser la<br />
cryptographie <strong>et</strong> notamment la technique de signature en aveugle pour garantir l’anonymat du votant. Le but de<br />
ce travail [9] consiste donc, à concevoir <strong>et</strong> réaliser un système de vote électronique qui nécessite la définition<br />
d’un protocole de vote satisfaisant les deux propriétés précitées d’une part, <strong>et</strong> perm<strong>et</strong>tant un scrutin à candidats<br />
multiples d’autre part (la plus part des protocoles se limitent à la situation de référendum avec seulement<br />
47
S. Benmeziane & L. Khelladi<br />
une alternative oui/non). Le système mis en oeuvre, qui ne sera pas destiné aux élections à grande échelle de<br />
participation, est implémenté dans un environnement Intern<strong>et</strong> via une interface Web en utilisant le langage Java.<br />
Dans c<strong>et</strong> article, nous présentons la conception <strong>et</strong> l’implémentation du prototype i-vote. Pour cela, nous<br />
décrirons, dans la section 2, les propriétés du vote électronique en insistant sur les exigences de sécurité.<br />
Dans la section 3, nous présenterons une synthèse des protocoles de vote existants. Puis, nous consacrerons la<br />
section 4 à la description du protocole de vote adopté. Dans la section 5, nous étudierons la mise en oeuvre du<br />
système de vote. Enfin, nous finirons par une conclusion où nous évaluerons notre prototype <strong>et</strong> <strong>propos</strong>erons les<br />
éventuelles extensions.<br />
2. Le vote électronique : définition <strong>et</strong> propriétés<br />
Le vote électronique est un exemple d’application distribuée qui perm<strong>et</strong> aux élections d’avoir lieu sur des<br />
réseaux informatiques ouverts [4]. Dans c<strong>et</strong>te application un ensemble de votants envoie leurs bull<strong>et</strong>ins à travers<br />
le réseau à un centre de dépouillement virtuel responsable de la réception, validation, <strong>et</strong> classification des<br />
bull<strong>et</strong>ins.<br />
D’une manière générale, les participants impliqués dans une élection électronique sont un collectif<br />
d’électeurs <strong>et</strong> un ensemble d’autorités de vote. Le nombre <strong>et</strong> l’utilité de ces autorités sont variables, ils<br />
dépendent du schéma de vote considéré [4].<br />
Le scénario d’une élection électronique peut être divisé en trois phases :<br />
Phase d’enregistrement : Durant c<strong>et</strong>te première étape, l’autorité de vote crée la liste électorale de toutes les<br />
personnes éligibles qui sont enregistrées pour c<strong>et</strong>te opération de vote <strong>et</strong> la publie à travers le réseau.<br />
Phase de vote : C<strong>et</strong>te phase perm<strong>et</strong> aux votants d’envoyer leurs bull<strong>et</strong>ins de vote en utilisant les facilités de<br />
communication offertes par le réseau.<br />
Phase de décompte : A la fin de la phase de vote, l’autorité arrête la réception des bull<strong>et</strong>ins, <strong>et</strong> le processus<br />
de décompte des résultats est déclenché. Finalement, les résultats sont publiés <strong>et</strong> mis à la disposition des<br />
votants à travers le réseau.<br />
L’application du vote étant destinée à être exécutée sur le réseau, un bon système de vote électronique doit<br />
assurer quelques propriétés qui définissent des exigences concernant sa sécurité <strong>et</strong> son implémentation [2, 3].<br />
Dans ce qui suit, nous allons définir les exigences de sécurité dont nous tiendrons compte lors de la conception<br />
du système.<br />
Précision : Une élection est précise si elle vérifie les exigences suivantes :<br />
– Un vote ne doit pas être altéré, par conséquent les résultats du vote ne doivent pas être modifiés en<br />
ajoutant des votes invalides ou en changeant le contenu des bull<strong>et</strong>ins par exemple (intégrité).<br />
– Un vote valide doit être compté.<br />
– Un vote invalide ne doit pas être compté.<br />
Démocratie : C<strong>et</strong>te propriété est assurée si :<br />
– Seuls les votants éligibles peuvent voter.<br />
– Chaque votant ne peut voter qu’une seule fois. La propriété de démocratie est généralement liée<br />
à l’intégrité de la liste électorale (liste des votants éligibles). Pour cela, quelques mécanismes<br />
supplémentaires doivent être ajoutés pour empêcher l’administrateur de c<strong>et</strong>te liste de casser c<strong>et</strong>te<br />
propriété.<br />
Confidentialité : Nous qualifions de vote confidentiel, un vote dans lequel :<br />
– ni l’autorité du vote ni personne d’autre ne doit pouvoir faire le lien entre un votant <strong>et</strong> son<br />
vote (anonymat) : l’anonymat constitue probablement la pierre angulaire de tout système de vote<br />
électronique [11].<br />
– aucun votant ne peut prouver qu’il a voté dans un chemin particulier : ce dernier facteur de<br />
confidentialité est aussi important pour la prévention contre l’achat du vote, en eff<strong>et</strong> les électeurs<br />
48
I-Vote: Un système de vote électronique hautement sécurisé<br />
ne peuvent vendre leurs votes que s’ils sont capables de prouver à l’ach<strong>et</strong>eur qu’ils ont réellement voté<br />
d’après leurs vœux.<br />
Vérifiabilité : Il existe deux définitions de c<strong>et</strong>te propriété, la vérifiabilité universelle <strong>et</strong> la vérifiabilité<br />
individuelle. Un système de vote est universellement vérifiable si toute personne peut indépendamment<br />
vérifier que tous les bull<strong>et</strong>ins ont été comptés correctement. Un système de vote est individuellement<br />
vérifiable (définition plus faible) si chaque votant peut indépendamment vérifier que son propre bull<strong>et</strong>in<br />
a été correctement compté [12].<br />
<strong>Avant</strong> d’expliquer le schéma de vote <strong>propos</strong>é <strong>et</strong> comment celui-ci va essayer de remplir les exigences de sécurité<br />
citées auparavant, nous allons brièvement présenter les principaux types de protocoles de vote décrits dans la<br />
littérature.<br />
3. Synthèse <strong>et</strong> critiques des protocoles de vote électroniques<br />
Les premiers protocoles de vote électronique n’utilisent pas de techniques cryptographiques. Ces protocoles<br />
sont basés généralement sur deux autorités de vote : la première est utilisée pour l’authentification des votants<br />
enregistrés, <strong>et</strong> la deuxième chargée de la collection des bull<strong>et</strong>ins <strong>et</strong> le décompte des résultats. Malgré leur<br />
simplicité, ces protocoles présentent des inconvénients majeurs. En eff<strong>et</strong>, ils ne répondent pas à la majorité des<br />
propriétés citées précédemment [8].<br />
Dès lors, des protocoles utilisant les mécanismes cryptographiques ont été <strong>propos</strong>és. Ces derniers<br />
introduisent le chiffrement pour assurer la confidentialité du vote, <strong>et</strong> la signature numérique pour assurer<br />
l’authentification des votants <strong>et</strong> garantir ainsi qu’ils ne peuvent voter plus d’une fois.<br />
Pour garantir l’anonymat des votants, certains de ces protocoles se sont basés sur l’utilisation de deux<br />
autorités pour séparer les deux tâches d’authentification du votant <strong>et</strong> le décompte de son bull<strong>et</strong>in. Cependant<br />
le problème d’anonymat s’est toujours posé à cause du risque de collusion existant entre les deux autorités<br />
pouvant ainsi déterminer qui a voté pour qui [8].<br />
Par conséquent, <strong>et</strong> afin de dissocier complètement le votant de son vote, la technique de signature en<br />
aveugle introduite par David Chaum en 1982 a été utilisée [7]. C<strong>et</strong>te technique perm<strong>et</strong> à l’autorité chargée<br />
de l’authentification des votants de signer leurs bull<strong>et</strong>ins sans avoir la moindre idée sur le contenu. De c<strong>et</strong>te<br />
manière, le risque de collusion entre les deux autorités est éliminé : la première n’ayant aucune information<br />
sur les bull<strong>et</strong>ins qu’elle a validé. Ceci est similaire au fait de placer un document avec une feuille de papier<br />
Carbonne dans une enveloppe. Si quelqu’un signe c<strong>et</strong>te dernière, le document sera signé aussi, la signature<br />
reste alors attachée au document même s’il est r<strong>et</strong>iré de l’enveloppe. Parmi les protocoles de vote basés sur la<br />
signature en aveugle, nous distinguons les travaux de Fujioka, Okamoto <strong>et</strong> Ohta qui ont défini un protocole de<br />
vote utilisant deux autorités centrales <strong>et</strong> est à la base du protocole Sensus décrit dans [8].<br />
4. Proposition d’un protocole de vote électronique<br />
Afin de m<strong>et</strong>tre en oeuvre notre système, nous avons choisi d’adopter le protocole Sensus. Notre choix est dû<br />
essentiellement au fait que ce protocole assure le maximum de propriétés désirées, <strong>et</strong> particulièrement les deux<br />
propriétés exigées préalablement : l’anonymat <strong>et</strong> la vérifiabilité. De plus, par rapport au protocole de Fujioka,<br />
Okamoto <strong>et</strong> Ohta, Sensus perm<strong>et</strong> de réaliser une opération de vote en une seule session [8].<br />
4.1. Scénario du protocole Sensus :<br />
Notons que Sensus est un protocole qui utilise deux autorités centrales :<br />
– Une autorité centrale de légitimation (ACL) qui est responsable de l’authentification des votants <strong>et</strong> la<br />
validation de leurs bull<strong>et</strong>ins.<br />
49
S. Benmeziane & L. Khelladi<br />
– Une autorité centrale de décompte (ACD) qui prend en charge la collection des bull<strong>et</strong>ins <strong>et</strong> le<br />
dépouillement des votes.<br />
Le protocole suit les étapes suivantes :<br />
1. Le votant prépare le bull<strong>et</strong>in qui contiendra son vote.<br />
2. Le votant chiffre son bull<strong>et</strong>in avec une clef secrète.<br />
3. Le votant utilise une fonction de hachage pour avoir un condensat de son bull<strong>et</strong>in crypté.<br />
4. Il camoufle le condensat en utilisant un facteur de camouflage aléatoire pour perm<strong>et</strong>tre la signature en<br />
aveugle à l’ACL [7].<br />
5. Le votant signe le condensat camouflé avec sa clef de signature privée.<br />
6. Il envoie le message résultant à l’ACL.<br />
7. L’ACL vérifie la signature du votant avec la clef publique de ce dernier.<br />
8. L’ACL vérifie que le votant n’a pas encore soumis un bull<strong>et</strong>in pour validation.<br />
9. Si le votant est légitime <strong>et</strong> n’a pas validé un bull<strong>et</strong>in de vote précédemment, l’ACL lui valide son bull<strong>et</strong>in<br />
en le signant en aveugle avec sa clef privé.<br />
10. L’ACL mentionne que le votant a déjà validé son bull<strong>et</strong>in de vote, <strong>et</strong> r<strong>et</strong>ourne par la suite ce bull<strong>et</strong>in au<br />
votant.<br />
11. Le votant enlève le facteur de camouflage r<strong>et</strong>rouvant ainsi son bull<strong>et</strong>in original crypté, haché <strong>et</strong> signé par<br />
l’ACL.<br />
12. Le votant envoie à l’ACD le bull<strong>et</strong>in résultant de l’étape précédente, ainsi qu’une copie du vote chiffré<br />
produit lors de la deuxième étape.<br />
13. L’ACD vérifie la signature sur le bull<strong>et</strong>in signé par l’ACL.<br />
14. L’ACD utilise la même fonction de hachage employé au début par le votant pour calculer un condensat<br />
du vote chiffré reçu à l’étape n�12 <strong>et</strong> le comparer par la suite avec le message résultant de l’étape n�11.<br />
15. Si l’ACD constate que la signature de l’ACL est valide <strong>et</strong> le bull<strong>et</strong>in n’a pas été modifié durant les étapes<br />
précédentes, elle le place dans la liste des bull<strong>et</strong>ins valides pour les publier à la fin du vote.<br />
16. L’ACD signe le bull<strong>et</strong>in avec sa clef privée, <strong>et</strong> elle le r<strong>et</strong>ourne au votant comme accusé de réception.<br />
17. Apres avoir reçu l’accusé de réception, le votant envoie la clef secrète de déchiffrement à l’ACD.<br />
18. A ce moment, l’ACD utilise c<strong>et</strong>te clef privée pour déchiffrer le bull<strong>et</strong>in <strong>et</strong> ajoute le vote au décompte.<br />
Dans ce protocole, <strong>et</strong> pour assurer la confidentialité du vote, le votant utilise le chiffrement symétrique [4] avec<br />
une clef secrète. Par conséquent, aucune entité ne peut savoir le contenu du bull<strong>et</strong>in de vote sauf le votant <strong>et</strong><br />
l’ACD après avoir reçu la clef secrète de déchiffrement du votant.<br />
La signature numérique est utilisée à plusieurs reprises afin de perm<strong>et</strong>tre l’authentification des différentes<br />
entités participant au vote (votant, ACL,ACD,. . .). De ce fait, aucun intrus ne peut se manifester comme étant<br />
l’une des ces entités.<br />
Ce protocole utilise également la technique de signature en aveugle pour s’assurer que le validateur (ACL)<br />
n’ait aucune information sur les bull<strong>et</strong>ins qu’il signe, <strong>et</strong> éviter le risque de collusion entre l’ACL <strong>et</strong> l’ACD<br />
<strong>et</strong> la corrélation de leurs bases de données, garantissant ainsi l’anonymat du vote. L’introduction de la notion<br />
d’accusé de réception constitue la différence principale remarquée entre le protocole de Fujioka, Okamoto <strong>et</strong><br />
Ohta <strong>et</strong> celui de Sensus. Ce dernier n’exige pas au votant d’attendre jusqu’à la fin de la phase d’envoi des<br />
bull<strong>et</strong>ins de vote pour donner sa clef de déchiffrement à l’ACD, mais il utilise l’accusé de réception pour<br />
perm<strong>et</strong>tre au votant de vérifier que son bull<strong>et</strong>in a été reçu correctement par l’ACD <strong>et</strong> d’envoyer juste après la<br />
clef de déchiffrement, ce qui termine l’opération du vote en une seule session <strong>et</strong> la rend plus rapide.<br />
50
5. Schéma du processus de vote<br />
I-Vote: Un système de vote électronique hautement sécurisé<br />
Le protocole de vote que nous avons adopté dans la section précédente constitue la plate-forme sur laquelle<br />
est bâtie l’architecture de i-vote. Nous allons — dans ce qui suit — expliquer le schéma de vote en détaillant<br />
les échanges de messages entre les différentes autorités impliquées dans les différentes phases du processus de<br />
vote.<br />
5.1. Phase d’inscription des votants<br />
C<strong>et</strong>te phase précède l’opération de vote proprement dite, <strong>et</strong> consiste en l’établissement <strong>et</strong> la publication de la<br />
liste des votants éligibles qui désirent participer à l’opération de vote organisée. Pour cela, l’autorité chargée de<br />
c<strong>et</strong>te opération doit disposer auparavant d’une liste des personnes autorisées à s’inscrire (liste de population).<br />
L’introduction de c<strong>et</strong>te phase dans notre système de vote s’est imposée à cause de deux facteurs :<br />
1. Pour renforcer la propriété de mobilité dans notre système, aucun contact au préalable n’est exigé entre<br />
le votant <strong>et</strong> l’organisme de vote (dans le cadre de l’opération d’élection). Par conséquent, c<strong>et</strong>te phase<br />
doit assurer l’authentification des votants à l’aide des informations disponibles chez le votant tel qu’un<br />
numéro d’identification <strong>et</strong> un mot de passe, ces informations peuvent être délivrés au votant dès son<br />
appartenance a l’institution qui organise le vote, par exemple, les membres d’une société peuvent les<br />
recevoir par courrier après qu’ils se joignent à la société.<br />
2. L’étape d’inscription perm<strong>et</strong> également de connaître le nombre de votants abstenant <strong>et</strong> donc de diminuer<br />
la possibilité qu’a l’autorité chargée de l’inscription d’envoyer des votes frauduleux à leur place.<br />
La difficulté principale qui s’impose lors de la mise en œuvre de c<strong>et</strong>te phase est la manière d’authentifier les<br />
personnes autorisées à s’inscrire <strong>et</strong> qui figurent dans la liste de population. Afin d’assurer ce service important,<br />
nous avons choisi d’utiliser le mécanisme d’authentification challenge-response [5] pour les raisons suivantes :<br />
– challenge-response est un mécanisme d’authentification basé sur l’utilisation d’un mécanisme de mots<br />
de passe renforcé. Les mécanismes de signatures basés sur les clefs ne pouvant pas être utilisé car ces<br />
clefs n’étant pas disponibles avant l’organisation de l’opération de vote.<br />
– challenge-response fait face aux importantes attaques qui peuvent survenir lors d’une session<br />
d’authentification, notamment l’attaque de rejeu [5], <strong>et</strong> ceci avec un nombre minimum de contraintes<br />
(de synchronisation par exemple), <strong>et</strong> un degré de complexité acceptable <strong>et</strong> possible à implémenter.<br />
Pour accomplir l’étape d’inscription, chaque votant authentifié à l’aide de son mot de passe <strong>et</strong> de son numéro<br />
d’identification génère une paire de clef privée/clef publique, <strong>et</strong> envoie la clef publique à l’autorité d’inscription<br />
pour être utilisée dans la vérification de sa signature au moment des phases ultérieures du vote.<br />
5.2. Phase de vote<br />
C<strong>et</strong>te phase comprend deux étapes essentielles :<br />
L’étape de validation du bull<strong>et</strong>in de vote qui comporte le chiffrement symétrique, le hachage, le camouflage<br />
<strong>et</strong> la signature du vote pour son envoi à l’autorité chargée de sa validation (signature en aveugle). C<strong>et</strong>te<br />
dernière r<strong>et</strong>ourne le vote validé au votant. Les messages échangés sont illustrées dans la figure 1.<br />
L’étape de collection durant c<strong>et</strong>te étape le votant commence par enlever le facteur de camouflage au bull<strong>et</strong>in<br />
validé. Ce bull<strong>et</strong>in doit être envoyé à l’autorité de collection qui doit vérifier sa validité <strong>et</strong> son intégrité<br />
avant de le déchiffrer avec la clef secrète du votant reçue via un canal sécurisé (figure 2).<br />
5.3. Phase de décompte<br />
C’est la dernière phase du processus de vote <strong>et</strong> comporte le déchiffrement du vote <strong>et</strong> son stockage avec la<br />
clef de déchiffrement correspondante dans la base de donnée consacrée à c<strong>et</strong>te fin. Dans c<strong>et</strong>te phase (figure 3),<br />
51
S. Benmeziane & L. Khelladi<br />
FIG. 1 – étape de validation<br />
FIG. 2 – étape de collection<br />
52
I-Vote: Un système de vote électronique hautement sécurisé<br />
la même autorité qui a effectué la phase de collection compte le vote en clair <strong>et</strong> rend publique après la fin de<br />
l’élection une liste contenant tous les votes chiffrés reçus, leurs clefs de déchiffrement, <strong>et</strong> les votes déchiffrées<br />
correspondants, ainsi qu’une liste qui donne le résumé de résultats en montrant le nombre de voix qui ont voté<br />
pour chaque option (alternative) de vote.<br />
6. Implémentation<br />
FIG. 3 – phase de décmopte<br />
Afin d’implémenter le schéma décrit précédemment, nous avons utilisé l’environnement de développement<br />
Java, car il offre une solution qui perm<strong>et</strong> l’intégration de programmes exécutables dans les pages Web. Ces<br />
programmes appelés appl<strong>et</strong>s sont utilisés dans notre système pour assurer l’inscription des votants, l’envoi des<br />
bull<strong>et</strong>ins <strong>et</strong> la consultation des résultats, <strong>et</strong> peuvent s’exécuter sans comprom<strong>et</strong>tre la sécurité des système client<br />
[9]. De plus les appl<strong>et</strong>s peuvent communiquer avec des serveurs <strong>et</strong> exécuter des appels de procédures a distance<br />
(RPC) dans le contexte d’un mécanisme puissant purement Java appelé RMI(Remote M<strong>et</strong>hode Invocation) [9].<br />
Un autre facteur important qui argumente le choix de l’environnement Java est que ce langage inclut<br />
des librairies perm<strong>et</strong>tant la réalisation de toutes les fonctions cryptographiques de base nécessaires pour<br />
l’implémentation des deux protocoles d’inscription <strong>et</strong> de vote.<br />
En eff<strong>et</strong>, le paqu<strong>et</strong>age java.security disponible dans le JDK SUN perm<strong>et</strong> une multitude d’opérations<br />
dans ce domaine. Il contient des classes pour les algorithmes de signature numérique, tel que DSA, la génération<br />
des paires de clef publique/clef privée, les algorithmes de hachage comme MD5 <strong>et</strong> un ensemble d’abstractions<br />
pour gérer les entités, leurs clefs <strong>et</strong> leurs certificats.<br />
Nous avons également utilisé l’API logi.crypto [12] qui contient un ensemble de classes perm<strong>et</strong>tant<br />
des différentes fonctionnalités, entre autre l’utilisation simple <strong>et</strong> directe du mécanisme de signature en aveugle.<br />
6.1. Les modules de système de vote<br />
Pour mener une opération de vote, i-vote utilise quatre modules représentant respectivement le votant,<br />
l’ACL, l’ACD, en plus du module qui représente l’organisateur de l’élection <strong>et</strong> qui est chargé d’automatiser la<br />
phase d’inscription <strong>et</strong> la construction dynamique du bull<strong>et</strong>in de vote.<br />
53
S. Benmeziane & L. Khelladi<br />
6.1.1. Le module Organisateur<br />
Le module Organisateur est invoqué par l’administrateur de l’opération de vote. Ce dernier doit introduire<br />
un mot de passe afin de pouvoir l’exécuter.<br />
En plus de la phase d’inscription des votants, le module Organisateur est responsable des préparations<br />
nécessaires au vote. Son rôle se résume essentiellement en :<br />
– la construction du bull<strong>et</strong>in de vote : en utilisant HMTL comme langage de construction, l’administrateur<br />
du vote définit le modèle du bull<strong>et</strong>in de vote qui sera employé durant l’élection. Ce modèle dépend des<br />
spécificités que présente chaque opération de vote tel que son genre (élection, referendum, . . .), le nombre<br />
de choix suggéré pour le vote, <strong>et</strong>c.<br />
– le module Organisateur est également utilisé pour préparer la liste de population, déclencher <strong>et</strong> arrêter les<br />
différentes phases de l’élection organisée.<br />
6.1.2. Le module ACL<br />
Le module ACL est chargé de l’accomplissement de la phase de validation tout en garantissant qu’un seul<br />
bull<strong>et</strong>in sera validé pour chaque votant enregistré.<br />
6.1.3. Le module ACD<br />
Le module ACD est responsable de l’étape de collection des bull<strong>et</strong>ins de vote <strong>et</strong> le décompte des résultats<br />
ainsi que leur publication.<br />
6.1.4. Le module Votant<br />
Ce module fonctionne comme étant un agent du votant. Il doit pouvoir :<br />
– Présenter un bull<strong>et</strong>in de vote lisible au votant (utilisation d’une interface graphique ou textuelle).<br />
– Prendre en charge les votes des électeurs.<br />
– Exécuter toutes les opérations cryptographiques qui doivent être effectuées par le votant.<br />
– Obtenir <strong>et</strong> recevoir les validations nécessaires <strong>et</strong> les accusés de réception.<br />
– Délivrer le bull<strong>et</strong>in de vote aux différentes autorités (ACL, ACD).<br />
– Vérifier les résultats du scrutin <strong>et</strong> éventuellement protester en cas d’erreur.<br />
7. Évaluation <strong>et</strong> Conclusion<br />
Dans c<strong>et</strong> article, nous avons présenté i-vote : un prototype de système de vote électronique sécurisé. Ce<br />
prototype encapsule un protocole de vote basé sur celui de Sensus. Tout au long de la conception <strong>et</strong> la mise en<br />
oeuvre du système, nous avons tenu à assurer les propriétés essentielles d’un bon système de vote électronique.<br />
Dans ce qui suit, nous pouvons évaluer notre système relativement à chaque propriété <strong>et</strong> <strong>propos</strong>er les extensions<br />
possibles :<br />
Précision : Notre système de vote satisfait bien c<strong>et</strong>te propriété. En eff<strong>et</strong>, tout comportement de type<br />
modification, suppression ou ajout de votes est détectable en examinant la liste publiée par l’ACD à<br />
la fin des élections.<br />
Démocratie : C<strong>et</strong>te propriété est complètement satisfaite si tous les électeurs inscrits soum<strong>et</strong>tent leurs votes.<br />
Cependant, si les votants s’abstenant ne le font pas, il devient possible pour l’ACL de valider <strong>et</strong> soum<strong>et</strong>tre<br />
des bull<strong>et</strong>ins à leur place. L’introduction d’une autre autorité chargée de la vérification de la signature<br />
des votants pour toutes les demandes de validation peut résoudre ce genre de problème, mais le compte<br />
final ne peut être corrigé.<br />
54
I-Vote: Un système de vote électronique hautement sécurisé<br />
Confidentialité : En utilisant la technique de signature en aveugle, nous garantissons la propriété d’anonymat<br />
mais pas de manière complète. En eff<strong>et</strong>, il faut assurer qu’un vote ne peut pas être lié à un votant<br />
particulier en traçant les paqu<strong>et</strong>s dans lesquels les messages sont transmis du votant à l’ACD, en plus,<br />
il faut garantir que les messages d’électeurs n’arriveront pas à l’ACL <strong>et</strong> l’ACD dans le même ordre des<br />
votants, sinon cela perm<strong>et</strong>tra aux deux autorités — après collusion — de pouvoir lier entre les électeurs <strong>et</strong><br />
leurs votes. Pour atteindre l’anonymat compl<strong>et</strong>, nous <strong>propos</strong>ons l’utilisation des serveurs mixtes conçus<br />
par David Chaum [7]. Cependant, la prévention contre l’achat du vote n’est pas garantie.<br />
Vérifiabilité : La propriété de vérifiabilité est également satisfaite. En eff<strong>et</strong>, chaque électeur peut facilement,<br />
grâce à liste publiée par l’ACD, vérifier que son vote correspondant au numéro NUM_BULT qu’il a<br />
reçu dans la phase de vote a été compté correctement (vérifiabilité individuelle). La liste publiée par<br />
l’ACD contient également la clef de déchiffrement relative à chaque bull<strong>et</strong>in, cela perm<strong>et</strong> à toute partie<br />
indépendante de vérifier la validité du résultat global de l’opération de vote, <strong>et</strong> de corriger les erreurs<br />
éventuelles, sans sacrifier la confidentialité des votes (vérifiabilité universelle).<br />
En plus des propriétés discutées auparavant, i-vote garantit d’autres propriétés liées à son implémentation :<br />
Commodité : i-vote perm<strong>et</strong> aux électeurs d’envoyer leurs votes rapidement, en une seule session <strong>et</strong> avec le<br />
minimum d’équipement ou de compétences spéciales.<br />
Flexibilité : notre système perm<strong>et</strong> également une variété de formats de bull<strong>et</strong>ins de vote ce qui donne la<br />
possibilité d’organiser plusieurs types de vote.<br />
Mobilité : i-vote peut être utilisé de n’importe quel ordinateur connecté au réseau (Intern<strong>et</strong>/intran<strong>et</strong>), <strong>et</strong> ses<br />
serveurs (autorités de vote) peuvent être lancés sur n’importe quelle plate-forme.<br />
Références<br />
[1] A. Riera-Jorba. An introduction to electronic voting schemes. Rapport interne PIRDI n.9-98, U.A.B.<br />
Computer Science Department, septembre 1998.<br />
[2] A. Riera-Jorba. Design of Implementable Solutions for Large Scale Electronic Voting Schemes. PhD<br />
Thesis, Universitat Autònoma de Barcelona, décembre 1999.<br />
[3] A.D. Rubin. Security considerations for remote electronic voting over the Intern<strong>et</strong>. 29th Research<br />
Conference on Communication, Information and Intern<strong>et</strong> Policy (TPRC 2001), octobre 2001. http:<br />
//www.arxiv.org/abs/cs.CY/0108017.<br />
[4] B. Schneier. Cryptographie appliquée. International Thomson Publishing Company, Paris 1997.<br />
[5] S. Benmeziane. Mécanismes d’authentification. Rapport interne, CERIST, 2001.<br />
[6] C. Bidan <strong>et</strong> V. Issarny. Un aperçu des problèmes de sécurité dans les systèmes informatiques. IRISA,<br />
publication interne no. 959, octobre 1995.<br />
[7] D. Chaum. Untraceable electronic mail, r<strong>et</strong>urn addresses and digital pseudonyms. Communications of the<br />
ACM, vol. 24, no. 2, pages 84–88, 1981.<br />
[8] L.F.Cranor <strong>et</strong> R.K. Cytron. Sensus : A security conscious electronic polling system for the Intern<strong>et</strong>.<br />
Proceedings of the Hawaii International Conference on System Sciences, janvier 1997, Wailea, Hawaii,<br />
USA.<br />
[9] L. Khelladi <strong>et</strong> K. Bouguessa. Conception <strong>et</strong> réalisation d’un système de vote électronique en Java.<br />
Mémoire de fin d’étude, novembre 2001.<br />
[10] M.A. Herschberg. Secure Electronic Voting Over the World Wide Web. Master’s thesis, Massachus<strong>et</strong>ts<br />
Institute of Technology, mai 1997.<br />
[11] M.J. Radwin. An untraceable, universally verifiable voting scheme. Seminar in Cryptology, December 12,<br />
1995. http://www.radwin.org/michael/projects/voting.pdf.<br />
[12] The logi.crypto Java Package, version 1.1.1. http://www.logi.org/logi.crypto/<br />
index.html.<br />
55
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
56
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
Combining ISABELLE and Timbuk for<br />
Cryptographic Protocol Verification<br />
Abstract<br />
Frédéric OEHL & David SINCLAIR<br />
School of Computer Applications<br />
Dublin City University<br />
Dublin 9<br />
Ireland<br />
{foehl,dsinclai}@computing.dcu.ie<br />
In this paper, the approaches of Paulson and of Gen<strong>et</strong> and Klay to verify cryptographic protocols are<br />
summarized. Then the paper explains why and how these two techniques can be combined. By combining<br />
these m<strong>et</strong>hods, the strengths of each m<strong>et</strong>hod can be exploited. Thus the verification of the properties of a<br />
cryptographic protocol, and in particular for the secrecy and authentication properties, are simplified. To<br />
illustrate the idea, the Needham-Schroeder protocol is verified using this combining approach.<br />
1. Introduction<br />
Cryptographic protocols are used to establish secure communication b<strong>et</strong>ween two or more agents over an<br />
insecure n<strong>et</strong>work. Among the many properties of the protocol that need to be established and guaranteed<br />
are secrecy and authentication. Secrecy guarantees that an information is kept secr<strong>et</strong> during protocol runs.<br />
Authentication guarantees that an agent in the n<strong>et</strong>work can identify the sender of a message. In the past<br />
several protocols have been used for many years before these properties have been found to be invalid. After<br />
the discovery of these security flaws, techniques have been developed for the verification of cryptographic<br />
protocols. The formal m<strong>et</strong>hods (c.f. [19] and [20]) are for example one of those techniques. In [1], [8], [2], [3],<br />
[11], [12], [13] and [9] d<strong>et</strong>ailed description of formal approaches can be found.<br />
In [3], L. C. Paulson presents a m<strong>et</strong>hod based on the proof by induction. In his technique, a protocol<br />
is modeled by the s<strong>et</strong> of all possible traces where a trace is the list of all the messages exchanged during a<br />
protocol run. In addition an intruder or bad agent is assumed to be in the n<strong>et</strong>work. This intruder, based on<br />
the Dolev and Yao model [7], has access to all the traces and can decrypt messages if he has captured the<br />
appropriate decryption keys. In addition he can build and send fraudulent messages if he has the appropriate<br />
encryption keys. The properties that the protocol must satisfy are proved by induction on all possible traces that<br />
the protocol can generate. That means that after each protocol’s step we verify if the properties are satisfied.<br />
This m<strong>et</strong>hod was implemented in Isabelle 1 theorem prover and used to verify the Needham-Schroeder [3],<br />
Kerberos [5], [6], TLS [4] and some other protocols. The proofs of these protocols are available on the Isabelle’s<br />
website 2 .<br />
In [12], T. Gen<strong>et</strong> and F. Klay present a m<strong>et</strong>hod for the analysis of cryptographic protocols based on tree<br />
automata, term rewriting systems (TRS) and an approximation technique. A tree automaton is used to model<br />
the n<strong>et</strong>works and a term rewriting system is used to formalize the protocol’s steps. Similar to the inductive<br />
approach, there is an intruder in the n<strong>et</strong>work (this intruder has the same abilities as the intruder in the Paulson’s<br />
m<strong>et</strong>hod). To verify the secrecy or authentication property, first a supers<strong>et</strong> of all the possible configurations<br />
1 http://isabelle.in.tum.de/index.html<br />
2 http://www.cl.cam.ac.uk/Research/HVG/Isabelle/library/HOL/Auth/<br />
57
F. Oehl & D. Sinclair<br />
of the n<strong>et</strong>work is computed from the n<strong>et</strong>work’s initial configuration (all the agents in the n<strong>et</strong>works want to<br />
communicate with each other) with the term rewriting system and an extended version of the approximation<br />
technique introduced in [17]. Then an automaton, that models the negation of the property that must be verified,<br />
is built. Finally, the intersection of these automata is checked. If the intersection is empty, the protocol is safe<br />
otherwise the protocol could be insecure. This m<strong>et</strong>hod has been used to verify the Needham-Schroeder [12].<br />
A library for OCAML 3 ([22] and [23]), Timbuk 4 , has been developed to support the tree automata and the<br />
approximation technique.<br />
In [10] we present a m<strong>et</strong>hod which combines these two approaches. In this paper, we present a case study<br />
that use this combined approach on the good version of the Needham-Schroeder protocol.<br />
2. Combining Isabelle and Timbuk<br />
In this section we summarize our intuition for combining the inductive approach [3] and the approach based on<br />
tree automata and approximation [12]. First, we will see why we want to combine these approaches and then<br />
how we can combine them.<br />
2.1. Why Combine these Two Approaches?<br />
Our idea is to combine model-checking and theorem proving for the verification of cryptographic protocols. In<br />
this sense, combining these approaches seems to be a nice starting point.<br />
Both approaches work on the protocol’s traces and have the same model of intruder. Moreover they seem<br />
to be complementary. The inductive approach can verify several properties (secrecy, authenticity, freshness,...).<br />
But in this approach the secrecy and authenticity properties/theorems are very difficult to prove 5 . The proofs<br />
require an experienced user to inject the right lemma at the right time to make the proofs converge. This is not<br />
the case of the remaining properties, the proofs of those properties are slightly the same for all protocols.<br />
On the other hand, with the approximation technique, a quick and semi-automatic (we only enter the TRS,<br />
the approximation function, the initial automaton) verification of the secrecy and authentication properties can<br />
be done. But with this m<strong>et</strong>hod, if the properties are not satisfied, another technique like the inductive approach<br />
must be used to find a possible flaw. Another weakness of the approximation technique is that it can’t be used<br />
to prove the remaining properties (freshness, regularity, ...), because there is no distinction b<strong>et</strong>ween two pieces<br />
of information created in two distinct runs of a protocol.<br />
By combining these two approaches, it should be possible to build easily a compl<strong>et</strong>e proof of the protocol’s<br />
properties with a basic knowledge of both techniques.<br />
2.2. How to Combine?<br />
Our idea is to combine the approximation approach and the inductive approach to exploit the strengths of each<br />
m<strong>et</strong>hod. So:<br />
1. We use the approximation technique to verify the secrecy and authentication properties.<br />
2. If these properties are satisfied, we used these results as axioms in the inductive m<strong>et</strong>hod. Otherwise we<br />
use the inductive approach to prove the existence or the absence of a flaw.<br />
3. We use the inductive approach to prove the remaining properties.<br />
3 http://caml.inria.fr/ocaml/index.html<br />
4 http://www.irisa.fr/lande/gen<strong>et</strong>/timbuk/index.html<br />
5 to see what is involved look the proofs of the Needham-Schroeder protocol:<br />
http://www.cl.cam.ac.uk/Research/HVG/Isabelle/library/HOL/Auth/<br />
58
Combining ISABELLE and Timbuk<br />
With Timbuk, it is also possible to find inconsistency in protocol’s steps. For example, in the Woo and Lam<br />
protocol [21] the second step is "Bob sends a Nonce to Alice" and the third is "Alice encrypts and sends her<br />
name, Bob name and his Nonce" but she can’t link Bob to the Nonce. She only received a Nonce, so how could<br />
she link this nonce to Bob? Timbuk helps us to find this kind flaw.<br />
2.3. The Prototype<br />
We have developed a prototype that generates the input file for Timbuk from the specification file for Isabelle.<br />
This prototype is implemented in OCAML.<br />
To summarize the behavior of this prototype, it extracts the protocol’s steps from the Isabelle specification<br />
and then it uses a lexical analysis and a syntax analysis to build an abstract model of the protocol. Then it uses<br />
rewriting techniques to build the TRS and the initial automaton. The prototype also generates the approximation<br />
function used by Timbuk to compute the approximation automaton:<br />
� Like<br />
in [12], untrustable agents are amalgamated, so three types remain: Alice, Bob and the "Rest";<br />
Messages sent and received by the "Rest" are collapsed tog<strong>et</strong>her, so only the messages exchanged<br />
b<strong>et</strong>ween Alice, Bob and the "Rest" are studied.<br />
normalization process is a bit different of the one in [12]: "new state is introduced to normalize a<br />
term if this last hasn’t been normalized before".<br />
The<br />
The annex A (c.f. section A) shows the input file for the good version of the Needham Schroeder protocol.<br />
This the protocol will be used in this paper to illustrate the combination idea. The formalisms, used in this<br />
�<br />
paper, are the same as those used in [3] and [12].<br />
3. Needham-Schroeder Protocol<br />
In this version, two agents , Alice and Bob, want to establish a secure communication using a public keys<br />
infrastructure (c.f. Figure 1).<br />
Message 1: A���<br />
Message 2: B���<br />
Alice initiates a protocol run, sending a nonce Na and her name A<br />
to Bob.<br />
B :�������©�������<br />
Bob responds to Alice’s message with a further nonce Nb.<br />
A :��������������������<br />
Alice proves her existence by sending Nb back to Bob.<br />
Message 3: B<br />
Figure 1: Good version of the Needham-Schroeder protocol<br />
:�����������<br />
A���<br />
To verify the protocol the first step is to write the Isabelle specification. In this specification, each protocol<br />
step is composed of two parts:<br />
� the<br />
� the<br />
conditions to execute the step: creation of a new nonce (i.e. Nonce NAB���used evs1: the creation<br />
by A of a nonce not used previously to communicate with B), presence of a particular message in the s<strong>et</strong><br />
of all previous steps (i.e. Says A : s<strong>et</strong> evs)<br />
B�������������<br />
step itself (adding a message to the trace)<br />
59
F. Oehl & D. Sinclair<br />
Theory NS_Public = Public:<br />
(*Alice initiates a protocol run, sending a fresh nonce to Bob*)<br />
�����<br />
NS1: "�evs1 : ns_public; NAB� Nonce : used<br />
Says A B���Crypt (pubK B)���Nonce NAB, Agent A����� evs1�����<br />
evs1 : ns_public"<br />
#<br />
(*Bob responds to Alice’s message with a further fresh nonce*)<br />
NS2: "�evs2 : NBA� ns_public; Nonce : used evs2;<br />
Says A’ B���Crypt (pubK B)���Nonce NAB, Agent : evs2��� s<strong>et</strong><br />
Says B A���Crypt (pubK A)���Nonce NAB, Nonce NBA, Agent # evs2 : ns_public"<br />
B����� A�����<br />
(*Alice proves her existence by sending NBA back to Bob.*)<br />
NS3: "�evs3 : ns_public;<br />
Says A B���Crypt (pubK B)���Nonce NAB, Agent : s<strong>et</strong> evs3;<br />
Says B’ A���Crypt (pubK A)���Nonce NAB, Nonce NBA, Agent B�����:<br />
s<strong>et</strong> Says A B���Crypt (pubK B)���Nonce # evs3 : ns_public"<br />
end<br />
A�����<br />
NBA����� evs3�����<br />
Figure 2: Inductive specification of the Needham-Schroeder protocol<br />
Figure 2 shows the protocol specification using Isabelle syntax. Then the prototype is used to generate the<br />
Timbuk input file (c.f. section A). When this file is created, the Timbuk library is used to compute the<br />
approximated automaton.<br />
When the computation of the approximated automaton is over, the secrecy and the authentication properties<br />
can be verified.<br />
3.1. The Secrecy Property<br />
The secrecy property, that must be guaranteed by the protocol, is: "The intruder can never access the nonces<br />
created by Alice (to communicate with Bob) or Bob (to communicate with Alice)".<br />
To verify this property with the approximation technique, first an automaton of the negation of this property<br />
must be built with Timbuk. This automaton is identical to the one in [12]. Figure 3 models this automaton. In<br />
this figure:<br />
models Bob models the agent� ;<br />
and�������©��� Alice,�<br />
models<br />
models<br />
���<br />
������������� ���<br />
�£� ����������������� models<br />
the nonce created (Alice) by���<br />
to communicate with��� (Bob);<br />
the union of two final states,����� and�����.This rule is used build the automaton.<br />
-� -� -� -� -� -� -� -� -�<br />
Automaton Not_Secr<strong>et</strong><br />
States q1 q2 q4 q5 q13<br />
Final States<br />
Transitions<br />
q13<br />
A q1 agt(q1) q4<br />
B q2<br />
U(q13, q13) q13<br />
agt(q2) q5<br />
N(q4, q5) q13 N(q5, q4) q13<br />
N(q4, q4) q13 N(q5, q5) q13<br />
Figure 3: The intruder has access to the nonces b<strong>et</strong>ween Alice and Bob<br />
60
Combining ISABELLE and Timbuk<br />
Then the intersection of this automaton with the one corresponding at the approximation of the possible<br />
n<strong>et</strong>work configurations can be checked (still with Timbuk). For this example the intersection is empty, so the<br />
protocol satisfies the property.<br />
3.2. The Authentication Property<br />
The authentication property is: "If Alice thinks that she communicates with Bob then she really speaks with<br />
Bob. And if Bob thinks that he communicates with Alice then he really talks with Alice".<br />
As with for the secrecy property, an automaton of the negation of the authentication property is built<br />
[12], then the intersection with the approximation is checked. For this version of the Needham-Schroeder,<br />
the intersection is empty so the property is satisfied by the protocol.<br />
3.3. How Approximation Results are Used?<br />
The secrecy and the authentication properties are satisfied by the protocol. These results can be used in our<br />
inductive proof.<br />
In the inductive proof for this protocol 6 , the theorems corresponding to those properties are:<br />
� for<br />
the secrecy:<br />
– Spy_not_see_NA: the Spy does not see the nonce sent in the message NS1 if Alice and Bob are<br />
secure;<br />
– Spy_not_see_NB: the Spy does not see the nonce sent in the message NS2 if Alice and Bob are<br />
secure.<br />
With the automata technique, we proved that the intruder never catches the nonces exchanged b<strong>et</strong>ween<br />
Alice and Bob. If the intruder can’t see the nonces of Alice and Bob then he doesn’t see the one sent in NS1<br />
and the one sent in NS2. So the two theorems above are true.<br />
� for<br />
the authentication:<br />
– A_trusts_NS2: if Alice receives message NS2 and has used NA to start a run, then Bob has sent<br />
message NS2;<br />
– B_trusts_NS3: if Bob receives message NS3 and has used NB in NS2, then Alice has sent message<br />
NS2.<br />
With the Gen<strong>et</strong> and Klay approach, we checked that when Alice wants to establish a communication with<br />
Bob, after NS2 she really speaks with him. We also verified that when Bob thinks that he is responding to Alice,<br />
he really speaks with Alice after NS3. So the theorems "A_trusts_NS2" and "B_trusts_NS3" are also true.<br />
As all the theorems above are true, they can be added at the end of the Isabelle specification as axioms (c.f.<br />
Figure 4). The inductive proof of the other properties [3] can be compl<strong>et</strong>ed as usual.<br />
4. Conclusion<br />
The Needham-Schroeder protocol used in this paper gives a good idea of how the strengths of each m<strong>et</strong>hod are<br />
exploited. In the correct version of the protocol, the secrecy and the authentication properties are easily proved<br />
(checking the intersection of two automata) with the approximation technique. Then this result is used as axiom<br />
6 http://www.cl.cam.ac.uk/Research/HVG/Isabelle/library/HOL/Auth/<br />
61
F. Oehl & D. Sinclair<br />
Theory NS_Public = Public:<br />
axioms<br />
(*If A and B aren’t untrustable agents then the intruder cannot g<strong>et</strong> the nonce NAB*)<br />
�����<br />
Spy_not_see_NAB "���Says A B���Crypt(pubK B)���Nonce NAB, Agent : s<strong>et</strong> evs; : bad;<br />
: bad; evs : ns_public������ Nonce NAB� : analz (spies evs)"<br />
B� A� A�����<br />
(*If A and B aren’t untrustable agents then the intruder cannot g<strong>et</strong> the nonce NBA*)<br />
Spy_not_see_NBA "���Says B A���Crypt (pubK A)���Nonce NAB, Nonce NBA, Agent : s<strong>et</strong> evs;<br />
: bad; : bad; evs : ns_public������ Nonce NBA� : analz (spies evs)"<br />
B� A� B�����<br />
(*If A receives the message NS2 then B sent this message*)<br />
A_trusts_NS2 "���Says A B���Crypt(pubK B)���Nonce NAB, Agent : s<strong>et</strong> evs;<br />
Says B’ A���Crypt(pubK A)���Nonce NAB, Nonce NBA, Agent : s<strong>et</strong> evs;<br />
: bad; : bad; evs :<br />
A�����<br />
Says B A���Crypt(pubK A)���Nonce NAB, Nonce NBA, Agent : s<strong>et</strong> evs"<br />
B����� ns_public������<br />
B� B����� A�<br />
(*If B receives the message NS3 then A sent this message*)<br />
B_trusts_NS3 "���Says B A���Crypt (pubK A)���Nonce NAB, Nonce NBA, Agent : s<strong>et</strong> evs;<br />
Says A’ B���Crypt (pubK B)���Nonce : s<strong>et</strong> evs;<br />
: bad; : bad; evs :<br />
B�����<br />
Says A B���Crypt (pubK B)���Nonce : s<strong>et</strong> evs"<br />
NBA����� ns_public������<br />
end<br />
B� NBA����� A�<br />
Figure 4: New inductive specification of the Needham-Schroeder protocol<br />
in the inductive proof and it simplifies the proof (on a 733Mhz Pentium III computer with 128Mb of memory,<br />
it takes 2 minutes to compute the approximation and few more minutes to check the intersections with Timbuk)<br />
. In the flawed version, that was not tackled for space reasons, the approximation technique is inefficient (the<br />
automaton intersections are not empty). But in few minutes (6 for the computation of the approximation plus<br />
some others to check the intersections), we know that the protocol might be flawed. So the inductive proof<br />
must be done as usual except that we have information on the context of the possible secrecy/authentication<br />
flaw. These information can be helpful to prove the existence or not of a flaw for the non-experienced users<br />
of Isabelle. In summary, the information learnt from the approximation technique can simplify the inductive<br />
proof (axioms or consciousness of the possible existence of a flaw). In the case, where the properties are not<br />
guaranteed the inductive m<strong>et</strong>hod will find the flaw.<br />
As already said in the introduction several m<strong>et</strong>hods are available for the verification of cryptographic<br />
protocols [1], [8], [2], [3], [11], [12], [13], [9].<br />
All these techniques have been used to check protocols listed by Clark and Jacob [21] or in [1] to be<br />
validated. But at the moment few of them have been successfully used to verify an entire real protocol (SET<br />
[14], TLS [15], ...). Our concept, combining two m<strong>et</strong>hods to exploit their strengths, and our prototype have been<br />
also used to verify the Needham-Schroeder protocol (public key without server, shared key with server), the<br />
Woo Lam protocol and the simplified version of Otway-Rees. Our next step will be to improve our prototype<br />
(at the moment some approximation rules, that are easily d<strong>et</strong>ectable, have to be added by hand). Then see if<br />
with our concept we can have b<strong>et</strong>ter results on real protocols than the other m<strong>et</strong>hods.<br />
References<br />
[1] M. Burrows and M. Abadi and R. Needham, A Logic of Authentication,DIGITAL, Systems Research<br />
Center, N 39, February 1989<br />
62
Combining ISABELLE and Timbuk<br />
[2] M. Abadi and A. D. Gordon, A calculus for Cryptographic Protocols: The Spi calculus, DIGITAL,<br />
Systems Research Center, N 149, January 1998<br />
[3] L. C. Paulson, The Inductive Approach to Verifying Cryptographic Protocols, Journal of Computer<br />
Security, Volume 6, pages 85–128, 1998,http://www.cl.cam.ac.uk/users/lcp/papers/protocols.html<br />
[4] L. C. Paulson, Inductive analysis of the Intern<strong>et</strong> protocol TLS, ACM Transactions on Information and<br />
System Security, Volume 2, Number 3, pages 332–351,1999<br />
[5] G. Bella and L. C. Paulson, Using Isabelle to prove properties of the Kerberos authentication system, In<br />
H. Orman and C. Meadows, editors, Workshop on Design and Formal Verification of Security Protocols.<br />
DIMACS, 1997<br />
[6] G. Bella and L. C. Paulson, Kerberos Version IV: Inductive Analysis of the Secrecy Goals, Proceedings of<br />
the 5th European Symposium on Research in Computer Security, Springer-Verlag LNCS 1485, Louvainla-Neuve,<br />
Belgium, J.-J. Quisquater, pages 361–375,1998<br />
[7] D. Dolev and A. Yao, On the security of public-key protocols, IEEE Transactions on Information Theory,<br />
2(29), 1983<br />
[8] Cathrine Meadows. The NRL protocol analyser: An overview. Journal of Logic Programming, 26(2):113–<br />
131, February 1996<br />
[9] Florent Jacquemard and Michael Rusinowitch and Laurent Vigneron. Compiling and Verifying Security<br />
Protocols. Logic Programming and Automated Reasoning, pages 131-160, 2000<br />
[10] F. Oehl and D. Sinclair, Combining two approaches for the verification of cryptographic protocols,<br />
Workshop Specification, Analysis and Validation for Emerging Technologies in Computational Logic<br />
(SAVE 2001), 2001<br />
[11] David Monniaux, Abstracting Cryptographic Protocols with Tree Automata, Static Analysis Symposium,<br />
Springer-Verlag, Lecture Notes in Computer Science, pages 149-163, 1999<br />
[12] Thomas Gen<strong>et</strong> and Francis Klay, Rewriting for Cryptographic Protocol Verification, CADE: International<br />
Conference on Automated Deduction, 2000, http://citeseer.nj.nec.com/gen<strong>et</strong>99rewriting.html<br />
[13] Jean Goubault-Larrecq, A m<strong>et</strong>hod for automatic cryptographic protocol verification (extended abstract),<br />
Proc. Workshop on Formal M<strong>et</strong>hods in Parallel Programming, Theory and Applications (FMPPTA’2000),<br />
Springer-Verlag, pages 977-984, Number 1800, Lecture Notes in Computer Science, 2000<br />
SET��� [14] SET Working Group, Specification, books 1,2 and 3, SETCO, 1996,<br />
http://www.s<strong>et</strong>co.org/s<strong>et</strong>_specifications.html<br />
[15] TLS Working Group, The TLS Protocol Version 1.0, The Intern<strong>et</strong> Engineering Task Force, 1996,<br />
http://www.i<strong>et</strong>f.org/html.charters/tls-charter.html<br />
[16] D. Otway and O. Rees. Efficient and timely mutual authentication. Operating Systems Review, 21(1):8–<br />
10, 1987<br />
[17] Thomas Gen<strong>et</strong>, Decidable Approximations of S<strong>et</strong>s of Descendants and S<strong>et</strong>s of Normal Forms, RTA, pages<br />
151-165,1998<br />
[18] T.Gen<strong>et</strong> and V. Vi<strong>et</strong> Triem Tong, Reachability Analisys of Term Rewriting Systems with Timbuk, 8th<br />
International Conference on Logic for Programming, Artificial Intelligence and Reasoning (LPAR 2001),<br />
2001<br />
63
F. Oehl & D. Sinclair<br />
[19] S. Gritzalis, D. Spinellis, and P. Georgiadis. Security Protocols over open n<strong>et</strong>works and distributed<br />
systems: Formal m<strong>et</strong>hods for their analysis, design, and verification. Computer Communications, 22(8):<br />
695-707, May 1999.<br />
[20] B Aziz, D. Gray, G.Hamilton, F. Oehl, J. Power, and D. Sinclair, Implementing Protocol Verification<br />
for E-Commerce, Proceedings of the 2001 International Conference on Advances in Infrastructure for<br />
Electronic Business, Science, and Education on the Intern<strong>et</strong> (SSGRR 2001), L’Aquila, Italy, 6-12 August<br />
2001<br />
[21] J. Clark and J. Jacob. A Survey of Authentication Protocol Literature: Version 1.0. 1997.<br />
http://citeseer.nj.nec.com/clark97survey.html<br />
[22] Didier Rémy and Jérôme Vouillon, Objective ML: An effective object-oriented extension to ML. In<br />
Theory And Practice of Objects Systems, 4(1):27–50, 1998.<br />
[23] Xavier Leroy, Damien Doligez, Jacques Garrigue, Didier Rémy and Jérôme Vouillon, The Objective Caml<br />
system release 3.02, Documentation and user’s manual, 2001<br />
A. Timbuk input file for the Needham-Schroeder protocol<br />
(* Alphab<strong>et</strong> *)<br />
Ops mesg:3 encr:3 N:2 cons:2 A:0 B:0 S:0 o:0 suc:1 agt:1 serv:1 U:2 sharekey:2 pubkey:1 c_init:3 c_resp:3 add:1 goal:2 LHS:0 hash1:2 hash2:3 null:0<br />
(* Variables *)<br />
Vars x x1 y z u s a b a_18 a_17 a_16 a_15 a_14 a_13 a_12 a_11 a_10 a_9 a_8 a_7 a_6 a_5 a_4 a_3 a_2 a_1 a_0 b_18 b_17 b_16 b_15 b_14 b_13 b_12 b_11<br />
b_10 b_9 b_8 b_7 b_6 b_5 b_4 b_3 b_2 b_1 b_0<br />
TRS R<br />
(* Protocol steps *)<br />
goal(agt(a), agt(b)) U(LHS, -�<br />
(* Term Rewriting System *)<br />
mesg(agt(a), agt(b), encr(pubkey(agt(b)), agt(a), cons(N(agt(a), agt(b)), agt(a)))))<br />
mesg(a_4, agt(b), encr(pubkey(agt(b)), a_3, cons(N(a_1, b_1), agt(a)))) U(LHS,<br />
b_1), cons(N(agt(b), agt(a)), agt(b))))))<br />
-�<br />
mesg(a_6, agt(a), encr(pubkey(agt(a)), a_5, cons(N(agt(a), agt(b)), cons(N(a_2, b_2), agt(b))))) U(LHS,<br />
agt(a), N(a_2, b_2))))<br />
-�<br />
mesg(a_6, agt(a), encr(pubkey(agt(a)), a_5, cons(N(agt(a), agt(b)), cons(N(a_2, b_2), agt(b))))) U(LHS, -�<br />
mesg(a_8, agt(b), encr(pubkey(agt(b)), a_7, N(agt(b), agt(a)))) U(LHS, -�<br />
(* Intruder abilities *)<br />
U(cons(x, y), z) U(LHS, -�<br />
U(cons(x, y), z) U(LHS, -�<br />
add(x))<br />
add(y))<br />
U(encr(pubkey(agt(o)), y, z), u) U(LHS, -�<br />
U(encr(pubkey(agt(suc(x))), y, z), u) U(LHS, -�<br />
U(mesg(x, y, z), u) U(LHS, -�<br />
add(x) x -�<br />
U(x, U(y, z)) U(U(x, -�<br />
U(U(x, y), z) U(x, -�<br />
U(x, y) U(y, -�<br />
x)<br />
add(z))<br />
y), z)<br />
U(y, z))<br />
add(z))<br />
add(z))<br />
mesg(agt(b), agt(a), encr(pubkey(agt(a)), agt(b), cons(N(a_1,<br />
c_resp(agt(b), agt(a), a_7))<br />
(* Initial Automaton *)<br />
64<br />
mesg(agt(a), agt(b), encr(pubkey(agt(b)),<br />
c_init(agt(a), agt(b), a_5))
Automaton automat<br />
States q0 q1 q2 q3 q4 q5 q13<br />
Final States q13<br />
Prior null q13 -�<br />
-� -� -� -� -� -� -� -�<br />
-� -� -� -� -� -�<br />
-� -� -� -� -� -�<br />
-� -� -� -� -� -� -� -� -�<br />
Transitions<br />
o q0 suc(q0) q0 agt(q0) q3<br />
A q1 agt(q1) q4<br />
B q2<br />
U(q13, q13) q13<br />
agt(q2) q5<br />
goal(q4, q5) q13 goal(q5, q4) q13 goal(q4, q4) q13<br />
goal(q5, q5) q13 goal(q3, q3) q13 goal(q4, q3) q13<br />
goal(q3, q4) q13 goal(q5, q3) q13 goal(q3, q5) q13<br />
agt(q0) q13 agt(q1) q13 agt(q2) q13<br />
mesg(q13, q13, q13) q13 cons(q13, q13) q13 encr(q13, q3, q13) q13<br />
pubkey(q3) q13 pubkey(q4) q13 pubkey(q5) q13<br />
N(q3, q3) q13 N(q3, q4) q13 N(q3, q5) q13<br />
(* Approximation Function *)<br />
Approximation R1<br />
States q[0–90]<br />
Rules<br />
(* Approximation of the first step *)<br />
Combining ISABELLE and Timbuk<br />
[U(LHS, mesg(agt(q2), agt(q2), encr(pubkey(agt(q2)), agt(q2), cons(N(agt(q2), agt(q2)), agt(q2))))) q13] [LHS q13 agt(q2) q5<br />
q5 N(q5, q5) q15 cons(q15, q5) q16 pubkey(q5) q17 encr(q17, q5, q16) q13 mesg(q5, q5, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q2), agt(q1), encr(pubkey(agt(q1)), agt(q2), cons(N(agt(q2), agt(q1)), agt(q2))))) q13] [LHS q13 agt(q2) q5<br />
q4 N(q5, q4) q19 cons(q19, q5) q20 pubkey(q4) q21 encr(q21, q5, q20) q13 mesg(q5, q4, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q2), agt(q0), encr(pubkey(agt(q0)), agt(q2), cons(N(agt(q2), agt(q0)), agt(q2))))) q13] [LHS q13 agt(q2) q5<br />
q3 N(q5, q3) q23 cons(q23, q5) q24 pubkey(q3) q25 encr(q25, q5, q24) q13 mesg(q5, q3, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q1), agt(q2), encr(pubkey(agt(q2)), agt(q1), cons(N(agt(q1), agt(q2)), agt(q1))))) q13] [LHS q13 agt(q1) q4<br />
q5 N(q4, q5) q27 cons(q27, q4) q28 pubkey(q5) q17 encr(q17, q4, q28) q13 mesg(q4, q5, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q1), agt(q1), encr(pubkey(agt(q1)), agt(q1), cons(N(agt(q1), agt(q1)), agt(q1))))) q13] [LHS q13 agt(q1) q4<br />
q4 N(q4, q4) q30 cons(q30, q4) q31 pubkey(q4) q21 encr(q21, q4, q31) q13 mesg(q4, q4, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q1), agt(q0), encr(pubkey(agt(q0)), agt(q1), cons(N(agt(q1), agt(q0)), agt(q1))))) q13] [LHS q13 agt(q1) q4<br />
q3 N(q4, q3) q33 cons(q33, q4) q34 pubkey(q3) q25 encr(q25, q4, q34) q13 mesg(q4, q3, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q0), agt(q2), encr(pubkey(agt(q2)), agt(q0), cons(N(agt(q0), agt(q2)), agt(q0))))) q13] [LHS q13 agt(q0) q3<br />
q5 N(q3, q5) q36 cons(q36, q3) q37 pubkey(q5) q17 encr(q17, q3, q37) q13 mesg(q3, q5, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q0), agt(q1), encr(pubkey(agt(q1)), agt(q0), cons(N(agt(q0), agt(q1)), agt(q0))))) q13] [LHS q13 agt(q0) q3<br />
q4 N(q3, q4) q39 cons(q39, q3) q40 pubkey(q4) q21 encr(q21, q3, q40) q13 mesg(q3, q4, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q0), agt(q0), encr(pubkey(agt(q0)), agt(q0), cons(N(agt(q0), agt(q0)), agt(q0))))) q13] [LHS q13 agt(q0) q3<br />
q3 N(q3, q3) q42 cons(q42, q3) q43 pubkey(q3) q25 encr(q25, q3, q43) q13 mesg(q3, q3, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -�<br />
(* Approximation of the second step *)<br />
(* added by hand *)<br />
[U(LHS, mesg(agt(q2), agt(q2), encr(pubkey(agt(q2)), agt(q2), cons(N(q5, q5), cons(N(agt(q2), agt(q2)), agt(q2)))))) q13] [LHS<br />
agt(q2) q5 agt(q2) q5 N(q5, q5) q15 cons(q15, q5) q16 cons(q15, q16) q46 pubkey(q5) q17 encr(q17, q5, q46) q13<br />
q5, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -�<br />
agt(q2)<br />
agt(q1)<br />
agt(q0)<br />
agt(q2)<br />
agt(q1)<br />
agt(q0)<br />
agt(q2)<br />
agt(q1)<br />
agt(q0)<br />
q13<br />
mesg(q5,<br />
[U(LHS, mesg(agt(q2), agt(q2), encr(pubkey(agt(q2)), agt(q2), cons(N(a_1, b_1), cons(N(agt(q2), agt(q2)), agt(q2)))))) q13] [LHS q13<br />
agt(q2) q5 agt(q2) q5 N(q5, q5) q15 cons(q15, q5) q16 N(a_1, b_1) q45 cons(q45, q16) q46 pubkey(q5) q17 encr(q17, q5,<br />
q46) q13 mesg(q5, q5, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q2), agt(q1), encr(pubkey(agt(q1)), agt(q2), cons(N(a_2, b_2), cons(N(agt(q2), agt(q1)), agt(q2)))))) q13] [LHS q13<br />
agt(q2) q5 agt(q1) q4 N(q5, q4) q19 cons(q19, q5) q20 N(a_2, b_2) q48 cons(q48, q20) q49 pubkey(q4) q21 encr(q21, q5,<br />
q49) q13 mesg(q5, q4, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -� -�<br />
(* added by hand *)<br />
[U(LHS, mesg(agt(q2), agt(q0), encr(pubkey(agt(q0)), agt(q2), cons(N(q5, q3), cons(N(agt(q2), agt(q0)), agt(q2)))))) q13] [LHS<br />
agt(q2) q5 agt(q0) q3 N(q5, q3) q23 cons(q23, q5) q24 cons(q23, q24) q52 pubkey(q3) q25 encr(q25, q5, q52) q13<br />
q3, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -�<br />
q13<br />
mesg(q5,<br />
[U(LHS, mesg(agt(q2), agt(q0), encr(pubkey(agt(q0)), agt(q2), cons(N(a_3, b_3), cons(N(agt(q2), agt(q0)), agt(q2)))))) q13] [LHS q13<br />
agt(q2) q5 agt(q0) q3 N(q5, q3) q23 cons(q23, q5) q24 N(a_3, b_3) q51 cons(q51, q24) q52 pubkey(q3) q25 encr(q25, q5,<br />
q52) q13 mesg(q5, q3, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q1), agt(q2), encr(pubkey(agt(q2)), agt(q1), cons(N(a_4, b_4), cons(N(agt(q1), agt(q2)), agt(q1)))))) q13] [LHS q13<br />
agt(q1) q4 agt(q2) q5 N(q4, q5) q27 cons(q27, q4) q28 N(a_4, b_4) q54 cons(q54, q28) q55 pubkey(q5) q17 encr(q17, q4,<br />
q55) q13 mesg(q4, q5, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -� -�<br />
65
F. Oehl & D. Sinclair<br />
(* added by hand *)<br />
[U(LHS, mesg(agt(q1), agt(q1), encr(pubkey(agt(q1)), agt(q1), cons(N(q4, q4), cons(N(agt(q1), agt(q1)), agt(q1)))))) q13] [LHS<br />
agt(q1) q4 agt(q1) q4 N(q4, q4) q30 cons(q30, q4) q31 cons(q30, q31) q58 pubkey(q4) q21 encr(q21, q4, q58) q13<br />
q4, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -�<br />
q13<br />
mesg(q4,<br />
[U(LHS, mesg(agt(q1), agt(q1), encr(pubkey(agt(q1)), agt(q1), cons(N(a_5, b_5), cons(N(agt(q1), agt(q1)), agt(q1)))))) q13] [LHS q13<br />
agt(q1) q4 agt(q1) q4 N(q4, q4) q30 cons(q30, q4) q31 N(a_5, b_5) q57 cons(q57, q31) q58 pubkey(q4) q21 encr(q21, q4,<br />
q58) q13 mesg(q4, q4, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -� -�<br />
(* added by hand *)<br />
[U(LHS, mesg(agt(q1), agt(q0), encr(pubkey(agt(q0)), agt(q1), cons(N(q4, q3), cons(N(agt(q1), agt(q0)), agt(q1)))))) q13] [LHS<br />
agt(q1) q4 agt(q0) q3 N(q4, q3) q33 cons(q33, q4) q34 cons(q33, q34) q61 pubkey(q3) q25 encr(q25, q4, q61) q13<br />
q3, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -�<br />
q13<br />
mesg(q4,<br />
[U(LHS, mesg(agt(q1), agt(q0), encr(pubkey(agt(q0)), agt(q1), cons(N(a_6, b_6), cons(N(agt(q1), agt(q0)), agt(q1)))))) q13] [LHS q13<br />
agt(q1) q4 agt(q0) q3 N(q4, q3) q33 cons(q33, q4) q34 N(a_6, b_6) q60 cons(q60, q34) q61 pubkey(q3) q25 encr(q25, q4,<br />
q61) q13 mesg(q4, q3, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q0), agt(q2), encr(pubkey(agt(q2)), agt(q0), cons(N(a_7, b_7), cons(N(agt(q0), agt(q2)), agt(q0)))))) q13] [LHS q13<br />
agt(q0) q3 agt(q2) q5 N(q3, q5) q36 cons(q36, q3) q37 N(a_7, b_7) q63 cons(q63, q37) q64 pubkey(q5) q17 encr(q17, q3,<br />
q64) q13 mesg(q3, q5, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q0), agt(q1), encr(pubkey(agt(q1)), agt(q0), cons(N(a_8, b_8), cons(N(agt(q0), agt(q1)), agt(q0)))))) q13] [LHS q13<br />
agt(q0) q3 agt(q1) q4 N(q3, q4) q39 cons(q39, q3) q40 N(a_8, b_8) q66 cons(q66, q40) q67 pubkey(q4) q21 encr(q21, q3,<br />
q67) q13 mesg(q3, q4, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -� -�<br />
(* added by hand *)<br />
[U(LHS, mesg(agt(q0), agt(q0), encr(pubkey(agt(q0)), agt(q0), cons(N(q3, q3), cons(N(agt(q0), agt(q0)), agt(q0)))))) q13] [LHS<br />
agt(q0) q3 agt(q0) q3 N(q3, q3) q42 cons(q42, q3) q43 cons(q42, q43) q70 pubkey(q3) q25 encr(q25, q3, q70) q13<br />
q3, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -�<br />
q13<br />
mesg(q3,<br />
[U(LHS, mesg(agt(q0), agt(q0), encr(pubkey(agt(q0)), agt(q0), cons(N(a_9, b_9), cons(N(agt(q0), agt(q0)), agt(q0)))))) q13] [LHS q13<br />
agt(q0) q3 agt(q0) q3 N(q3, q3) q42 cons(q42, q3) q43 N(a_9, b_9) q69 cons(q69, q43) q70 pubkey(q3) q25 encr(q25, q3,<br />
q70) q13 mesg(q3, q3, q13) q13]<br />
-� -� -� -� -� -� -� -� -� -� -� -�<br />
(* Approximation of the third step *)<br />
[U(LHS, mesg(agt(q2), agt(q2), encr(pubkey(agt(q2)), agt(q2), N(a_10, b_10)))) q13] [LHS<br />
b_10) q73 pubkey(q5) q17 encr(q17, q5, q73) q13 mesg(q5, q5, q13) q13] -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q2), agt(q1), encr(pubkey(agt(q1)), agt(q2), N(a_11, b_11)))) q13] [LHS<br />
b_11) q75 pubkey(q4) q21 encr(q21, q5, q75) q13 mesg(q5, q4, q13) q13] -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q2), agt(q0), encr(pubkey(agt(q0)), agt(q2), N(a_12, b_12)))) q13] [LHS<br />
b_12) q77 pubkey(q3) q25 encr(q25, q5, q77) q13 mesg(q5, q3, q13) q13] -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q1), agt(q2), encr(pubkey(agt(q2)), agt(q1), N(a_13, b_13)))) q13] [LHS<br />
b_13) q80 pubkey(q5) q17 encr(q17, q4, q80) q13 mesg(q4, q5, q13) q13] -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q1), agt(q1), encr(pubkey(agt(q1)), agt(q1), N(a_14, b_14)))) q13] [LHS<br />
b_14) q82 pubkey(q4) q21 encr(q21, q4, q82) q13 mesg(q4, q4, q13) q13] -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q1), agt(q0), encr(pubkey(agt(q0)), agt(q1), N(a_15, b_15)))) q13] [LHS<br />
b_15) q84 pubkey(q3) q25 encr(q25, q4, q84) q13 mesg(q4, q3, q13) q13] -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q0), agt(q2), encr(pubkey(agt(q2)), agt(q0), N(a_16, b_16)))) q13] [LHS<br />
b_16) q86 pubkey(q5) q17 encr(q17, q3, q86) q13 mesg(q3, q5, q13) q13] -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q0), agt(q1), encr(pubkey(agt(q1)), agt(q0), N(a_17, b_17)))) q13] [LHS<br />
b_17) q88 pubkey(q4) q21 encr(q21, q3, q88) q13 mesg(q3, q4, q13) q13] -� -� -� -� -� -�<br />
[U(LHS, mesg(agt(q0), agt(q0), encr(pubkey(agt(q0)), agt(q0), N(a_18, b_18)))) q13] [LHS<br />
b_18) q90 pubkey(q3) q25 encr(q25, q3, q90) q13 mesg(q3, q3, q13) q13] -� -� -� -� -� -�<br />
(* Approximation of the remaining rules *)<br />
[U(LHS, c_init(agt(q2),agt(q2),z)) q13] -�<br />
[U(LHS, c_init(agt(q2),agt(q1),z)) q13] -�<br />
[U(LHS, c_init(agt(q2),agt(q0),z)) q13] -�<br />
[U(LHS, c_init(agt(q1),agt(q1),z)) q13] -�<br />
[U(LHS, c_init(agt(q1),agt(q2),z)) q13] -�<br />
[U(LHS, c_init(agt(q1),agt(q0),z)) q13] -�<br />
[U(LHS, c_init(agt(q0),agt(q2),z)) q13] -�<br />
[U(LHS, c_init(agt(q0),agt(q1),z)) q13] -�<br />
[U(LHS, c_init(agt(q0),agt(q0),z)) q13] -�<br />
[U(LHS, c_resp(agt(q2),agt(q2),z)) q13] -�<br />
[U(LHS, c_resp(agt(q2),agt(q1),z)) q13] -�<br />
[U(LHS, c_resp(agt(q2),agt(q0),z)) q13] -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
agt(q2) q5 -�<br />
agt(q2) q5 -�<br />
agt(q2) q5 -�<br />
agt(q1) q4 -�<br />
agt(q1) q4 -�<br />
agt(q1) q4 -�<br />
agt(q0) q3 -�<br />
agt(q0) q3 -�<br />
agt(q0) q3 -�<br />
agt(q2) q5 -�<br />
agt(q2) q5 -�<br />
agt(q2) q5 -�<br />
66<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
c_init(q5,q5,z) q13] -�<br />
agt(q1) q4 -�<br />
agt(q0) q3 -�<br />
c_init(q4,q4,z) q13] -�<br />
agt(q2) q5 -�<br />
agt(y) q3 -�<br />
agt(q2) q5 -�<br />
agt(q1) q4 -�<br />
agt(q2) q5 -�<br />
agt(q2) q5 -�<br />
agt(q2) q5 -�<br />
agt(q1) q4 -�<br />
agt(q1) q4 -�<br />
agt(q1) q4 -�<br />
agt(q0) q3 -�<br />
agt(q0) q3 -�<br />
agt(q0) q3 -�<br />
c_init(q5,q4,z) q13] -�<br />
c_init(q5,q3,z) q13] -�<br />
c_init(q4,q5,z) q13] -�<br />
c_init(q4,q3,z) q13] -�<br />
c_init(q3,q3,z) q13] -�<br />
c_init(q3,q5,z) q13] -�<br />
c_init(q3,q4,z) q13] -�<br />
c_resp(q5,q5,z) q13] -�<br />
agt(q1) q4 -�<br />
agt(q0) q3 -�<br />
c_resp(q5,q4,z) q13] -�<br />
c_resp(q5,q3,z) q13] -�<br />
agt(q2) q5 -�<br />
agt(q1) q4 -�<br />
agt(q0) q3 -�<br />
agt(q2) q5 -�<br />
agt(q1) q4 -�<br />
agt(q0) q3 -�<br />
agt(q2) q5 -�<br />
agt(q1) q4 -�<br />
agt(q0) q3 -�<br />
N(a_10,<br />
N(a_11,<br />
N(a_12,<br />
N(a_13,<br />
N(a_14,<br />
N(a_15,<br />
N(a_16,<br />
N(a_17,<br />
N(a_18,
[U(LHS, c_resp(agt(q1),agt(q1),z)) q13] -�<br />
[U(LHS, c_resp(agt(q1),agt(q2),z)) q13] -�<br />
[U(LHS, c_resp(agt(q1),agt(q0),z)) q13] -�<br />
[U(LHS, c_resp(agt(q0),agt(q2),z)) q13] -�<br />
[U(LHS, c_resp(agt(q0),agt(q1),z)) q13] -�<br />
[U(LHS, c_resp(agt(q0),agt(q0),z)) q13] -�<br />
[U(LHS, add(x)) q13] -�<br />
[U(U(x,y),y) q13] -�<br />
[U(x,y) -�<br />
[LHS -�<br />
q13 -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
[LHS -�<br />
q13] -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
q13 -�<br />
add(x) q13] -�<br />
agt(q1) q4 -�<br />
agt(q1) q4 -�<br />
agt(q1) q4 -�<br />
agt(q0) q3 -�<br />
agt(q0) q3 -�<br />
agt(q0) q3 -�<br />
67<br />
c_resp(q4,q4,z) q13] -�<br />
agt(q2) q5 -�<br />
agt(y) q3 -�<br />
agt(q2) q5 -�<br />
agt(q1) q4 -�<br />
Combining ISABELLE and Timbuk<br />
c_resp(q4,q5,z) q13] -�<br />
c_resp(q4,q3,z) q13] -�<br />
c_resp(q3,q3,z) q13] -�<br />
c_resp(q3,q5,z) q13] -�<br />
c_resp(q3,q4,z) q13] -�
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
68
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
An Experimental Sniffer D<strong>et</strong>ector: SnifferWall<br />
AbdelallahElhadj� H. , Khelalfa� H. M. & Kortebi�<br />
H. M.<br />
1,2 & 3: Basic Software Laboratory, CERIST,<br />
�habdelallahElhadj,mkortebi�@mail.cerist.dz,<br />
3, rue des frres Aissiou, Ben Aknoun, Algiers, Algeria.<br />
khelalfa@wissal.dz<br />
Abstract<br />
An experimental sniffer d<strong>et</strong>ector, SnifferWall, is presented. Based on an open architecture, it combines<br />
b<strong>et</strong>ween d<strong>et</strong>ecting hosts in promiscuous mode and hosts replaying information sniffed from honey pots. Two<br />
majors m<strong>et</strong>hods of d<strong>et</strong>ection are used:<br />
A<br />
A<br />
�<br />
�<br />
d<strong>et</strong>ection based on MAC addresses.<br />
decoy-based d<strong>et</strong>ection m<strong>et</strong>hod.<br />
Keywords: Sniffer, IDS, MAC, Honeypot<br />
1. Introduction<br />
The explosive growth of the Intern<strong>et</strong> has been bringing about revolutionary changes in the ways we conduct<br />
daily activities such as government, business, health care, education, entertainment, <strong>et</strong>c. It has made possible<br />
e-commerce, e-banking and even e-government. The Intern<strong>et</strong> phenomenon has paved the way for a new era of<br />
humanity: the information soci<strong>et</strong>y. Such a technological development has had also its downside; Intern<strong>et</strong> has<br />
experienced an unprecedented growth in security incidents and attacks on computers systems, n<strong>et</strong>works, <strong>et</strong>c<br />
[20]. In addition, attacks have grown in sophistication as well, using a very large s<strong>et</strong> of tools and techniques<br />
built upon the vulnerabilities of Intern<strong>et</strong> in general and TCP/IP in particular. We count sniffers amongst these<br />
tools. Originally, sniffers were used as n<strong>et</strong>work administration tool. Now, they are used as a malicious means<br />
to violate a system security. In fact, currently, a sniffer designates a passive attack tool that can gather valuable<br />
information over a n<strong>et</strong>work without the knowledge of the n<strong>et</strong>works legitimate owner. Using sniffers can<br />
have extremely grave consequences. Indeed, information gathered by a sniffer can include passwords, e-mail<br />
messages, encryption keys, sequence number, <strong>et</strong>c. [3][16]. In this article we present SnifferWall, a tool based<br />
on an integrated approach to remotely d<strong>et</strong>ect sniffers in a Local Area N<strong>et</strong>work. It is based on two m<strong>et</strong>hods:<br />
D<strong>et</strong>ection �<br />
D<strong>et</strong>ection �<br />
based on MAC addresses.<br />
through deception or decoys (honeypot).<br />
Our aim is to build an in-house sniffer d<strong>et</strong>ector that can be also used as a teaching aid in computer security<br />
classes.<br />
An overview of Intrusion D<strong>et</strong>ection Systems is presented in the following section. The third one introduces<br />
sniffers. In the fourth section, current approaches to sniffer d<strong>et</strong>ection are reviewed. In the fifth one, we describe<br />
the design of SNIFFERWALL as well as its current implementation.<br />
69
AbdelallahElhadj , Khelalfa & Kortebi<br />
2. Intrusion D<strong>et</strong>ection Systems (IDS)<br />
Intrusion d<strong>et</strong>ection (ID) is an important security mechanism. It is usually used in combination with other<br />
security mechanisms, to implement a site security policy [21]. By providing information to site administration,<br />
ID allows not only for the d<strong>et</strong>ection of attacks explicitly addressed by other security components (such as<br />
firewalls and service wrappers), but also attempts to provide notification of new attacks that may be bypassed<br />
by other mechanisms. Intrusion d<strong>et</strong>ection systems (IDS) can also be used in computer forensics. Thus, IDSs<br />
can make attackers more accountable for their actions; henceforth, they may act as a d<strong>et</strong>errent to attacks[2].<br />
There are two main models of Intrusion d<strong>et</strong>ection: [5].<br />
a) A Misuse D<strong>et</strong>ection model: D<strong>et</strong>ection is performed by looking for the exploitation of known weak points<br />
in the system, which can be described by a specific pattern or sequence of events or data, called signature.<br />
b) An Anomaly d<strong>et</strong>ection model: D<strong>et</strong>ection is performed by d<strong>et</strong>ecting changes in the patterns of utilization<br />
or behavior of the system, and users [6].<br />
IDSs are either host-based or n<strong>et</strong>work-based [1]. Host-based systems make their decisions on information<br />
obtained from a single host (usually audit trails), while n<strong>et</strong>work-based systems obtain data by monitoring the<br />
traffic of information in the n<strong>et</strong>work to which the hosts are connected. IDS are commonly used to d<strong>et</strong>ect active<br />
as well as passive attacks; sniffers are included amongst the tools used in conducting passive attacks.<br />
3. Sniffers<br />
Because Ethern<strong>et</strong> n<strong>et</strong>works are shared communication channels, the n<strong>et</strong>work interface of a computer on such<br />
a n<strong>et</strong>work sees all the pack<strong>et</strong>s transmitted on the segment it resides on. Each pack<strong>et</strong> has a header indicating<br />
the recipient of the pack<strong>et</strong>. Under normal operating procedures, only the machine with that proper address is<br />
supposed to accept the pack<strong>et</strong>. However, the N<strong>et</strong>work Interface Card (NIC) can be s<strong>et</strong> to a special mode called<br />
promiscuous mode to receive all pack<strong>et</strong>s on the wire. A sniffer is a special program or piece of code that put<br />
the NIC in the promiscuous mode. A user may operate the sniffer remotely.<br />
As stated in the introduction, sniffers are one of the first legitimate tools that allowed system administrators<br />
to analyze their n<strong>et</strong>work and troubleshoot n<strong>et</strong>work problems. Unfortunately, crackers have used sniffers<br />
maliciously to spy on n<strong>et</strong>works and steal various kinds of data. Crackers install sniffers to obtain user names,<br />
passwords, credit card numbers, personal information, and other information that could be damaging to a<br />
person, a corporation or even a nation. When they obtain this information, crackers will use the passwords to<br />
attack other Intern<strong>et</strong> sites and they can even turn a profit from selling credit card numbers.<br />
Sniffer software can be downloaded from the Intern<strong>et</strong>. The most popular sniffers are: Tcpdump [7] (the<br />
most famous), Sniffit [8], Ethereal [9], under Unix-like platform and Analyzer [10], Windump [11]. At<br />
SecurityFocus.com, there are 10 pages worth of sniffer tools. Here we should note that the belief that<br />
one can be protected from sniffers by using switches is no longer true [22].<br />
4. Overview of Existing Sniffer D<strong>et</strong>ectors<br />
Sniffer d<strong>et</strong>ection can be divided into:<br />
D<strong>et</strong>ection �<br />
D<strong>et</strong>ection �<br />
at local host level (host-based).<br />
at Local N<strong>et</strong>work Segment level (N<strong>et</strong>work-based).<br />
70
4.1. Host-based d<strong>et</strong>ection<br />
An Experimental Sniffer D<strong>et</strong>ector: SnifferWall<br />
According to the literature, most of the published work in the domain refers primarily to UNIX based tools.<br />
For most versions of UNIX, use ifconfig. This command will tell the user wh<strong>et</strong>her the n<strong>et</strong>work interface<br />
card is in promiscuous mode or not. However, it is not a reliable means of d<strong>et</strong>ection, since an attacker may have<br />
trojanized the ifconfig command prior to installing the sniffer. In such a case, the output of ifconfig is<br />
compromised. There are other key utilities that an administrator can use to d<strong>et</strong>ect the presence of a sniffer. They<br />
include the following commands: ls, df, du, ps, find, and n<strong>et</strong>stat, However, they can be trojanized as<br />
well [12].<br />
BSD UNIX offers a tool called cpm [13] (“check promiscuous mode”) developed by CERT/CC. cpm<br />
uses sock<strong>et</strong>(2), ioctl(2) to read wh<strong>et</strong>her the n<strong>et</strong>work card (or cards if multihomed) have been s<strong>et</strong> in<br />
promiscuous mode; and then reports the results to the console. Only those devices found in promiscuous mode<br />
will be listed.<br />
For SunOS 5.5 and 5.6 use ifstatus [14]. It reports to the console the flags of n<strong>et</strong>work interface cards,<br />
indicating which cards are in debug or promiscuous mode.<br />
4.2. N<strong>et</strong>work based d<strong>et</strong>ection<br />
The n<strong>et</strong>work approach allows the checking of an entire n<strong>et</strong>work from a single point of entry. It allows for the<br />
remote d<strong>et</strong>ection of a sniffer on a local n<strong>et</strong>work segment. The administrator runs the sniffer d<strong>et</strong>ector from a<br />
specified host and can perform various tests against other hosts to d<strong>et</strong>ect the presence of NICs in promiscuous<br />
mode in the n<strong>et</strong>work.<br />
D<strong>et</strong>ecting sniffers is a difficult task since they are passive tools of attack. This is reflected in the state of<br />
research in the domain. Indeed, few remotely based sniffer d<strong>et</strong>ector have been developed the two most famous<br />
tools are the two most famous tools for sniffer d<strong>et</strong>ection are: AntiSniff [15] (Windows platform) developed by<br />
l0pht Heavy Industries, and SNIFFER DETECTOR (Linux platform) developed by IBM-Zurich [3].<br />
a) AntiSniff: Is the only commercially available production level tool for d<strong>et</strong>ecting sniffers at the n<strong>et</strong>work<br />
level. Currently version 1.x of AntiSniff performs three classes of tests:<br />
Operating<br />
DNS<br />
�<br />
N<strong>et</strong>work<br />
�� System specific tests (ARP and Ether ping tests).<br />
tests.<br />
latency tests.<br />
The last test is the most powerful [15]. The latency technique (also named “load technique”) uses<br />
the fact that NIC interrupts to the operating system degrades system performance. When an NIC is<br />
in promiscuous mode, all Ethern<strong>et</strong> traffic will generate hardware interrupts which will cause the Ethern<strong>et</strong><br />
driver code to execute. Furthermore, with a sniffer running, captured pack<strong>et</strong>s must be passed to the user<br />
program running the sniffer. Crossing the kernel boundary is widely known to be relatively expensive.<br />
Thus, under heavy traffic, a sniffer will heavily degrade performance on promiscuous host. The load<br />
technique works by remotely measuring the traffic on the segment. Response time is measured twice:<br />
one measurement is taken when there is no heavy n<strong>et</strong>work traffic. Another measurement is taken to<br />
d<strong>et</strong>ermine the response time of the machine under heavy traffic, after the n<strong>et</strong>work has been flooded with<br />
huge quantities of fictitious traffic. Comparing the two measurements d<strong>et</strong>ermine wh<strong>et</strong>her a sniffer is<br />
running on that host or not. At this point, AntiSniff version 1.x builds a baseline for the machine(s) being<br />
probed by issuing ICMP echo requests with microsecond timers.<br />
The disadvantage [16] of this technique is that it can significantly degrade n<strong>et</strong>work performance.<br />
Furthermore, pack<strong>et</strong>s can be delayed simply because of the load on the wire, which may cause timeouts<br />
and therefore false positives. On the other hand, many sniffing programs are user mode programs whereas<br />
pings are responded to in kernel mode”, and are therefore independent of CPU load on a machine, thereby<br />
causing false negatives.<br />
71
AbdelallahElhadj , Khelalfa & Kortebi<br />
b)Sniffer D<strong>et</strong>ector(IBM-Zurich): It was developed by Stéphane Grundschober [3] at the Global Security<br />
Analysis Lab. The main idea of this tool is to spread bait that is presumably especially attractive to the<br />
sniffer’s owner. First, fictitious ftp and teln<strong>et</strong> connections are created; then the tool waits for the<br />
intruder to use the information bait—i.e., reconnect to the ftp or teln<strong>et</strong> server.<br />
In conclusion, we remark that no integrated approach to sniffer d<strong>et</strong>ection exists y<strong>et</strong>. Current tools resolve part<br />
of the problem. We feel that an integrated tool is necessary so that different complementary m<strong>et</strong>hods can be<br />
provided to the n<strong>et</strong>work administrator so that chances of sniffers eluding a n<strong>et</strong>work protection are minimized.<br />
In the next section we present SnifferWall, a sniffer d<strong>et</strong>ection tool based on an integrated approach.<br />
5. SnifferWall<br />
In this section, we present the design and implementation of a tool called SnifferWall, which help the system<br />
administrator d<strong>et</strong>ect remotely if a sniffer is running on an Ethern<strong>et</strong> n<strong>et</strong>work. SnifferWall offers an integrated<br />
approach to sniffer d<strong>et</strong>ection. The current types of m<strong>et</strong>hods that SnifferWall utilizes include:<br />
MAC-based<br />
Decoy<br />
�<br />
�<br />
d<strong>et</strong>ection m<strong>et</strong>hods.<br />
or deception-based m<strong>et</strong>hods.<br />
5.1. MAC Based D<strong>et</strong>ection<br />
In normal mode, a received pack<strong>et</strong> is filtered by the NIC; if the MAC address is correct the pack<strong>et</strong> is given<br />
the operating system. When in promiscuous mode, all incoming pack<strong>et</strong> are passed to the OS, as shown in the<br />
flowcharts of figure 1 and figure 2. Due to a TCP/IP stack vulnerability an Ethern<strong>et</strong> driver may not properly<br />
check the targ<strong>et</strong> MAC address of the Ethern<strong>et</strong> header when the NIC is in promiscuous mode. Hence, normally<br />
rejected pack<strong>et</strong> might be accepted. Our idea is to exploit this vulnerability by building pack<strong>et</strong>s with fake MAC<br />
address, then sending them out to the suspect machine. If the latter is in promiscuous mode it will issue a<br />
response to our pack<strong>et</strong>s.<br />
Two techniques are used:<br />
The<br />
The<br />
�<br />
�<br />
Etherping test which use ICMP echo pack<strong>et</strong>s.<br />
ARP test which use ARP pack<strong>et</strong>s.<br />
5.1.1. Etherping Test<br />
ICMP echo pack<strong>et</strong>s are sent to a targ<strong>et</strong> with the correct destination IP address, but with a bogus destination<br />
hardware address. Normally such pack<strong>et</strong>s are discarded. But when in promiscuous mode, some old Linux<br />
kernel and N<strong>et</strong>BSD will grab these pack<strong>et</strong>s as legitimate pack<strong>et</strong>s since their IP information is correct, and<br />
respond accordingly. If the targ<strong>et</strong> in question replies to our request, we know it is in promiscuous mode. This<br />
test has been included in SnifferWall mostly for pedagogical reasons. Students would be able to experiment<br />
with SnifferWall on old versions of Linux and BSD.<br />
5.1.2. ARP test<br />
An ARP request is sent to the targ<strong>et</strong> with all information valid except a bogus destination hardware address.<br />
Normally, if a machine is not in promiscuous mode, it will never see the pack<strong>et</strong>, since the pack<strong>et</strong> is not directed<br />
at it. If a machine is in promiscuous mode, the ARP request would be seen and the kernel would process it and<br />
reply. If a machine replies, we know that it is in promiscuous mode.<br />
72
Figure 1: The logic control performed by the NIC<br />
An Experimental Sniffer D<strong>et</strong>ector: SnifferWall<br />
Figure 2: The different steps of filtering through the protocols stack<br />
73
AbdelallahElhadj , Khelalfa & Kortebi<br />
We are exploiting a vulnerability present in both Linux and Windows operating systems. This vulnerability<br />
makes the kernel of a machine in promiscuous mode respond to an ARP request with a bogus destination<br />
address.<br />
This bogus MAC destination address is selected via an analysis of the behavior of Linux and Windows<br />
against ARP pack<strong>et</strong>s.<br />
a) Case of LINUX: Since Linux is an open source operating system, we were able to examine its source code<br />
to know how ARP pack<strong>et</strong>s are processed.<br />
The received ARP pack<strong>et</strong>s, after they bypass the NIC, are first received by the Ethern<strong>et</strong> module and then<br />
passed to the ARP module.<br />
In the Ethern<strong>et</strong> module, the first thing to check is the group bit (the bit with the heaviest weight of the<br />
first byte of the destination MAC address ), if it is s<strong>et</strong> to 1 the address is classified as broadcast if it<br />
matches the broadcast address (FF:FF:FF:FF:FF:FF); otherwise it is classified as multicast. (The<br />
vulnerability is at this level; in fact, the Ethern<strong>et</strong> module checks only the first bit regardless of the other<br />
bits of the destination MAC address.) If the group bit is not s<strong>et</strong> to 1, the address is classified either other<br />
host if it does not matches the local Mac address or to\_us, broadcast or multicast by the Ethern<strong>et</strong><br />
module.<br />
This is the reason why our test uses a fake destination MAC address with the group bit s<strong>et</strong>; this address<br />
should not be s<strong>et</strong> to an already existing Ethern<strong>et</strong> address (broadcast or multicast). The flowchart of<br />
figure 3 explains how the two modules work.<br />
Figure 3: The Ethern<strong>et</strong> module working in Linux kernel<br />
b) Case of Windows: Since Windows is not open source, finding out how pack<strong>et</strong>s are processed is more<br />
difficult. We decided to experimentally verify the test suggested by Promiscan [19].<br />
74
An Experimental Sniffer D<strong>et</strong>ector: SnifferWall<br />
MAC address Why?<br />
FF-FF-FF-FF-FF-FE To see if the OS check all bits of the MAC address and wh<strong>et</strong>her it will respond<br />
FF-00-00-00-00-00 To see if the OS check the first byte only<br />
FF-FF-00-00-00-00 To see if the OS check the first word only<br />
01-00-00-00-00-00 To see if the OS consider this address as multicast<br />
01-00-5E-00-00-00 To see if the OS consider this address as IP multicast<br />
Table 1: destination MAC addresses choice in the ARP test.<br />
c) Summary of the ARP based d<strong>et</strong>ection: After having analyzed the two systems, Table 2 summarizes the<br />
results of the various tests performed:<br />
Ethern<strong>et</strong> Address Win 9x/Me/XP(Home) Win NT4.0/2000/XP(Pro) Linux 2.2/2.4<br />
FF:FF:FF:FF:FF:FE X X X<br />
FF:FF:00:00:00:00 X X X<br />
FF:00:00:00:00:00 X X<br />
FF:00:00:00:00:00 X X<br />
01:00:5E:00:00:00 X<br />
01:00:00:00:00:00 X<br />
5.2. Decoy M<strong>et</strong>hod<br />
Table 2: Summary of the ARP based d<strong>et</strong>ection.<br />
The decoy m<strong>et</strong>hod is based on the concept of deceit or honeypot. The idea is to design a tool which allows<br />
spreading out bait (false passwords, false user names), which are supposed to be especially attractive for the<br />
sniffer owner and await him to launch an attack by reusing the fake information spread out (knowing that<br />
nobody except sniffer owner knows these false passwords).<br />
Currently, our decoy m<strong>et</strong>hod includes:<br />
Using �<br />
And �<br />
Teln<strong>et</strong>, FTP, and POP3 on one hand.<br />
using DNS on the other hand.<br />
5.2.1. Decoy Based on Teln<strong>et</strong>, FTP, and POP3<br />
For example, an FTP decoy is s<strong>et</strong> by:<br />
� First,<br />
� Second,<br />
adding one or more accounts to an FTP sever, with enticing user name (root, administrator, CIO,<br />
. . . ). The account should contain files whose names can attract an intruder. As a measure of security, this<br />
type of account will be granted the minimum level of access right.<br />
once the bait is s<strong>et</strong>, connections to the appropriate server (in this case FTP) are established by the<br />
d<strong>et</strong>ector. The sniffing part of the d<strong>et</strong>ector is launched at this stage. When the d<strong>et</strong>ector d<strong>et</strong>ects an attempt<br />
of reusing of the pair (password, user name) of a bait connection, it triggers an alarm and transmits the<br />
IP address of the suspect machine. The same technique is used in the case of Teln<strong>et</strong> and POP3.<br />
We have privileged using real connections with real servers instead of using fictive connection and fictive<br />
servers for practical purposes [3]. Indeed, using fictive servers and connections may not stand in court of law.<br />
75
AbdelallahElhadj , Khelalfa & Kortebi<br />
5.2.2. Decoy based on DNS<br />
This technique works by exploiting a behavior common to almost all password sniffers [16]. Numerous fake<br />
TCP connections are created on a n<strong>et</strong>work segment, expecting that a sniffer pick up on those connections and<br />
resolve the IP addresses of the nonexistent hosts (do a reverse DNS lookup). When this occurs, SnifferWall<br />
sniffs the DNS request to check if the targ<strong>et</strong> is the one requesting a resolution of that nonexistent host.<br />
6. Architecture design<br />
Figure 4: Architecture of SnifferWall<br />
SnifferWall has an open architecture; it is divided into eleven modules (Figure 4).<br />
The control module: The control module coordinates the activity of all the other modules. It answers their<br />
requests by starting the suitable modules. This type of reaction (module activation) can occur when a<br />
module announces its state to the control module. For example, when the user interface module sends a<br />
request of test beginning, the control module starts the module responsible for this test, suppose that is<br />
the ARP module. Once the test is accomplished, the ARP module announces the end of its task to the<br />
control module, when communicating the result of the test. If the result is positive the control module<br />
calls the alarm module to trigger alarm. Thus, the control module serves also as an intermediate if two<br />
modules would communicate b<strong>et</strong>ween them.<br />
The alarm module: It is responsible for s<strong>et</strong>ting off the alarm if a sniffer is d<strong>et</strong>ected after a test.<br />
The explication module: It provides explanations to the user concerning the tests and the m<strong>et</strong>hods used for<br />
d<strong>et</strong>ection as well as operation of the d<strong>et</strong>ector.<br />
The ARP module: It carries out the ARP test. It is composed of two sub-modules: ARPSend which is charged<br />
of sending ARP requests and ARPSniff which captures and filters pack<strong>et</strong>s for d<strong>et</strong>ecting a possible ARP<br />
reply.<br />
The Etherping module: It is composed of two sub modules: EtherSend which is in charge of sending ICMP<br />
echo requests and EtherSniff which captures and filters the ICMP traffic to d<strong>et</strong>ect a possible ICMP echo<br />
reply.<br />
The DNS module: It is comprised of two sub-modules: the first one generates false ftp and teln<strong>et</strong> sessions<br />
while the second one d<strong>et</strong>ects reverse DNS lookups.<br />
76
An Experimental Sniffer D<strong>et</strong>ector: SnifferWall<br />
The ftp, Teln<strong>et</strong> and POP3 modules: are respectively an ftp, teln<strong>et</strong> and pop3 clients used to establish<br />
connections with the server.<br />
The reply d<strong>et</strong>ector module: This module analyzes the n<strong>et</strong>work traffic, it collects the n<strong>et</strong>work pack<strong>et</strong>s,<br />
analyzes them, and announces possible attempts of reply, in real time, when running the decoy m<strong>et</strong>hod.<br />
This module is equivalent to the A-Boxes and the E-Boxes of the CIDF (Common Intrusion D<strong>et</strong>ection<br />
Framework) [17] model.<br />
The d<strong>et</strong>ection process requires communication by the control module of a rule base containing:<br />
The<br />
The<br />
The<br />
�<br />
�<br />
�<br />
type of the generated session (pop3, ftp, teln<strong>et</strong>).<br />
IP address or the server name of the server (ftp/teln<strong>et</strong>/pop3) used.<br />
(user name, password) pair.<br />
Each time a new session is generated, a new input is added to the rule base by the control module. The<br />
flowchart of figure 5 illustrates how the reply d<strong>et</strong>ector operates.<br />
Figure 5: Reply d<strong>et</strong>ector state diagram<br />
The user interface module: it allows a user to require that a s<strong>et</strong> of tests be performed, as well as providing<br />
the necessary information (configuration of the machine, configuration of the scheduler, IP addresses to<br />
be tested) and it also shows the results of tests. Results of the tests are currently sent via email messages<br />
to the administrator.<br />
77
AbdelallahElhadj , Khelalfa & Kortebi<br />
7. Implementation<br />
Currently, SnifferWall is implemented under Microsoft Windows. It is written in Visual C++ 6.0. Winpcap<br />
[11] and Libn<strong>et</strong>NT [18] are used to respectively capture the n<strong>et</strong>work traffic and to build pack<strong>et</strong>s.<br />
8. Evaluation and Conclusion<br />
Today, insidious attacks using sophisticated tools, and exploiting software vulnerabilities make Intrusion<br />
D<strong>et</strong>ection Systems an essential component of a sound protection of information ass<strong>et</strong>s. Access control and<br />
authentication are no longer self sufficient. Sniffer d<strong>et</strong>ection is a crucial part of such protection mechanisms.<br />
An integrated approach to sniffer d<strong>et</strong>ection has been <strong>propos</strong>ed. Our tool, SnifferWall, reached its main<br />
objective of d<strong>et</strong>ecting the presence of a sniffer on an Ethern<strong>et</strong> segment. It combines searching for machine<br />
in promiscuous mode and using honeypot to d<strong>et</strong>ect potential use of sniffed information. Hence, SnifferWall<br />
covers online d<strong>et</strong>ection as well as after the fact or information replay d<strong>et</strong>ection regardless of the platform.<br />
In addition, the d<strong>et</strong>ection based on MAC addressing makes it possible to d<strong>et</strong>ect any machine of the n<strong>et</strong>work<br />
which is in promiscuous mode for all Windows platform (9x/ME, NT/2000) or on Linux platforms (kernel /<br />
2.0 to 2.4). According to the literature, our POP decoy is the very first implementation.<br />
These results have never been reached, in the past, by a d<strong>et</strong>ector of sniffer, at least by a single sniffer<br />
d<strong>et</strong>ector.<br />
Currently, we are planning the following extensions:<br />
Using �<br />
Extending �<br />
mobile code to extend d<strong>et</strong>ection to a n<strong>et</strong>work made of several segments, so that sniffer d<strong>et</strong>ection<br />
can be distributed over an entire WAN, and the administrator can selectively scan part of the n<strong>et</strong>works<br />
he/she administers.<br />
the m<strong>et</strong>hods of d<strong>et</strong>ection based on MAC addressing on different platforms than Windows and<br />
Linux.<br />
References<br />
[1] B. Mukherjee, T.L. Heberlein, and K.N. Levitt. N<strong>et</strong>work intrusion d<strong>et</strong>ection. IEEE N<strong>et</strong>work, vol. 8, no.<br />
3, pages 26–41, May/June 1994.<br />
[2] S. Northcutt, J. Noval. N<strong>et</strong>work Intrusion D<strong>et</strong>ection: An Analysts’ Handbook. New Riders Publishing,<br />
Second Edition, 2001.<br />
[3] S. Grundschober. Sniffer D<strong>et</strong>ector report. Diploma Thesis, IBM Research Division, Zurich Research<br />
Laboratory, Global Security Analysis Lab, June 1998. http://pack<strong>et</strong>stormsecurity.nl/<br />
UNIX/IDS/grundschober_1998.l<strong>et</strong>ter.ps.gz.<br />
[4] J. Drury. Sniffers: What are they and how to protect from them. November 11, 2000. http://www.<br />
sans.org/infosecFAQ/switchedn<strong>et</strong>/sniffers.htm.<br />
[5] J.S. Balasubramaniyan, J.O. Garcia-Fernandez, D. Isacoff, E. Spafford, D. Zamboni. An Architecture<br />
for Intrusion D<strong>et</strong>ection using Autonomous Agents. CERIAS Technical Report 98/05, June 11, 1998.<br />
David Isacoff, Eugene Spafford, Diego Zamboni<br />
[6] D.E. Denning. An intrusion-d<strong>et</strong>ection model. IEEE Transactions on Software Engineering, vol. 13, no.<br />
2, pages 222–232, February 1987.<br />
78
[7] http://www.tcpdump.org/<br />
[8] http://reptile.rug.ac.be/˜coder/sniffit/sniffit.html<br />
[9] http://www.<strong>et</strong>hereal.com/<br />
[10] http://n<strong>et</strong>group-serv.polito.it/analyzer/<br />
[11] http://n<strong>et</strong>group-serv.polito.it/windump/<br />
An Experimental Sniffer D<strong>et</strong>ector: SnifferWall<br />
[12] J. Downey. Sniffer d<strong>et</strong>ection tools and countermeasures. October 19, 2000. http://rr.sans.org/<br />
covertchannels/sniffer.php<br />
[13] ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/cpm/<br />
[14] ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/ifstatus/<br />
[15] http://www.securitysoftwar<strong>et</strong>ech.com/antisniff/<br />
[16] D. Wu and F. Wong. Remote Sniffer D<strong>et</strong>ection. Computer Science Division, University of<br />
California, Berkeley. December 14, 1998. http://spisa.act.uji.es/spi/docs/redes_<br />
doc/fredwong-davidwu.ps.<br />
[17] S. Staniford-Chen. Common Intrusion D<strong>et</strong>ection Framework (CIDF). http://seclab.cs.<br />
ucdavis.edu/cidf/.<br />
[18] http://www.eeye.com/<br />
[19] http://www.securityfriday.com/<br />
[20] Riptech Intern<strong>et</strong> Security Report, vol. I, January 2002, http://www.riptech.com/<br />
securityresources/form10.html. Vol. II, July 2002, http://www.riptech.com/<br />
securityresources/form_istr2.html.<br />
[21] International Standards Organization. ISO 7498-2, Information Processing systems—Open System<br />
Interconnection—Basic Reference Model. Part 2: security architecture. Geneva, Switzerland, 1984.<br />
[22] S. McClure and J. Scambray. Switched n<strong>et</strong>works lose their security advantage due to pack<strong>et</strong> capturing<br />
tool. Infoworld, July 22, 2002. http://www.infoworld.com/articles/op/xml/00/05/<br />
29/000529opswatch.xml.<br />
79
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
80
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
Vers une collecte pertinente des informations de<br />
sécurité sur Intern<strong>et</strong><br />
Camus� M. , Auroux� L. & Gousseau�<br />
D.<br />
1: L.E.R.I.A, <strong>Laboratoire</strong> Epitech de Recherche en Informatique<br />
Appliquée<br />
24 rue Pasteur 94270 Le Kremlin Bicêtre, France<br />
{camus_m,auroux_l,gousse_d}@anciens.epitech.n<strong>et</strong><br />
Résumé<br />
De nos jours, il est difficile pour un administrateur système de collecter des informations de sécurité.<br />
En eff<strong>et</strong>, le flux de données présent sur la toile mondiale est trop important, ce qui rend le traitement des<br />
informations de sécurité trop long <strong>et</strong> trop complexe. De ce fait, un outil de récupération d’information de<br />
sécurité sur intern<strong>et</strong> est utile pour toute personne ayant besoin de recevoir les informations relatives à la<br />
sécurité. C<strong>et</strong> outil est composé d’un système multi-agents autonome distribué, grâce au protocole CORBA,<br />
dont le rôle est de collecter des informations en s’assurant de l’authenticité <strong>et</strong> de la pertinence de celles-ci.<br />
De plus, un tri automatique est effectué pour que l’utilisateur n’aie plus à traiter que les données de sécurité<br />
qui l’intéressent comme par exemple ne plus recevoir que les informations sur les failles de sécurité relative<br />
à ses propres équipements.<br />
1. Introduction<br />
1.1. Contexte<br />
Aujourd’hui tous les internautes ont accès à un grand nombre d’informations relatives à la sécurité<br />
informatique sur intern<strong>et</strong>. Par exemple une recherche intern<strong>et</strong> sur les mots "portail sécurité intern<strong>et</strong>" donne<br />
entre 10 000 <strong>et</strong> 33 000 réponses (voila.fr <strong>et</strong> altavista 10 000 réponses, google 33 500 réponses) de même<br />
une recherche sur les mots "mailing-list securite informatique" donne entre 2 000 <strong>et</strong> 5 000 réponses sur<br />
ces mêmes moteurs. Ce (trop) grand nombre de sources d’informations pose la question de savoir comment<br />
sélectionner celles-ci pour être sûr d’avoir rapidemment un aperçu de toutes les vulnérabilités, bugs <strong>et</strong><br />
nouveautés pertinentes.<br />
De plus si le nombre de sources d’informations est important, le nombre d’informations émis par les<br />
différentes sources par besoin d’exhaustivité est lui aussi très important. Par exemple le CERT 1 a recensé<br />
2437 vulnérabilitées en 2001 <strong>et</strong> publié 341 notes de sécurité la même année. Le problème est d’obtenir des<br />
informations utiles <strong>et</strong> vérifiées. Utiles parce que toutes les alertes ne concernent pas tout le monde <strong>et</strong> qu’il y a<br />
un risque de ne plus lire les informations si il n’y a aucune possibilité de les filtrer. Et vérifiées parce que les<br />
fausses alertes de sécurité (faux virus ou faux bugs) sont de plus en plus courantes. Le nombre de sites traitant<br />
des "canulars" ou "hoax" est de plus en plus important (par exemple www.hoaxbuster.com depuis 2000 est un<br />
des premier site français traitant de ce suj<strong>et</strong>), <strong>et</strong> les portails sur la sécurité informatique sont aujourd’hui obligés<br />
de tenir compte de ce phénomène.<br />
L’objectif de ce proj<strong>et</strong> est d’apporter un outil de veille sécurité qui perm<strong>et</strong> de collecter les informations<br />
relatives a la sécurité, d’authentifier l’information collectée (niveau de confiance en l’information), <strong>et</strong> de filtrer<br />
les informations pour ne présenter que celles qui sont pertinentes pour l’utilisateur.<br />
1 Computer Emergency Response Team<br />
81
Camus, Auroux & Gousseau<br />
1.2. Composition du proj<strong>et</strong><br />
C<strong>et</strong> outil de veille sécurité s’appuie essentiellement sur un système multi-agents autonomes possédant une<br />
base de connaissance privée <strong>et</strong> commune pour éviter la redondance de connaissances. Ainsi les agents pourront<br />
prendre des décisions sur tels types d’informations ou de problèmes. Ces agents sont de 3 types : agent local,<br />
agent central, <strong>et</strong> agent collecteur.<br />
Agent local : Il gère l’authentification de l’utilisateur <strong>et</strong> l’affichage des informations. En fait ce n’est qu’une<br />
interface utilisateur adaptable à d’autres systèmes d’informations.<br />
Agent central : Il authentifie les agents locaux (l’utilisateur), il gère le profil de l’utilisateur, <strong>et</strong> alimente<br />
l’agent local avec les informations collectées si nécessaire.<br />
Agents collecteurs : Ces sont les agents qui collectent les informations sur intern<strong>et</strong> <strong>et</strong> les donnent à l’agent<br />
central. Ils peuvent être de différents types :<br />
– agent mailing-list, c<strong>et</strong> agent s’abonne à des mailing-list <strong>et</strong> sélectionne les informations pour alimenter<br />
l’agent central.<br />
– agent newsgroup, il fait la même chose que l’agent mail, mais pour les newsgroups.<br />
– agent web-portail, c<strong>et</strong> agent collecte les informations sur les portails de sécurité.<br />
– agents générique, c<strong>et</strong> agent est une interface directe entre les fournisseurs d’informations de sécurité,<br />
<strong>et</strong> l’agent central.<br />
2. Fonctionnement du système multi-agents autonomes<br />
Celui-ci est composé de différentes entités bien distinctes. Chacune de ces entités aura un rôle bien<br />
spécifique à jouer lors de la communication des informations qui auront été collectées par les agents collecteurs.<br />
L’agent local, lui, est une interface utilisateur avec laquelle celui-ci va se m<strong>et</strong>tre en relation avec l’agent central.<br />
Le nombre d’agents locaux par utilisateur n’est pas limité, cela perm<strong>et</strong> une configuration de recherche poussée.<br />
Les agents locaux ne correspondent pas directement avec les agents collecteurs. En eff<strong>et</strong>, un agent central,<br />
qui est unique, joue le rôle d’un intermédiaire pour filtrer les informations en fonction des profils des<br />
utilisateurs.<br />
2.1. L’environnement de communication<br />
Comme le montre le schéma ci-dessous, la communication entre les différents agents se fait dans les deux<br />
sens. C’est à dire qu’une capacité de lecture <strong>et</strong> d’écriture est donnée à tous les agents qui pourront, comme ceci,<br />
agir directement entre eux. La communication entre agents de même nature est impossible. Chaque agent de<br />
nature locale ou collecteur est obligé de passer par l’agent central pour lire les caractéristiques des utilisateurs<br />
<strong>et</strong> écrire les informations collectées.<br />
L’agent central récupère les informations collectées par les agents collecteurs pour les rediriger vers les<br />
agents locaux correspondant au profil des informations.<br />
82
2.2. L’agent local<br />
Collector Agent<br />
(Generic)<br />
Communication Inter-Agent<br />
Local Agent Local Agent Local Agent<br />
Collector Agent<br />
(Mail)<br />
Central Agent<br />
Collecte pertinente des informations de sécurité<br />
Collector Agent<br />
(News)<br />
Collector Agent<br />
(Web)<br />
Comme le montre la figure ci-dessous, l’agent local se compose de six éléments bien distincts ayant un<br />
système de communication strict. Cinq de ces éléments gravitent autour du cœur de l’agent : le moteur de<br />
collecte.<br />
Ce moteur va regrouper les informations arrivant de l’extérieur directement dans la base de connaissance<br />
de l’agent, tout en prennant connaissance de la configuration de base de celui-ci. La Base de connaissances <strong>et</strong><br />
le modèle de configuration sont aussi des éléments important de l’agent puisque la base va stocker les données<br />
désirées, le modèle <strong>et</strong> le profil de l’utilisateur. Bien sûr, les trois autres éléments ont aussi leur importance,<br />
l’interface de configuration sert à récupérer le profil utilisateur de l’agent pour l’écrire dans le modèle de<br />
configuration. Quand à l’entrée <strong>et</strong> la sortie, elles donnent bien entendu la possibilité à l’agent de communiquer<br />
avec l’extèrieur.<br />
83
Camus, Auroux & Gousseau<br />
Private<br />
Base<br />
Local Agent<br />
Write<br />
Configuration<br />
Interface<br />
Write<br />
Collect<br />
Out Knowledge<br />
Write<br />
In<br />
Engine<br />
2.3. L’agent collecteur<br />
Read<br />
Configuration<br />
Model<br />
Write<br />
C<strong>et</strong> agent possède une structure qui ressemble à l’agent local à quelques exceptions près. Celles-ci se<br />
distinguent au niveau de la communication des éléments, du cœur de l’agent <strong>et</strong> de l’interface utilisateur.<br />
En eff<strong>et</strong>, le cœur de l’agent est un moteur de recherche qui va effectuer celle-ci en tenant compte du modèle<br />
de configuration précédement récupéré de l’agent central. D’où l’absence d’une interface de communication,<br />
car l’utilisateur n’agit pas directement sur c<strong>et</strong> agent, mais passe par l’intermédiaire de l’agent central. Les<br />
données récupérées seront bien entendu inscrites dans la base de connaissance pour ensuite être envoyées à<br />
l’agent central qui est décrit juste après.<br />
Private<br />
Write<br />
Research<br />
Out Knowledge<br />
Engine<br />
In<br />
2.4. L’agent central<br />
Base<br />
Collector Agent<br />
Write<br />
Read<br />
Configuration<br />
Model<br />
Write<br />
L’agent central est l’entité la plus importante du système. C’est lui qui dirige <strong>et</strong> m<strong>et</strong> en relation les agents<br />
locaux <strong>et</strong> les agents collecteurs. c’est aussi lui qui possède la base de connaissance commune à tous les agents<br />
du système. Comme le montre le schéma ci-dessous, l’agent central possède une entrée <strong>et</strong> une sortie. Chacune<br />
de ces connexions possède plusieurs flux qui donnent la possiblité à l’agent de communiquer en lecture-écriture<br />
avec plusieurs agents.<br />
84
In<br />
Private<br />
Knowledge<br />
Base<br />
Common<br />
Knowledge<br />
Base<br />
Write<br />
Read<br />
Data<br />
Central Agent<br />
Write<br />
Send Signal Send Signal<br />
Manager<br />
Send Signal Send<br />
Signal<br />
Send Signal<br />
Information Collector<br />
Collecte pertinente des informations de sécurité<br />
-User Profil<br />
-Local Agent Id<br />
-User Action<br />
Dissipator<br />
Send Data<br />
L’agent central est composé de plusieurs éléments qui ont un rôle bien précis pour la communication interagent<br />
:<br />
– une entrée,<br />
– une sortie,<br />
– une base de connaissance privée,<br />
– une base de connaissance commune,<br />
– un collecteur d’information interne,<br />
– un dissipateur d’information,<br />
– une interface utilisateur,<br />
– un manager<br />
Tous ces éléments peuvent communiquer entre eux. C<strong>et</strong>te communication peut se faire de deux manières :<br />
– une communication directe,<br />
– Une communication par intermédiaire<br />
La communication directe se fait, soit en lecture, soit en écriture, elle ne peut pas se faire en half-duplex.<br />
La communication par intermédiaire, quant à elle, se fait par des IPC 2 . La communication directe est utilisée<br />
par l’entrée,la base de connaissance privée, le collecteur d’information, l’interface utilisateur, <strong>et</strong> le dissipateur.<br />
Pour les signaux, ceux-ci sont utilisés par le manager, la base de connaissance privée, la base de connaissance<br />
commune, le collecteur d’information, le dissipateur <strong>et</strong> l’interface utilisateur.<br />
Tous ces éléments, qui forment l’agent central, ont la charge d’exécuter certaines actions délibérément<br />
séparées. Voici le rôle de chaque élément :<br />
– L’entrée est chargé de faire circuler <strong>et</strong> de synchroniser les flux entrants pour le compte du collecteur<br />
d’information. Elle gère une file d’attente de type FIFO (First Input First Output), le temps que les<br />
informations soient traitées.<br />
– La sortie est chargée de faire circuler <strong>et</strong> de synchroniser les flux sortants pour le compte du dissipateur.<br />
C<strong>et</strong> élément gère aussi une file d’attente de type FIFO pour que les informations soient redistribuées.<br />
2 Inter Process Communication<br />
85<br />
Out<br />
Send<br />
Data
Camus, Auroux & Gousseau<br />
– La base de connaissance privée récupère des informations concernant les comptes des utilisateurs <strong>et</strong><br />
les actions à mener pour ceux-ci, ainsi que la configuration pour tous les agents locaux <strong>et</strong> les agents<br />
collecteurs, décrite par les utilisateurs.<br />
– La base de connaissance commune regroupe toutes les informations communes à tous les agents locaux<br />
<strong>et</strong> les agents collecteurs, ce qui évite la redondance d’information <strong>et</strong> augmente la capacité de stockage de<br />
la base de connaissance privée des agents locaux <strong>et</strong> collecteurs.<br />
– Le collecteur d’information interne se charge de récupérer les informations des agents collecteurs en<br />
gérant une file d’attente par taille d’information, c’est à dire que quand le collecteur possède un nombre<br />
suffisant d’informations, il passe ces dernières au dissipateur.<br />
– Le dissipateur gère la répartition des informations vers les agents locaux. Il traite les différents profils<br />
des utilisateurs pour envoyer les informations aux agents locaux correspondant.<br />
– L’interface utilisateur sert lors de la configuration des comptes des utilisateurs <strong>et</strong> quand ceux-ci<br />
décrivent leur profil au niveau des agents locaux <strong>et</strong> des agents collecteurs. C<strong>et</strong>te interface écrit ensuite les<br />
données dans la base privée de l’agent central.<br />
– Le manager, comme son nom l’indique, gère tous les éléments composant l’agent central. C’est lui qui<br />
joue le rôle de l’intermédiaire pour la communication par signaux. Un système de questions-réponses<br />
fonctionne entre lui <strong>et</strong> les autres éléments. Par exemple, il interroge la base de connaissance privée <strong>et</strong><br />
commune pour que le dissipateur puisse trier les informations, ou il interroge ces deux même bases pour<br />
le compte de l’interface utilisateur, ce qui perm<strong>et</strong> à c<strong>et</strong>te dernière d’accepter ou non une configuration<br />
selon les éléments qui sont déjà connus.<br />
L’agent central est donc le cœur du sytème multi-agents autonomes. C’est lui qui garde les informations<br />
critiques <strong>et</strong> qui perm<strong>et</strong> aux utilisateurs d’avoir une communication indirecte avec les agents collecteurs afin de<br />
modifier leur configuration.<br />
3. <strong>Spécification</strong> du protocole de communication entre les agents<br />
Les langages multi-agents comme KQML (Knowledge Query and Manipulation Language) ou ACL (Agent<br />
Communication Language) ne <strong>propos</strong>ent pas de système de localisation des agents ce qui rend l’utilisation<br />
d’une plateforme comme jade (Java Agent DEvelopment Framework) nécéssaire. la manière la plus adéquate<br />
pour implémenter c<strong>et</strong>te architecture multi-agent, vu les besoins fonctionnels du proj<strong>et</strong>, est d’utiliser les<br />
capacités de communication LAN-WAN de Corba.<br />
86
Client<br />
Client<br />
Agent Collecteur<br />
Certificat<br />
Agent Local 1<br />
Agent Local 2<br />
Corba<br />
ClientICollecteurMail<br />
� �<br />
� �<br />
Mailing list<br />
Corba Client ILocal Corba Serv ILocal<br />
� �<br />
� �<br />
� �<br />
� �<br />
� �<br />
Certificat<br />
Intern<strong>et</strong><br />
Agent Collecteur<br />
� �<br />
� �<br />
� � � �<br />
� �<br />
Corba<br />
ClientICollecteurNews<br />
Newsgroup<br />
Collecte pertinente des informations de sécurité<br />
Agent Central<br />
Agent Collecteur<br />
Corba<br />
ServICollecteur<br />
Corba<br />
ClientICollecteurWeb<br />
Certificat<br />
Pages Web<br />
BD<br />
SGF<br />
/<br />
Corba<br />
ClientISyndicate<br />
Site Dédié<br />
Corba<br />
ServISyndicate<br />
� �<br />
� � � � �<br />
� �<br />
� � � � �<br />
Agent Collecteur<br />
Portl<strong>et</strong> ou<br />
Servl<strong>et</strong><br />
En eff<strong>et</strong>, Corba perm<strong>et</strong>, comme indiqué dans l’exemple schématisé ci-dessus, une architecture distribuée.<br />
Pour répondre à toutes les fonctionnalitées précédement exposées nous avons identifié différentes interfaces<br />
corba possible. Les noms indiqués sont à titre d’exemple. Nous indiquons aussi le nom probable de certaines<br />
m<strong>et</strong>hodes Corba <strong>et</strong> certaines contraintes d’implémentation pour une meilleur compréhension générale.<br />
3.1. Agent central<br />
L’agent central est composé de différents servants 3 corba enregistrés auprés de l’adaptateur d’obj<strong>et</strong> corba<br />
4 . L’agent central est composé du servant ILocalAgent de l’agent local <strong>et</strong> du servant ICentralAgent de l’agent<br />
central.<br />
Outre l’interface corba, l’agent central doit répondre aux fonctionnalitées suivantes :<br />
– Les agents locaux doivent être connus de l’agent central pour être authentifiés.<br />
– Les agents collecteurs doivent être listés au niveau de l’agent central,pour qu’ils puissent s’inscrire<br />
auprés d’eux. Cela perm<strong>et</strong> de partager un même agent collecteur pour plusieurs agents centraux, <strong>et</strong> ainsi<br />
3 interface serveur de l’obj<strong>et</strong> distribué<br />
4 service d’enregistrement des obj<strong>et</strong>s distribué<br />
87<br />
BD
Camus, Auroux & Gousseau<br />
d’introduire le concept de collecteurs publics dans une architecture répartie sur Intern<strong>et</strong>.<br />
– L’agent central liste tous les agents locaux connectés pour leur pousser l’information.<br />
– Pour optimiser la recherche, l’agent central doit générer un filtre commun à tous les profils des<br />
agents locaux. Il le fournira aux agents collecteurs, afin que ceux-ci puissent filtrer une première fois<br />
l’information. Ainsi, l’agent central ne recevra que les informations utiles.<br />
3.2. Agent local (interface ILocalAgent)<br />
Le servant ILocalAgent est présent sur l’agent central, l’agent local contient la partie cliente du servant <strong>et</strong><br />
accéde aux méthodes suivantes :<br />
– L’agent local doit s’authentifier avant toute chose auprès de l’agent central qu’il connait. Il recevra un<br />
contexte de connexion utile pour la gestion de la session, lors de l’invoquation de méthode future. Il doit<br />
être possible de détecter si une erreur est survenue.<br />
Context connect(in Key key) raises(EGeneral);<br />
– Il doit pouvoir administrer son profil, donc recevoir celui sauvegardé auprès de l’agent central, <strong>et</strong> le<br />
modifier.<br />
Profile G<strong>et</strong>Profile() raises (EGeneral) context ("ctx");<br />
void S<strong>et</strong>Profile(in Profile prof) raises (EGeneral) context ("ctx");<br />
– Il doit créer une interface spécifique (IPush) pour que l’agent central puisse lui pousser l’information.<br />
L’information doit être accompagnée de la clef d’authentification de l’agent central.<br />
void PushInfo(in Key key, in ListInfo list);<br />
3.3. Agent collecteur (interface ICollector)<br />
Le servant ICollector est présent sur l’agent collecteur. IL m<strong>et</strong> à disposition de l’agent central les méthodes<br />
suivantes :<br />
– Il inscrit les agents centraux dans sa base de connaissance. Pour cela, il utilise la même méthode que les<br />
agents locaux.<br />
Context connect(in Key key) raises(EGeneral);<br />
– Il gére les profils des agents centraux.<br />
Profile G<strong>et</strong>Profile() raises (EGeneral) context (\"ctx\");<br />
void S<strong>et</strong>Profile(in Profile prof) raises (EGeneral) context (\"ctx\");<br />
– Il récupére <strong>et</strong> envoie l’information sur l’agent central en fonction du filtre qu’il doit utiliser pour c<strong>et</strong><br />
agent. Pour cela il utilise la seule méthode de l’interface ICentralAgent.<br />
void PushInfo(in Key key,<br />
in KindOf kind,<br />
in Buffer data,<br />
in TrustInfo trust) raises (EGeneral) context (\"ctx\");<br />
4. Système de confiance en l’information<br />
Pour que l’utilisateur puisse filtrer <strong>et</strong> quantifier la pertinence de l’information en fonction de l’ém<strong>et</strong>teur<br />
<strong>et</strong> de l’organisation auquel appartient l’ém<strong>et</strong>teur, nous nous appuyons sur l’architecture des certificats X509.<br />
Une connexion de l’arborescence des identités sur une infrastructure PKI perm<strong>et</strong> la vérification de la validité<br />
des certificats. Comme le montre le schéma ci-dessous, le processus de qualification de la pertinence de<br />
l’information utilise une arborescence d’identités des ém<strong>et</strong>teurs.<br />
88
Information<br />
Signée<br />
Agent<br />
Collecteur<br />
Information<br />
Signée<br />
Identité<br />
Agent Central<br />
Arborescence<br />
d'identités<br />
Collecte pertinente des informations de sécurité<br />
Processus de mise en confiance en l'information<br />
Information<br />
Identifiée,<br />
qualifiée<br />
(XX%) <strong>et</strong><br />
filtrée.<br />
Pertinence :<br />
(XX %)<br />
Agent Local<br />
L’utilisation d’une arborescence d’identités, perm<strong>et</strong> à l’utilisateur, à travers son profil d’agent local, de<br />
donner des poids aux nœuds <strong>et</strong> branches de l’arbre, comme présenté dans le schéma ci-dessous. Chaque profil<br />
local possède ses propres poids sur cles nœuds de l’arbre de sorte que chaque utilisateur puisse filtrer les<br />
informations comme il le souhaite. Le poids des nœuds s’hérite de père en fils pour simuler la confiance que<br />
l’utilisateur possède envers une organisation ou une entité.<br />
89
Camus, Auroux & Gousseau<br />
AC 1<br />
100%<br />
AC Entité 2<br />
50%<br />
CAS Auteur 3<br />
15%<br />
Légende :<br />
Exemple d'un profil de confiance<br />
AIC 1.1<br />
80%<br />
AC Entité 1.2<br />
100%<br />
Auteur 2.1<br />
80%<br />
Auteur 2.2<br />
50%<br />
AC Entité 1.1.1<br />
100%<br />
Auteur 1.2.1<br />
50%<br />
Auteur 1.2.2<br />
10%<br />
AC : Authoritée de Certification<br />
AIC : Authorité Intermédiaire de Certification<br />
CAS : Certificat Auto-Signé<br />
Infos Auteur 3<br />
Infos Entité 1.1.1<br />
Auteur 1.1.1<br />
90%<br />
Infos Auteur 2.1<br />
Infos Auteur 2.2<br />
Infos Auteur 1.1.1<br />
Infos Auteur 1.2.1<br />
Infos Auteur 1.2.2<br />
Dans le cas où le collecteur reçoit une informations non signée, l’agent central insère l’ém<strong>et</strong>teur dans<br />
l’arborscence comme racine (il n’y a pas d’héritage possible) en utilisant les informations qui sont disponibles<br />
(adresse email, nom du site intern<strong>et</strong>, ém<strong>et</strong>teur de la news, <strong>et</strong>c...). Cela perm<strong>et</strong> quand même à l’utilisateur de<br />
donner un poids à la source d’information.<br />
90<br />
80%<br />
72%<br />
50%<br />
10%<br />
40%<br />
25%<br />
15%
5. Conclusion<br />
Collecte pertinente des informations de sécurité<br />
Grâce à ce système d’agents communicants, le tri de l’information est automatique. Bien sûr, l’utilisateur<br />
de ce système a tout de même une configuration à effectuer, mais c’est minime par rapport au travail effectué<br />
par les méthodes de recherches classique. De plus, c<strong>et</strong>te configuration ne se fait qu’une seule fois : un système<br />
de notation des news reçues perm<strong>et</strong> à l’agent de réorienter le profil utilisateur. Par la suite, une mise à jour peut<br />
être effectuée pour réorienter le filtrage.<br />
C<strong>et</strong> outil est un atout quand on sait que la plupart des administrateurs système passent beaucoup de temps<br />
à trier les informations de sécurité qu’ils ont reçu par mail ou par forums. De plus, les systèmes de mailing-list<br />
ou newsgroup ne <strong>propos</strong>ent pas de tri en fonction de l’identité de l’informateur. La méthode multi-agents est<br />
un gain de temps pour les personnes qui ont un besoin d’informations fraiches, utiles <strong>et</strong> vérifiées comme les<br />
administrateurs systèmes <strong>et</strong> réseaux, mais aussi pour les auditeurs <strong>et</strong> les laboratoires de veille technologique.<br />
La quantité <strong>et</strong> la qualité du flux d’information intern<strong>et</strong> ne doit pas être un frein pour la diffusion <strong>et</strong> la crédibilité<br />
de l’information, il est donc nécessaire de m<strong>et</strong>tre en place les outils qui traitent le maximum d’informations<br />
mais ne présentent que celles qui intéressent l’utilisateur.<br />
91
Camus, Auroux & Gousseau<br />
Références<br />
[1] G.M.P. O’Hare <strong>et</strong> N.R. Jennings. Foundations of Distributed Artificial Intelligence. John Wiley & Sons,<br />
Inc., 1996, New York, USA.<br />
[2] G. Weiss, éditeur. Multiagent Systems : A Modern Approach to Distributed Artificial Intelligence. MIT<br />
Press, 2000.<br />
[3] N. El Kadhi <strong>et</strong> M. Ben Ahmed. Multi agent global securing system (M.A.G.SE.S). IASTED International<br />
Conference on Computer Systems and Applications (CSA’98), Irbid, Jordanie, Mars 1998.<br />
[4] D. Benech, T. Desprats, <strong>et</strong> Y. Raynaud. A KQML-CORBA based architecture for intelligent agents<br />
communication in cooperative service and n<strong>et</strong>work management. IFIP/IEEE international Conference on<br />
Management of Multimedia N<strong>et</strong>works and Services’97. Montréal, Canada, juill<strong>et</strong> 1997.<br />
[5] R. Khosla <strong>et</strong> T. Dillon. Engineering Intelligent Hybrid Multi-Agent Systems. Kluwer Academic<br />
Publishers, 1997.<br />
[6] J. Feghhi, J. Feghhi, <strong>et</strong> P. Williams. Digital Certificates : Applied Intern<strong>et</strong> Security. Addison Wesley,<br />
1998.<br />
[7] C. Gransart, P. Merle, <strong>et</strong> J.-M. Geib. CORBA : des concepts à la pratique. Dunod, seconde édition,<br />
octobre 1999.<br />
[8] L.N. Foner. A security architecture for multi-agent matchmaking. Second International Conference on<br />
Multi-Agent Systems (ICMAS’96), décembre 1996.<br />
[9] P<strong>et</strong>er Stone. Layered Learning in Multiagent Systems. MIT Press, mars 2000.<br />
[10] T. Finin, R. Fritzson, D. McKay, <strong>et</strong> R. McEntire. KQML as an agent communication language.<br />
Proceedings of the Third International Conference on Information and Knowledge Management<br />
(CIKM’94), ACM Press, novembre 1994.<br />
[11] M. Henning <strong>et</strong> S. Vinoski. Advanced CORBA Programming with C++. Addison Wesley, 1999.<br />
[12] P.H. Winston. Artificial intelligence. Addison Wesley, seconde édition, 1984.<br />
92
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
A Time Stamped Virtual WORM System<br />
Abstract<br />
Apvrille� A. & Hughes� J.<br />
1: Storage Technology European Operation,<br />
1, Rd Point Général Eisenhower,<br />
31106 Toulouse, France<br />
Axelle Apvrille@storag<strong>et</strong>ek.com<br />
2: Storage Technology Corp.<br />
7600 Boone Avenue North,<br />
Minneapolis, MN 55428, USA<br />
jim@n<strong>et</strong>work.com<br />
When backup operators have to handle giga bytes of information daily, they usually find the task hard<br />
enough to leave security aside. This paper consequently intends to focus on proving documents’ authenticity<br />
regarding both content and date. In the context of WORM technology, it <strong>propos</strong>es a media independent tamper<br />
evident system - using original cryptographic hash function techniques - and secure time stamping within a<br />
given accuracy. Finally, time stamping upgrade mechanisms are <strong>propos</strong>ed to extend security guarantees over<br />
years.<br />
1. Introduction<br />
The increasing digitalization and computerization of business processes have led to a burst in data volumes.<br />
For instance, BNP Paribas faces a 150 Tera-Bytes backup weekly, Volkswagen roughly 100 Tera-Bytes daily...<br />
Dealing with such large amounts of data is far from being an easy task, but keeping that data over years as legal<br />
evidence adds up a significant challenge to the problem. As a matter of fact, several countries have recently<br />
agreed to the suitability of electronic records in court trials in respect to a few constraints [Esg00] [Adap00,<br />
�1316-1]. Commonly, electronic records are given the same legal value as any other handwritten evidence,<br />
provided they are considered authentic by the court.<br />
Typically, banks, insurances or Intellectual Property archive centers are concerned by the possibility of<br />
reproducing some former document in front of a court. For such organizations there is a clear need for<br />
a trustworthy archival system whose integrity and reliability (over years and volume) could not be argued<br />
with. More precisely, the requirements of such a system are data security (protecting against or d<strong>et</strong>ecting<br />
any alteration of data), longevity (dating documents precisely, and r<strong>et</strong>rieving them after years of storage) and<br />
performances (being able to process thousands of records without significantly downgrading performances).<br />
The traditional long-term electronic document storage media is optical disc [Afn01], commonly referred to<br />
as “WORM” (Write Once Read Many). But, actually, the WORM technology widens to any reliable system (a<br />
media, some piece of hardware equipment, software <strong>et</strong>c.) onto which data is written only once, and is trusted<br />
not to be modified: this is perfectly adapted to data integrity requirements. Unfortunately, regarding specific<br />
constraints of long term record archival, existing WORM technologies put a few security issues aside. This<br />
paper therefore intends to <strong>propos</strong>e a new kind of WORM system - a time stamped virtual WORM system - to<br />
improve those points.<br />
The paper is organized as follows. Existing WORM systems are described and evaluated in section 2. Then,<br />
we <strong>propos</strong>e and explain the mechanisms of our time stamped virtual WORM system in section 3, and analyze<br />
93
Apvrille & Hughes<br />
the improvements which have been made in section 4. Finally, section 5 deals with how time stamped virtual<br />
WORM systems can offer strong security features throughout years and future work to be done.<br />
2. WORM devices<br />
In this section, we first give an overview of existing WORM technologies. Then, we define precisely the threat<br />
model which is considered. Finally, we evaluate existing technologies with that threat model.<br />
2.1. Overview of existing WORMs<br />
WORM is a technology designed for permanent data records. Data may only be written once onto media and<br />
then becomes permanent (neither rewritable, nor erasable). On the contrary, read operations remain unlimited.<br />
Williams [Wil97] has made the following classification:<br />
P-WORMs (Physical - Write Once Read Many) are the best known. Recording creates a permanent<br />
physical change in the surface of the support in such a way that this area cannot be restored to its original<br />
state. Security is located at media level (see figure 1). For instance, a CD-R is a P-WORM.<br />
E-WORMs (Coded - Write Once Read Many) use a factory pre-recorded write once code located on the<br />
media itself. The code is pre-recorded by the manufacturer and then later recognized by the firmware<br />
that switches to an overwrite prevention mode. Note data may actually be recorded on a rewritable<br />
media. Security is at driver level (embedded code) and media level (pre-recorded code) - see figure 1.<br />
For instance, StorageTek’s [Abs00] technology is an E-WORM implementation.<br />
VolSafe�������<br />
S-WORMs (Software Write Once Read Many) use software to protect against overwriting (see figure 1).<br />
Consequently, an S-WORM is media-independent.<br />
Figure 1: Comparison b<strong>et</strong>ween different types of WORMs. The lock on the figure indicates where security<br />
actually resides.<br />
94
2.2. Threat model<br />
Time Stamped Virtual WORM System<br />
Basically, this paper is going to evaluate archival systems with a simple question: given access to electronic<br />
records, is it possible to guarantee their authenticity over years ?<br />
More precisely, we suppose the attacker has physical access to stored data (for instance he can r<strong>et</strong>rieve the<br />
tape cartridge or the disk which contains the data) and can use proper equipment for its manipulation. The<br />
purpose of this section is to make sure he cannot forge data und<strong>et</strong>ectably.<br />
A few possible vulnerabilities in this threat model have been d<strong>et</strong>ected:<br />
data �<br />
copy �<br />
� timing<br />
� hardware<br />
� bad<br />
integrity threat: attacker can possibly modify, truncate or erase data from the archival system.<br />
More precisely, there are two levels of security: protecting against tampering (making it “impossible” to<br />
modify) and d<strong>et</strong>ecting modifications (modifications are possible but will be d<strong>et</strong>ected).<br />
integrity threat: during a copy or a migration, attacker can possibly write som<strong>et</strong>hing different onto<br />
the copy, or ignore data he does not wish to copy. For long-term archival systems, this threat is important<br />
as data is very likely to be migrated from one system to another one (because former system has become<br />
obsol<strong>et</strong>e, or because it has expired...). To be sure document’s authenticity will not be disputed, one needs<br />
to prove copied data is strictly identical to original.<br />
threat: attacker can successfully change dates of records. For many formal documents, date is an<br />
important information. For instance, insurance contracts, business agreements or buying orders should<br />
not be backdated. Attackers can use two different approaches: forging dates, or using clock accuracy<br />
problems. If an attacker can s<strong>et</strong> up the date of an agreement so it has expired, he goes as far as altering<br />
the document’s validity. Combined with data integrity threats, he can also forge a compl<strong>et</strong>ely new buying<br />
contract and assign the date of his choice. Concerning time accuracy, requirements depends on security<br />
level to be obtained. At least, it is important to be able to provide a precision, and for instance state that<br />
clock is correct within a given accuracy.<br />
support dependency threat: attacker takes advantage of the fact security information cannot be<br />
migrated to new support. This threat concerns the storage system’s longevity. Suppose in a ten-year time<br />
backup operator would like to transfer all data onto a newer support that has b<strong>et</strong>ter performances, or that<br />
he has chosen for other reasons. If the secure storage system depends on hardware support data is written<br />
to, then migrating data without losing security information might not be possible.<br />
authentication threat: attacker takes advantage of the fact document is unproperly authenticated to<br />
dispute its reliability. For instance, imagine a company has signed a partnership agreement with another<br />
company. If one of them wishes to prove the agreement existed, he’ll have to reproduce the agreement<br />
signed by both of them. Actually, wh<strong>et</strong>her to sign or not to sign a document - and who should sign it - is a<br />
specific property of the document itself, and does not globally concern the storage system. Consequently,<br />
this paper will not address this issue, and will assume that this task is already achieved before g<strong>et</strong>ting to<br />
the archival system. The archival system will take signed or unsigned documents as input, wh<strong>et</strong>her this<br />
is required or not for each document.<br />
2.3. Defeating existing WORM technologies<br />
This paragraph intends to evaluate existing WORM technologies, according to the threat model established in<br />
�2.2. Results are summarized at table 1.<br />
First of all, concerning data integrity, S-WORMs show an obvious security hole: basic S-WORMs provide<br />
no data integrity d<strong>et</strong>ection, and protection is poor as support itself is not protected. Any skilled user can perform<br />
an und<strong>et</strong>ected record modification (or del<strong>et</strong>ion) by simply by-passing the WORM software and using a<br />
less restrictive one. E-WORM’s data integrity protection is not 100% sure, but is however more difficult to<br />
by-pass: attacker needs to ruin or reload the pre-recorded code. P-WORMs are relatively secure, as they are<br />
95
Apvrille & Hughes<br />
Table 1: Existing WORM features at a glance.<br />
Data integrity Data integrity de- Copy in- Hardware inde- Secure time<br />
protection tectiontegritypendency<br />
reference<br />
P-WORM yes (though not no bit-<br />
no no<br />
perfect)<br />
comparison<br />
(long)<br />
E-WORM yes, medium no “ no no<br />
Basic S-WORM yes, but poor no “ yes no<br />
Required features yes (or d<strong>et</strong>ection) yes (or protec- yes (opti- yes yes<br />
tion)mized)<br />
inherently non-rewritable. However, a closer analysis may reveal potential data integrity threats: for instance, a<br />
CD-R consists in a pattern of pits and lands that encode the information. Pits being permanent, it is impossible<br />
to re-write the disc with new information, however it is still possible to add new pits, and consequently slightly<br />
modify data on the CD-R.<br />
Second, concerning time integrity, all existing WORMs unfortunately lack secure dating of documents. In<br />
best cases, referenced time merely gives a vague idea of document’s creation date. For instance, on CD-Rs,<br />
when a file is written, CD File System also stores the creation date of the file on the media. However, there is<br />
absolutely no guarantee of accuracy for that date: it is provided “as is”.<br />
Third, S-WORMs are inherently independent of any hardware support, which is a good point. On the contrary,<br />
P- and E-WORMs are not. If data stored on a CD-R is moved to a CD-RW (re-writable media), anybody<br />
can obviously overwrite that data. Same problem occurs on E-WORMs: if you transfer data onto another system<br />
which does not recognize the pre-recorded code, the system will not switch to a non-writable mode and it<br />
will be possible to modify, overwrite, truncate or erase data without any restriction.<br />
Finally, checking copy integrity is possible (i.e. checking a copy is identical to the original), but with poor<br />
performances. For existing WORMs, there is basically no other solution than comparing each bit of data with<br />
the original.<br />
2.4. Virtual WORM <strong>propos</strong>al<br />
Actually, the whole problems boils down to the fact that existing WORM systems all pay attention to securing<br />
mechanisms that write information onto the media, but not to data itself. For instance, P-WORMs use<br />
physically non-rewritable non-erasable media. E-WORMs restrict and control writing operations. However,<br />
user data remains inherently unsecured.<br />
Virtual WORM’s basic idea is to focus on data’s security, instead of its writing mechanisms 1 . Then, when<br />
data is taken in charge by the system’s mechanisms and physically written, data is already secured.<br />
Mainly, the solution we <strong>propos</strong>e builds on S-WORMs. In�2.3, we have seen S-WORMs offer poor data<br />
integrity protection, and unfortunately, there’s not much to do about that. So, with virtual WORMs, we<br />
suggest to improve data integrity d<strong>et</strong>ection techniques that are suitable for legal evidence documents. To do so,<br />
virtual WORMs make an extensive use of cryptographic mechanisms. Moreover, a signature-based time stamp<br />
protocol is added to virtual WORMs to provide a secure time reference functionality (see section 3).<br />
1 US-patent 2001-075-TOU “Virtual WORM m<strong>et</strong>hod and system” pending.<br />
96
Time Stamped Virtual WORM System<br />
Finally, we’ll demonstrate the resulting time stamped virtual WORMs are independent of hardware support<br />
and optimize copy integrity (section 4).<br />
3. A Time Stamped Virtual WORM System<br />
In this section, we’ll first explain how our time stamped virtual WORM system works, and then analyze its<br />
resistance to previously exposed threat model in�2.2.<br />
3.1. General overview of the system<br />
The system this paper <strong>propos</strong>es is based on a chain hashing technique (using one-way hash functions[MOV96,<br />
�9] over blocks of data) and on secure time stamping with digital signatures:<br />
� step<br />
� step<br />
1: chain hashing the input<br />
1. split data D in multiple data blocks ,<br />
D=�������������<br />
2. hash each block with H a one-way hash function: �������������������,<br />
3. and then store hashes along with blocks.<br />
���������������<br />
2: secure time stamping<br />
1. time stamp the last block hash,<br />
2. digitally sign the time stamp,<br />
3. store time stamp and its signature.<br />
3.2. Down into time stamping mechanism<br />
and�����������������������<br />
L<strong>et</strong> us now have a closer look to the time stamping mechanism. From a generic point of view, [Roos99] defines<br />
a time stamp as a “token that binds information about time with the bit string”. Actually, this definition does<br />
not make any assumption about security. However, in the context of this paper, time stamps are useless if time<br />
cannot be certified within a given accuracy. So, basically, the stamping protocol consists in signing a time<br />
stamp token containing time� current and hash of document to time stamp:�������������������������.<br />
The signing key pair (PrvK, PubK) belongs to an entity named Time Stamp Authority (shortened TSA), and<br />
is certified by a public key certificate. Time stamp’s security is guaranteed by the signature. The verification<br />
process consists in comparing document’s hash with the H(D) contained in time stamp token, verifying validity<br />
of TSA’s certificate and finally verifying time stamp’s signature.<br />
value�������<br />
On a performance point of view, time stamping being a “long” operation (RSA signatures are much longer<br />
than SHA-1 hashes for instance), this paper <strong>propos</strong>es an improvement for virtual WORM systems. Similarly to<br />
[BHS93,�2.2] where multiple blocks are time stamped tog<strong>et</strong>her in a round, we suggest to time stamp tog<strong>et</strong>her<br />
multiple blocks. To do so, we simply time the last block hash. For a given round, with input<br />
�����������������������, time stamped virtual WORM’s output is:<br />
stamp�¥����<br />
Block hashes are chained depends<br />
Recursively, is linked to �������������������. So, time stamping is equivalent to time stamping<br />
�������������������:all blocks are time stamped tog<strong>et</strong>her through last block hash (note this is true because we are ������ ������ so������<br />
��������������������������������������������<br />
and������, and����������...<br />
���������������������������������������������������������������������������������<br />
from���������� and���������� from����������<br />
97
Apvrille & Hughes<br />
using chain hashing: if we were hashing each block independently, each block would need to be timestamped).<br />
This increases performances as time stamping will only be done once in a while, but of course, it is impossible<br />
to order chronologically blocks within a same round: all blocks of round r are considered to at� exist the time<br />
stamp time of������. Consequently, implementations must find a balance b<strong>et</strong>ween performances (time stamping<br />
less frequently) and time stamp accuracy (time stamping often).<br />
3.3. Cryptographic hardware on time stamped virtual WORM<br />
Time stamp protocol described in �3.2 relies on an unconditional trust of the TSA. If TSA’s keys are<br />
compromised, or if TSA can be bribed, time stamp can no longer be trusted. Many researchers have worked<br />
on solutions to loosen this trust. [HS91,�5.1,�5.2] have <strong>propos</strong>ed a linking scheme in which each time stamp<br />
response is linked to previous responses, and a distributed scheme for which the final time stamp is built upon<br />
responses of multiple TSAs. [BHS93, BdM91] have then <strong>propos</strong>ed tree schemes that publish a time stamp<br />
response out of the root of a binary tree of time stamp requests. Finally, [BLLV98] have suggested a binary<br />
linking scheme based on rounds and hash functions.<br />
Those solutions do loosen trust level of TSAs, but they unfortunately complicate the verification process<br />
of time stamp responses: either multiple time stamps need to be r<strong>et</strong>rieved, or a round value, or previous time<br />
stamps <strong>et</strong>c (see [PRQMS98] for more precisions). For long term storage system, such design are usually<br />
impratical: for instance, in the linking scheme, verification process would have to r<strong>et</strong>rieve all previous time<br />
stamps of the last 10 or 20 years...<br />
In this paper, we’d like to find a compromise b<strong>et</strong>ween convenience and trust of TSA. Consequently, we<br />
suggest to use a dedicated tamper-evident (and if possible tamper-proof) time stamper hardware card. This<br />
card would consist in:<br />
on-board �<br />
two �<br />
cryptographic processors dedicated to time stamping, responding to a limited API such as<br />
timestamp() , generateNewTSAKeys() and g<strong>et</strong>PublicKey(). Access to TSA’s private key<br />
should be strictly forbidden.<br />
internal clocks: first clock is s<strong>et</strong> up at factory level and cannot be updated, second clock is used to<br />
time stamp documents and is synchronized from time to time through a secure link to an external reliable<br />
clock (an atomic clock for instance) under some very restrictive conditions 2 . For instance, second clock<br />
can only be re-synchronized if suggested update is very close to its current value, and if it hasn’t drifted<br />
too far away from first clock. This idea is interesting because it does not require a permanent link to an<br />
external reference clock but only from time to time.<br />
The whole time stamper card should behave as an opaque module, strictly forbidding (and d<strong>et</strong>ecting) any<br />
access to its internal components. For instance, FIPS 140-2 [NIST01] classifies different levels of security<br />
requirements for cryptographic modules, and a few selected trusted/governmental organizations accept to test<br />
and certify equipments according to FIPS 140-2 levels. Unconditional trust of TSA is then moved forward to<br />
unconditional trust of certifying organization. Depending on the security level which has been attributed to the<br />
card, a time stamp verifier can decide wh<strong>et</strong>her or not to trust the equipment.<br />
3.4. Performances of our implementation<br />
Practically, a Time Stamped Virtual WORM prototype has been implemented in Java. It is capable of processing<br />
a given input stream (multiple files, directories or a tape), adding security data (we also refer to this as the<br />
“WORMing” process) and writing the output to a directory or a tape. In our prototype, data is split into fixed<br />
size blocks (default is 256KB), then chain hashed using SHA-1. At the end of each file (or at each tape mark on<br />
a tape), the last block hash is time stamped using a Sha1WithRSA signature (key size can be configured) and the<br />
2 Pending US-patent number 2001-072-TOU “Trusted High Stability Time Source”.<br />
98
Time Stamped Virtual WORM System<br />
host’s local clock. The time stamp’s format complies to [TSP01] 3 . All cryptographic operations are currently<br />
done by the software (standard algorithm implementations of Sun’s JDK), the only hardware we attach to our<br />
prototype are two 9840 tape drives we read and write to.<br />
Figure 2 shows the processing rates of our prototype for RSA-512, 1024 and 2048 signatures, compared<br />
to pure read/write rates on 9840 tapes (reading or writing files on tapes, without securing them). As we had<br />
expected it, the graph shows that time stamping less frequently gives b<strong>et</strong>ter performances. A compromise needs<br />
to be found for each application, depending on security and performance requirements.<br />
Mega-bytes per second<br />
9<br />
8<br />
7<br />
6<br />
5<br />
4<br />
3<br />
2<br />
1<br />
0<br />
1 10 100 1000<br />
Mega-bytes per tape mark or per time stamp<br />
"rsa512.dat"<br />
"rsa1024.dat"<br />
"rsa2048.dat"<br />
"comparison.dat"<br />
Figure 2: Performance of a Java Time Stamped Virtual WORM prototype, on an Ultra Sparc 10 (400 MHz),<br />
connected to two 9840 tape drives (one for input, the other for output). The highest curve is provided here<br />
for comparison: it is the copying rate from one tape to another without using our prototype. The other results<br />
show the “WORMing” rate in mega-bytes per second for RSA-512, 1024 and 2048 bit keys, according to how<br />
frequent time stamps are done. Time stamping is performed each time a tape mark is encountered. Each test<br />
has been done over a total volume of 10000 MB. On the X-axis, a logarithmic scale has been used.<br />
4. Security analysis of time stamped virtual WORM systems<br />
In the light of threat model in�2.2, this section intends to analyze results of <strong>propos</strong>ed time stamped virtual<br />
WORM system regarding data, copy and time integrity, and hardware support dependency.<br />
3 Actually, the time stamp request strictly complies to [TSP01], but work is currently under progress to make the response really<br />
compl<strong>et</strong>ely match [TSP01]. However, the differences should not impact our performance results.<br />
99
Apvrille & Hughes<br />
4.1. Data integrity<br />
Concerning data integrity, over long periods of archival, both accidental (for instance a media support failure ?)<br />
or intentional errors (a human attacker) may alter data. We believe in best cases the chain hashing mechanism<br />
will d<strong>et</strong>ect it, or at worst the time stamp’s digital signature.<br />
For instance, block��� if is replaced or erased (accidentally, or intentionally) by�����, the low probability<br />
of collisions of hash function H guarantees ���������������������������. Modification is<br />
consequently d<strong>et</strong>ected in its block hash. that�¥�����������������������������<br />
Now, l<strong>et</strong> us suppose both data block and block hash are modified4 (see table 2), ���������������������. By the way, note such an attack is probably a human attack as it is highly unlikely an accidental<br />
error would produce the corresponding value for�����. Such an error is not spotted immediately:<br />
and�������<br />
with�����<br />
1. Before index i, there’s no problem: hashes match blocks.<br />
2. At index i, we read�����, calculate�������������������������, and read�����. Error is not d<strong>et</strong>ected y<strong>et</strong> because<br />
. ���������<br />
3. Then, at index i+1, we read�������, and calculate�������������������������,which is different �������������������. That’s where we d<strong>et</strong>ect the error.<br />
from���������<br />
Table 2: A “smart” attack: block data is replaced by a new value, and block’s hash is forged to correspond to<br />
new block<br />
Expected data Real data<br />
��������������� ��� ���������������<br />
��� ��������������������� ����� �¥�����������������������<br />
���<br />
��������������������� ��� �����������¥����������� �������¥�����������<br />
��� ��������������������� ��� ���������������������<br />
���<br />
So, the attack does not actually succeed. It only differs and diffuses the error, but the error will be d<strong>et</strong>ected.<br />
If the attacker wants to delay d<strong>et</strong>ection of���’s modification as much as possible, he’ll have all�¡<br />
to modify<br />
with ¢¤£��, but then error will be d<strong>et</strong>ected at time stamp’s verification. As a matter of fact, either the last block<br />
hash has been modified to�����but not the time stamp, and then time stamp does not correspond to�����, or both<br />
last block hash and time stamp token are modified and�������������, but then time stamp token’s signature<br />
fails �����������������������. The attacker cannot build a fake signature because he does not<br />
own TSA’s private key.<br />
because�������������������������<br />
to�¥���<br />
����� ����� �����<br />
��� ������������������������� ��� �������������������������<br />
�����<br />
In such cases, one may consequently jump to the conclusion that the intermediate chain hashes are useless,<br />
and that the whole system could work only with digitally signed time stamps. Technically speaking, when<br />
dealing with human attacks, this is true, but one should keep in mind that the system is meant to store thousands<br />
of tera bytes and that we are therefore very much concerned by performance... and accidental failures. In<br />
most cases, two records will be accidentally swapped, or a record will be s<strong>et</strong> to zeros (¥¦¥§¥ �����¨¥§¥§¥ ) or ones<br />
(�����������������). Based on frequent errors, a recovery program could try the most obvious fixes and check wh<strong>et</strong>her<br />
data then corresponds to its hashes (see figure 3). How the recovery program is implemented is far beyond the<br />
scope of this paper and highly depends on the support data is written to. The important point here is that if the<br />
recovery program suggests a fix, it is possible to prove with a 100% guarantee if that fix is correct or not. For<br />
legal evidence, this point is very important: on standard systems, if data has been damaged and the operator<br />
4 Same analysis may be applied if block and its hash are erased.<br />
100
Time Stamped Virtual WORM System<br />
finally manages to recover it, there is no proof recovered data is identical to the original. Concr<strong>et</strong>ely, this means<br />
recovered data can be disputed.<br />
Figure 3: Sure validation of recovery using chained hashed blocks. An error is d<strong>et</strong>ected in the r<strong>et</strong>rieved file. The<br />
recovery program suggests two different solutions. The first solution is okay, verifying chained hashes proves<br />
the recovery is correct. Second solution is erroneous : an error is d<strong>et</strong>ected in chained hashes.<br />
So, the benefits of chain hashing are:<br />
performances:<br />
error<br />
�<br />
�<br />
� proof<br />
they make it possible to time stamp multiple blocks in a round (see�3.2),<br />
location: except for human attacks, intermediate hashes will d<strong>et</strong>ect accidental failures without<br />
having to wait till the next time stamp (in 5, 10 or 20 MB for instance),<br />
of correct recovery: a fix can be proved to be correct or not.<br />
4.2. Copy integrity with time stamped virtual WORMs<br />
“Classical” WORM systems may achieve copy integrity by comparing bit to bit original data and its copy, but<br />
this is clearly not very efficient. This paper <strong>propos</strong>es to use block hashes that have been stored for data integrity.<br />
Suppose we have a time stamp virtual WORM tape that stores secure documents :<br />
©��<br />
is copied to ©��. Verifying copy integrity on<br />
1.<br />
���������������������������������������������������������������<br />
checking hash blocks (���) on and<br />
©�� ©��<br />
©�� ©��<br />
2. checking time stamp signature on and ©�� ©��<br />
in:<br />
consists<br />
are identical ;<br />
identical.<br />
are<br />
Using 256 KB blocks, SHA-1 and RSA-2048, each block hash has a size of 20 bytes, and time stamp token<br />
and its signature have an approximate size of 1 KB (256 bytes for the signature, 20 bytes for the hash, and the<br />
101
Apvrille & Hughes<br />
rest for TSA’s certificate or other param<strong>et</strong>ers – this is an approximation). Consequently, for a 1 Giga byte file,<br />
copy integrity algorithm will only check������¨��� �������<br />
��������� ¥���� have to . Only 0.008 % of the file has been bit<br />
to bit compared...<br />
4.3. Time integrity<br />
Concerning time integrity, an attacker cannot date� alter contained in the time stamp token. If he tries<br />
change�<br />
to<br />
to���,verification of time stamp token’s signature fails �������������������������.<br />
:�����������������������<br />
4.4. Hardware support dependency<br />
Time stamped virtual WORM are independent of hardware supports as they are based on S-WORMs (�2.1). For<br />
instance, if data on a first time stamped virtual WORM is output to a magn<strong>et</strong>ic tape, and needs to be transferred<br />
onto a disk, there is no security problem. Actually, data written on the tape is already secured, and whatever<br />
support data is transfered to, it remains secured. So, time stamped virtual WORMs are truly independent of<br />
hardware support. One should however note that they are not entirely hardware independent: in�3.3 use of a<br />
time stamper card has been suggested. Fortunately, this should not be too limitative as the card should be built<br />
as a stand-alone module responding to strict API specifications. If in 10 years the card needs to be replaced (for<br />
instance because the on-board clock is out of service), we just need to find another hardware card compatible<br />
with the API.<br />
5. Extending security over years and future work<br />
Over long periods, storage systems will have to face multiple problems, such as :<br />
hardware<br />
recovery<br />
upgrade<br />
�<br />
�<br />
�<br />
synchronization<br />
renewal<br />
compromission<br />
�<br />
�<br />
�<br />
drive failures,<br />
of lost data (disk crash...),<br />
to newer media support (with more capacity, b<strong>et</strong>ter resistance...),<br />
of time stamper’s internal clock,<br />
of TSA’s key pairs,<br />
of keys or algorithms...<br />
We believe this paper has addressed problems which concern hardware related problems. For instance,<br />
hardware support independency will help use another support in case of a drive failure (�4.4), copy integrity<br />
will help migrate all data onto another media (�4.2) and intermediate hashes help recover data (�4.1).<br />
This paper has also explained how time stamping clock could be kept accurate, using from time to time a<br />
secure link with an external clock (�3.3).<br />
Concerning TSA-related problems, a few solutions have already arisen but are beyond the scope of this<br />
single paper. Basically, work is currently under progress for:<br />
“just-in-time” �<br />
and �<br />
upgrade procedures: changing keys or algorithms just before they might become<br />
compromised,<br />
Certificate Revocation List (CRL) system for the TSA to be able to renew its key pairs from time to<br />
time.<br />
102
Time Stamped Virtual WORM System<br />
In�3.4, we have presented the performances of our software prototype. Issues now concern integration<br />
of this prototype to other high performance storage systems, such as RAIT[HMD01] (Redundant Array of<br />
Inexpensive Tapes), and optimization of performances on a dedicated hardware time stamper card prototype.<br />
6. Conclusion<br />
This paper has tried to contribute to security aspects of storage systems meant to keep document over years,<br />
with direct application to documents to be reproduced as legal evidence.<br />
The concept of virtual WORM has been introduced as a new solution to existing WORMs’ limitations.<br />
Instead of securing the media, the drive or the system which manages data, virtual WORM focus on directly<br />
securing data itself.<br />
To do so, a data integrity d<strong>et</strong>ection technique based on cryptographic hash functions is used, and followed<br />
by a digitally signed time stamp. This makes it possible to d<strong>et</strong>ect any modification of data, and provides a<br />
high probability of valid recovery over accidental modifications. Using both intermediary hash functions and<br />
digital signatures offers a good compromise b<strong>et</strong>ween performance (hash functions are fast) for large volumes<br />
of data and security (signature cannot be forged). Finally, we have demonstrated time stamped virtual WORMs<br />
improve hardware independency, and time and copy integrity features. Those properties are particularly useful<br />
for data meant to be kept over long periods.<br />
7. Acknowledgements<br />
We would like to thank Jacques Debiez for time he has accepted to spend with us sharing along his ideas<br />
concerning physical WORM systems and clock synchronization. We also wish to thank Vincent Girier for his<br />
helpful reviews and comments.<br />
References<br />
[Adap00] Adaptation du droit de la preuve aux technologies de l’information <strong>et</strong> relative à la signature<br />
électronique, Loi n. 2000-230, in Journal Officiel du 14 mars 2000, p. 3968, France, March 13,<br />
2000, in French.<br />
[Afn01] Archivage électronique - <strong>Spécification</strong>s relatives à la conception <strong>et</strong> à l’exploitation de systèmes<br />
informatiques en vue d’assurer la conservation <strong>et</strong> l’intégrité des documents stockés dans ces systèmes,<br />
French standard AFNOR, NF Z42-013, December 2001, in French.<br />
[Abs00] L. Absher, VolSafe(TM): A Discussion of Non-erasable, Non-rewritable Tape for the business<br />
environment, White Paper, Louisville CO, July 2000.<br />
[BdM91] J. Benaloh and M. de Mare, Efficient Broadcast Time-Stamping, Technical Report TR 91-1, August<br />
1991.<br />
[BHS93] D. Bayer, S. Haber and W. S. Storn<strong>et</strong>ta, Improving the Efficiency and Reliability of Digital<br />
Time-Stamping, In R.M Capocelli, A. de Santis and U. Vaccaro, editors, Sequences II: M<strong>et</strong>hods in<br />
Communication, Security and Computer Science, pp 329-334, Springer Verlag, New York, 1993.<br />
[BLLV98] A. Buldas, P. Laud, H. Lipmaa and J. Villemson, Time-Stamping with Binary Linking Schemes,<br />
in Advances on Cryptology (CRYPTO’98), H. Krawczyk Ed., vol. 1462 of Lecture Notes in Computer<br />
Science, Springer, pp 486-501, 1998.<br />
103
Apvrille & Hughes<br />
[Esg00] Electronic Signatures in Global and National Commerce Act (“E-Sign”), Public Law 106-229, U.S.A,<br />
June 2000.<br />
[HMD01] J. Hughes, C. Milligan, J. Debiez, High Performance RAIT, Tenth NASA Goddard Conference<br />
on Mass Storage Systems and Technologies and Nin<strong>et</strong>eenth IEEE Symposium on Mass Storage Systems,<br />
Maryland, U.S.A, April 2002.<br />
[HS91] S. Haber and W. S. Storn<strong>et</strong>ta, How to Time-Stamp a Digital Document, Journal of Cryptology, Vol.3,<br />
No.2, pp.99-111, 1991.<br />
[MOV96] A. Menezes, P. van Oorschot, S. Vanstone, Handbook of Applied Cryptography, CRC Press, ISBN<br />
0-8493-8523-7, October 1996.<br />
[NIST01] National Institute of Standards and Technologies, NIST FIPS PUB 140-2, Security Requirements<br />
for Cryptographic Modules, U.S. Department of Commerce, August 17, 2001.<br />
[PRQMS98] B. Preneel, B. Van Rompay, J-J Quisquater, H. Massias, J. Serr<strong>et</strong> Avila, TIMESEC: Design of a<br />
timestamping system, Technical Report WP3, 1998.<br />
[Roos99] M. Roos, Integrating Time-Stamping and Notarization, Master’s thesis, 1999.<br />
[TSP01] C. Adams, P. Cain, D. Pinkas, R. Zuccherato, Intern<strong>et</strong> X.509 Public Key Infrastructure Time Stamp<br />
Protocol (TSP), N<strong>et</strong>work Working Group, RFC 3161, August 2001.<br />
[Wil97] R. Williams, P-WORM, E-WORM, S-WORM Is a Sausage a Wienie ?, Chicago IL, January 1997.<br />
104
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
Contrôle d’intégrité de la séquence de démarrage<br />
d’un ordinateur<br />
Résumé<br />
Noël Cuillandre��� & F. Chabaud�<br />
1: CFSSI<br />
51, boulevard Latour-Maubourg<br />
75700 Paris Cedex SP, France<br />
noel.cuillandre@wanadoo.fr<br />
2: SGDN/DCSSI/SDS/LTI<br />
51, boulevard Latour-Maubourg<br />
75700 Paris Cedex SP, France<br />
florent.chabaud@polytechnique.org<br />
La séquence de démarrage d’un ordinateur commence à la mise sous tension de la machine <strong>et</strong> se<br />
termine lorsque le système d’exploitation est complètement chargé. On peut voir c<strong>et</strong>te séquence comme<br />
une succession d’étapes qui mèneront l’ordinateur d’un état de repos (ordinateur éteint) à un état utilisable<br />
(système d’exploitation activé <strong>et</strong> prêt à exécuter les applications des utilisateurs).<br />
C<strong>et</strong> article <strong>propos</strong>e une méthode de contrôle d’intégrité de la fin de la séquence de démarrage. C<strong>et</strong>te<br />
méthode a été développée sur un PC mono-processeur de type Intel équipé des systèmes d’exploitations<br />
Windows 95 <strong>et</strong> Linux, mais elle est généralisable à tout autre système d’exploitation, ainsi qu’à des<br />
architectures matérielles différentes.<br />
1. Introduction<br />
La sécurisation d’un ordinateur consiste à renforcer sa configuration pour assurer en particulier un<br />
cloisonnement entre les différents utilisateurs <strong>et</strong> entre les données auxquelles ils peuvent accéder. Toutefois,<br />
c<strong>et</strong>te configuration est amenée à évoluer dans le temps, notamment suite à l’installation de nouveaux logiciels.<br />
C<strong>et</strong>te configuration peut aussi être altérée par un attaquant ayant réussi un instant à prendre le contrôle de la<br />
machine, pour lui perm<strong>et</strong>tre d’y accéder ultérieurement, même si la faille utilisée a disparu par suite de la mise<br />
à jour du logiciel vulnérable. Le contrôle de l’intégrité de la configuration de la machine est donc important<br />
pour perm<strong>et</strong>tre de vérifier régulièrement que c<strong>et</strong>te configuration n’a pas été altérée. A contrario, détecter une<br />
altération de la configuration peut constituer un signal indiquant que la machine a subi une attaque. L’objectif ici<br />
est donc d’empêcher qu’un attaquant ayant réussi un instant à prendre le contrôle total de la machine protégée,<br />
puisse avoir la possibilité d’effectuer des modifications de configuration indétectables sur c<strong>et</strong>te machine.<br />
La configuration d’un ordinateur est principalement contenue dans le système de fichiers utilisé par le<br />
système d’exploitation. Pour contrôler c<strong>et</strong>te configuration, de nombreux outils existent dont le plus connu est<br />
TRIPWIRE [KS94]. Ce logiciel perm<strong>et</strong> en eff<strong>et</strong> de sauvegarder l’empreinte cryptographique d’un ensemble<br />
de fichiers à un instant � . Ultérieurement, il est alors possible de contrôler que les fichiers considérés n’ont<br />
pas été modifiés. Toutefois, pour que ce contrôle apporte une certaine garantie, il faut qu’il soit effectué<br />
indépendamment du système d’exploitation contrôlé. En eff<strong>et</strong>, si le système d’exploitation utilisé est altéré,<br />
Mis à disposition par le Ministère de la Défense (Armée de l’Air) pour un stage au centre de formation à la sécurité des systèmes<br />
�<br />
d’information.<br />
105
Cuillandre & Chabaud<br />
il peut très bien camoufler les modifications effectuées sur sa configuration. Un logiciel comme TRIPWIRE est<br />
donc à utiliser en initialisant la machine sur un système d’exploitation sûr.<br />
Reste que même si le logiciel de type TRIPWIRE est utilisé dans un système d’exploitation sûr, rien ne<br />
prouve que la machine dont la configuration a été contrôlée va effectivement initialiser c<strong>et</strong>te configuration.<br />
En eff<strong>et</strong>, la séquence de démarrage d’un ordinateur, qui est partie intégrante de c<strong>et</strong>te configuration, n’est pas<br />
située dans le système de fichiers <strong>et</strong> n’est donc pas directement contrôlable. C<strong>et</strong>te séquence est enregistrée au<br />
niveau de certains secteurs du disque <strong>et</strong> n’est pas accessible à travers le système de fichiers de haut niveau du<br />
système d’exploitation. Une altération de c<strong>et</strong>te séquence pourrait ainsi être parfaitement indétectable par des<br />
outils comme TRIPWIRE, tout en perm<strong>et</strong>tant à un attaquant d’initialiser un autre système d’exploitation que<br />
celui initialement installé <strong>et</strong> contrôlé.<br />
2. Séquence de démarrage d’un ordinateur<br />
La séquence de démarrage d’un ordinateur est un processus très variable selon le matériel utilisé. Certaines<br />
cartes de communication peuvent par exemple piloter la mise sous tension de l’ordinateur sur réception d’un<br />
signal en provenance du réseau (Ethern<strong>et</strong>, modem, <strong>et</strong>c.). Toutefois, dans le cas des ordinateurs de type PC, la<br />
séquence de démarrage proprement dite reste telle que spécifiée dans la description d’architecture [PCat84,<br />
PCxt86] <strong>et</strong> peut être découpée en trois étapes successives.<br />
2.1. Du processeur au BIOS<br />
La première étape est caractérisée par la prédominance d’événements de type matériel :<br />
1. À la mise sous tension de la machine, la carte mère envoie des signaux électriques à destination du<br />
processeur afin de le m<strong>et</strong>tre dans un état particulier RESET HARDWARE (cf. [IntelSys99][page 8.1]).<br />
2. Le processeur Intel entre alors en phase d’initialisation matérielle. C<strong>et</strong>te phase (cf. [IntelSys99][page<br />
8.1]) a pour but de m<strong>et</strong>tre les registres du processeur dans un état prédéfini <strong>et</strong> de basculer le processeur<br />
en mode d’adressage réel.<br />
3. Le processeur peut alors exécuter un test interne, le “Built-In Self-Test” (BIST), sur demande de la carte<br />
mère. À l’issue du test, une valeur nulle dans le registre EAX indique qu’aucune erreur n’a été détectée<br />
dans le processeur (cf. [IntelSys99][page 8.2]).<br />
4. Le processeur va ensuite exécuter la première instruction qui se trouve à l’adresse physique<br />
0xFFFFFFF0. À c<strong>et</strong>te adresse se trouve une instruction de saut vers le code d’initialisation du BIOS<br />
(cf. [Phoenix91][pages 95-100]).<br />
Bien que la séquence ici décrite soit celle d’ordinateurs de type PC, ce type de séquence est assez universel<br />
puisque la mise sous tension provoque en règle générale le lancement d’un programme à une adresse fixée. Les<br />
idées développées ci-après peuvent donc être adaptées en fonction des spécifications de telle ou telle machine,<br />
même si l’utilisation, par exemple, d’un processeur au jeu d’instructions différent nécessitera une adaptation.<br />
2.2. Le rôle du BIOS<br />
La seconde étape de la séquence de démarrage commence ensuite, elle a pour but de m<strong>et</strong>tre en place<br />
les structures de données nécessaires aux fonctions de gestion élémentaires de la machine. C<strong>et</strong>te étape se<br />
caractérise par l’exécution en mode réel de code externe au processeur. Ainsi le BIOS peut se voir comme une<br />
interface élémentaire entre le matériel <strong>et</strong> le logiciel (système d’exploitation <strong>et</strong>/ou application indépendante).<br />
Une des tâches les plus importantes attribuée au BIOS est de m<strong>et</strong>tre en place la table des vecteurs<br />
d’interruption. C<strong>et</strong>te table, qui débute à l’adresse physique 0x00000000, est constituée de �¦�§� mots de �§�<br />
bits. Chaque mot représente, sous la forme d’un couple (segment,offs<strong>et</strong>), l’adresse physique d’une routine<br />
106
Contrôle d’intégrité de la séquence de démarrage d’un ordinateur<br />
qui sera exécutée lorsque l’interruption ou l’exception concernée est déclenchée. Les interruptions sont des<br />
opérations provoquées soit par les composants matériels de la machine, soit par le logiciel en cours d’exécution.<br />
Elles perm<strong>et</strong>tent de suspendre l’exécution d’une instruction ou d’une application afin d’effectuer une action<br />
particulière puis de reprendre la suite normale de l’exécution de l’instruction ou de l’application.<br />
Modifier c<strong>et</strong>te table de vecteurs d’interruption perm<strong>et</strong> par exemple de détourner les modes d’accès aux<br />
différents périphériques (pour poser un espion clavier, par exemple). Il est donc indispensable, dans notre<br />
approche, que le BIOS soit lui-même intègre puisque nous allons, au cours de la simulation, utiliser certaines<br />
de ces interruptions.<br />
2.3. Du BIOS au système d’exploitation<br />
Lorsque le BIOS a terminé son initialisation, il exécute l’instruction INT ����� . Le processeur va alors<br />
lancer l’exécution du code pointé par l’entrée ����� de la table des vecteurs d’interruption. Ce sous-programme,<br />
appelé “boostrap loader”, a pour but de chercher le premier périphérique bootable selon un ordre prédéfini <strong>et</strong><br />
modifiable par le menu de configuration du BIOS. Si un disque bootable est trouvé, le premier secteur du disque<br />
est lu <strong>et</strong> copié en mémoire système à l’adresse 0000:7C00h (cf. [Phoenix91][page 101]). Le BIOS exécute<br />
alors la première instruction située à c<strong>et</strong>te adresse. C<strong>et</strong>te première instruction fait partie d’un bloc exécutable<br />
d’au plus 512 oct<strong>et</strong>s, qui a pour but de trouver le système d’exploitation sur le périphérique, de le charger en<br />
mémoire <strong>et</strong> de lancer son exécution. Ce bloc exécutable est mis en place soit lors de l’installation d’un système<br />
d’exploitation, soit lors de l’installation d’une application de gestion de démarrage.<br />
Dans le cas d’une machine MS-DOS, le bloc exécutable de 512 oct<strong>et</strong>s est le “Master Boot Record” ou<br />
DOS-MBR, qui va ensuite charger le premier secteur de la partition active, lequel va charger le fichier noyau<br />
command.com. Pour une machine linux, on trouve souvent installé le logiciel LILO [Alm98t] dans une<br />
configuration qui remplace le DOS-MBR par un LILO-MBR, lequel appelle ensuite une seconde phase de<br />
chargement stockée à d’autres endroits du disque, mais toujours inaccessible au système de fichiers de haut<br />
niveau. La finalité de ces processus est justement de perm<strong>et</strong>tre à ces p<strong>et</strong>its programmes de chargement d’accéder<br />
au programme principal, le noyau du système, sans disposer du système de fichiers.<br />
Quel que soit le BIOS utilisé, c’est au départ ce MBR qui est chargé <strong>et</strong> qui constitue donc la première étape<br />
de la séquence d’initialisation à contrôler.<br />
3. Intégrité de la séquence de démarrage<br />
Nous avons vu que la séquence de démarrage d’un ordinateur fait intervenir successivement trois acteurs<br />
principaux : le processeur, le BIOS <strong>et</strong> le système d’exploitation. Toute modification de l’intégrité de l’une de<br />
ces étapes est susceptible de perm<strong>et</strong>tre le contournement par un attaquant éventuel des dispositifs de sécurité<br />
du système d’exploitation lancé, comme l’ont démontré les virus de boot [Bon91, Bis92] <strong>et</strong> les détournement<br />
des appels systèmes [Ben01].<br />
Dans [AKS97] puis dans [AKFS98] a été <strong>propos</strong>ée une méthode de construction d’une séquence<br />
d’initialisation sécurisée par chaînage des différentes opérations. Chaque étape vérifie l’intégrité de l’étape<br />
suivante par une signature cryptographique. Moyennant l’hypothèse que le début de la séquence est intègre,<br />
on parvient ainsi à garantir l’intégrité de l’ensemble de la séquence. C<strong>et</strong>te approche présente toutefois<br />
l’inconvénient de ne pas pouvoir être appliquée à une séquence d’initialisation existante. Elle suppose au<br />
minimum le flashage du BIOS <strong>et</strong> l’installation d’outils de lancement spécifiques.<br />
Une nouvelle approche est donc <strong>propos</strong>ée pour contrôler la dernière partie de la séquence de démarrage,<br />
le lancement du système d’exploitation par le BIOS, sans avoir à modifier celle-ci. L’hypothèse initiale reste<br />
nécessaire, à savoir que le code du BIOS est supposé intègre.<br />
107
Cuillandre & Chabaud<br />
3.1. Principe<br />
L’idée de base est de démarrer un système sain extérieur (sur une disqu<strong>et</strong>te <strong>et</strong>/ou sur cédérom) <strong>et</strong> de<br />
contrôler l’intégrité des périphériques bootables de la machine. C<strong>et</strong>te idée est similaire à celle d’un contrôleur<br />
de fichiers comme TRIPWIRE [KS94]. Le mode d’utilisation de notre programme sera donc similaire à celui<br />
de TRIPWIRE <strong>et</strong> il sera même intéressant de réaliser les deux contrôles de façon simultanée. Comme dans<br />
le cas de TRIPWIRE, un premier calcul perm<strong>et</strong> d’obtenir l’empreinte de la séquence d’initialisation supposée<br />
intègre. C<strong>et</strong>te empreinte sera stockée sur un média amovible garantissant son intégrité. Par la suite, c’est par<br />
comparaison à c<strong>et</strong>te empreinte que l’intégrité de la séquence d’initialisation sera vérifiée. Comme dans la cas<br />
de TRIPWIRE, un contrôle périodique <strong>et</strong> automatique peut être envisagé, mais il ne perm<strong>et</strong> pas de garantir<br />
l’intégrité de la séquence. Seul un redémarrage de la machine contrôlée avec un système d’exploitation sain<br />
(boot sur disqu<strong>et</strong>te par exemple) perm<strong>et</strong> un contrôle valide.<br />
Mais à la différence de TRIPWIRE, il est nécessaire pour le contrôle de la séquence d’initialisation<br />
d’adopter une approche dynamique. En eff<strong>et</strong>, le simple contrôle statique du MBR (d’ailleurs effectué de<br />
façon native par certains BIOS) ne suffit pas, puisque le programme contenu dans ce MBR va appeler<br />
d’autres programmes situés dans d’autres secteurs du périphérique, voire dans d’autres périphériques. Contrôler<br />
globalement ces périphériques n’est pas possible puisqu’ils contiennent les données utilisateurs <strong>et</strong> sont en<br />
perpétuelle modification. Il convient donc de ne contrôler que le code effectivement exécuté depuis la première<br />
instruction à l’adresse 0000:7C00h jusqu’au lancement du système d’exploitation. Or, selon les programmes<br />
chargeurs <strong>et</strong> leurs configurations, ce code peut se r<strong>et</strong>rouver à tout endroit. Une configuration statique n’est donc<br />
pas envisageable <strong>et</strong> seule une interprétation du code va nous perm<strong>et</strong>tre de recoller les différents morceaux de la<br />
séquence d’initialisation.<br />
3.2. Simulateur<br />
Pour savoir exactement quel code est impliqué dans la séquence d’initialisation, un simulateur capable<br />
d’interpréter toutes les instructions utilisables en mode de fonctionnement réel du processeur a été développé.<br />
L’emploi d’un simulateur perm<strong>et</strong> d’exécuter le code dans un environnement sûr (principe du bac à sable<br />
employé sous Java [Gon98]). Ainsi, même si le code interprété a été modifié par un virus ou un autre moyen,<br />
aucune action dangereuse pour le système ne sera réellement accomplie. En outre, l’utilisation d’un simulateur<br />
s’impose aussi pour interpréter le code dans le contexte d’initialisation de la machine, qui est celui d’un<br />
processeur en mode réel.<br />
Afin d’avoir un bac à sable sûr, il est nécessaire de simuler l’action de certaines interruptions, telles que la<br />
lecture du clavier, <strong>et</strong> d’isoler les données qui sont en mémoire. Ainsi, une structure de données représentant<br />
la mémoire vive (RAM) est mise en place <strong>et</strong> contient toutes les données lues depuis le périphérique <strong>et</strong>/ou qui<br />
doivent être écrites en RAM.<br />
Par conséquent, la seule action autorisée sur les périphériques réels est la lecture de secteurs du périphérique<br />
concerné. C<strong>et</strong>te action utilisant une interruption au niveau du BIOS, il est indispensable que ce dernier soit<br />
intègre, tout du moins en ce qui concerne les accès en lecture aux disques.<br />
3.2.1. La machine virtuelle<br />
La machine virtuelle est constituée d’un processeur <strong>et</strong> d’une mémoire principale. Le processeur est une<br />
structure de données qui représente les registres internes nécessaires au fonctionnement en mode réel d’un<br />
processeur Intel [IntelArc97, chapitre 3]. La mémoire principale est représentée par une liste doublement<br />
chaînée de tableaux d’oct<strong>et</strong>s qui représentent chacun une page mémoire de 512 oct<strong>et</strong>s consécutifs. Les pages<br />
mémoires sont classées dans la liste par adresse physique croissante. Lors de la simulation, toutes les opérations<br />
de lecture <strong>et</strong> d’écriture en mémoire se font dans c<strong>et</strong>te liste. Pour les opérations d’écriture, les résultats sont<br />
sauvegardés dans la liste avec insertion d’une nouvelle page mémoire si nécessaire. Pour les opérations de<br />
lecture, une erreur est déclenchée si aucune des pages mémoires existantes ne contient l’adresse recherchée.<br />
108
3.2.2. Simulation du code<br />
Contrôle d’intégrité de la séquence de démarrage d’un ordinateur<br />
L’initialisation du simulateur consiste principalement à m<strong>et</strong>tre le processeur virtuel en mode de<br />
fonctionnement réel <strong>et</strong> à copier le MBR du périphérique concerné dans sa mémoire principale. Dans le cas<br />
d’une séquence d’initialisation d’un autre type que la séquence étudiée ici, le chargement s’effectuerait de<br />
façon similaire au niveau du périphérique contenant le début de la séquence de boot (EEPROM, cédérom,<br />
disqu<strong>et</strong>te, <strong>et</strong>c.) puisque ce périphérique doit de toute façon être accessible au processeur <strong>et</strong> au BIOS lors du<br />
démarrage.<br />
À l’issue de la procédure d’initialisation, le pointeur d’instruction du processeur virtuel pointe sur le premier<br />
oct<strong>et</strong> du MBR. Dès lors, le simulateur va entrer dans une boucle d’évaluation des instructions que l’on peut<br />
résumer par la procédure suivante :<br />
/*<br />
* Procédure d’évaluation d’une instruction:<br />
* [IN]<br />
* pip: pointeur sur le processeur virtuel.<br />
* [IN/OUT]<br />
* ptr: pointeur sur le bloc de code à simuler.<br />
*/<br />
int sim(intel_processor * pip,byte ** ptr)<br />
{<br />
intel_instruction ii; /* instruction à simuler */<br />
byte bytes_eaten; /* nombre d’oct<strong>et</strong>s consommés *<br />
* par l’instruction */<br />
}<br />
/* DECODAGE de l’instruction */<br />
mems<strong>et</strong>(&ii,0,sizeof(intel_instruction));<br />
g<strong>et</strong>_intel_instruction(SEG_16BITS,*ptr,&ii,&bytes_eaten,ptr);<br />
/* MISE À JOUR du pointeur *<br />
* d’instruction virtuel EIP */<br />
pip->EIP+=bytes_eaten;<br />
do_signature(pip,&ii); /* SIGNATURE du code simulé */<br />
/* EVALUATION de l’inst. */<br />
eval_intel_instruction(pip,&ii);<br />
/* MISE À JOUR du pointeur *<br />
* d’instruction réel */<br />
intel_s<strong>et</strong>_pointer_to_CSEIP(pip,(void **)ptr); /* ptr=CS:EIP*/<br />
r<strong>et</strong>urn 1;<br />
Dans c<strong>et</strong>te procédure, la fonction g<strong>et</strong>_intel_instruction a pour but de décoder le bloc d’oct<strong>et</strong>s pointés par<br />
ptr en un code d’opération valide suivi éventuellement d’une à trois opérandes, conformément au format défini<br />
par Intel [IntelRef97]. Puis la fonction eval_intel_instruction simule l’exécution de l’instruction décodée par<br />
le processeur virtuel. À la différence d’un désassembleur standard, le décodage ne se fait pas de façon linéaire<br />
lorsqu’une instruction de branchement est évaluée :<br />
109
Cuillandre & Chabaud<br />
branchement inconditionnel : l’interprétation se poursuit à l’adresse indiquée en paramètre.<br />
branchement conditionnel : le registre d’état EFLAGS est d’abord évalué, puis le décodage se poursuit<br />
à l’adresse indiquée en paramètre si la condition est vérifiée. Sinon, le décodage se poursuit avec<br />
l’instruction qui suit le branchement.<br />
C<strong>et</strong>te façon de procéder perm<strong>et</strong> d’une part de n’évaluer que les chemins d’exécutions possibles <strong>et</strong> d’autre part<br />
de travailler dans des cas où le code exécutable est fragmenté au milieu de données, ce qui est souvent le cas<br />
des séquences d’initialisation.<br />
3.3. Empreinte Cryptographique<br />
Bien entendu, tout le problème consiste à générer de façon déterministe une empreinte cryptographique de<br />
la séquence de démarrage malgré les branchements conditionnels présents dans le programme. C<strong>et</strong>te empreinte<br />
cryptographique servira ensuite à contrôler l’intégrité du programme de démarrage, plus précisément à garantir<br />
que seuls les chemins d’exécutions initialement prévus peuvent être exécutés. Pour cela, à chaque interprétation<br />
d’instruction, une fonction do_signature est appelée, qui calcule au fur <strong>et</strong> à mesure l’empreinte.<br />
C<strong>et</strong>te empreinte cryptographique peut être calculée en utilisant une fonction de hachage (par<br />
exemple [Riv92, SHA95]). Ainsi, toute modification dans le chemin d’exécution, telle qu’un branchement<br />
conditionnel non pris ou une itération en plus ou en moins dans une boucle, impliquera une modification de<br />
l’empreinte cryptographique.<br />
3.4. Quand s’arrêter ?<br />
3.4.1. Explosion combinatoire<br />
Un des problèmes principaux est de faire face à l’explosion combinatoire dans le cas où les chemins<br />
autorisés sont nombreux (cas typique d’une boucle de saisie). En eff<strong>et</strong>, dans ce cas, un unique chemin<br />
d’exécution ne peut être déterminé. Afin de pallier c<strong>et</strong>te difficulté, l’ensemble des chemins possibles est pris<br />
en compte. Dans un premier temps, le simulateur passe en mode exhaustif lorsque l’interruption clavier est<br />
utilisée. Ensuite, une procédure cartographie les chemins d’exécutions possibles :<br />
BOUCLE {<br />
SI instruction de branchement {<br />
SI non déterministe {<br />
SI non déjà visité OU contexte différent {<br />
->sauvegarde du contexte de simulation<br />
(structure processeur, mémoire) sur<br />
la pile de chemins<br />
}<br />
}<br />
}<br />
}<br />
simulation instruction courante<br />
instruction suivante<br />
Il faut remarquer que seules les instructions de branchement non déterministes, c’est-à-dire dépendant d’une<br />
interaction extérieure, sont susceptibles de poser problème. Si, par exemple, le chargeur calcule un CRC sur<br />
110
Contrôle d’intégrité de la séquence de démarrage d’un ordinateur<br />
le noyau qu’il est sur le point de charger, les données utilisées seront disponibles à notre simulateur <strong>et</strong> le<br />
fonctionnement sera déterministe.<br />
L’exhaustivité du parcours de l’arbre est toutefois difficile à assurer si le nombre d’options possibles<br />
est trop grand. On peut toutefois légitimement supposer que sur une machine sécurisée, le nombre de<br />
configurations possibles devra être restreint ; il est même probable que la séquence de démarrage soit<br />
parfaitement déterministe.<br />
3.4.2. Détection de fin de programme<br />
Le programme qui est interprété dans le simulateur est une séquence d’initialisation d’un système<br />
d’exploitation, c’est-à-dire un programme qui a vocation à ne jamais s’arrêter. Il est donc nécessaire de<br />
trouver un point d’arrêt pertinent à notre programme de calcul d’empreinte cryptographique de la séquence<br />
d’initialisation.<br />
Dans le cas des composants Intel, le choix a été fait d’arrêter le calcul de l’empreinte cryptographique<br />
lorsque le système d’exploitation fait passer le processeur en mode protégé.<br />
La documentation Intel[IntelSys99][section 8.8.1], indique que le passage du processeur en mode protégé<br />
se fait par l’exécution d’une instruction MOV CR0 qui active le drapeau PE du registre d’état EFLAGS. C’est<br />
donc lorsque c<strong>et</strong>te séquence est détectée que la signature calculée est considérée comme définitive.<br />
L’utilisation du mode protégé perm<strong>et</strong> un contrôle plus aisé de la mémoire par le système d’exploitation.<br />
Il est quasi-indispensable à tout système d’exploitation d’utiliser ce mode <strong>et</strong> le passage en mode protégé est<br />
donc un bon indicateur du fait que le simulateur est en train d’exécuter le code propre du noyau. Ce code est<br />
normalement contenu dans un fichier accessible, quant à lui, au niveau du système de fichiers de haut niveau.<br />
Le recouvrement ainsi obtenu entre le contrôle d’intégrité de la séquence de démarrage <strong>et</strong> le contrôle d’intégrité<br />
du système de fichiers réalisé à l’aide d’outils comme TRIPWIRE perm<strong>et</strong>, en théorie, de garantir l’intégrité de<br />
l’ensemble de la chaîne d’initialisation.<br />
3.4.3. Intégrité du noyau<br />
Même si en théorie, il est ainsi possible de contrôler l’intégrité de la séquence d’initialisation du noyau,<br />
en pratique, si le noyau charge dynamiquement des modules ou pilotes qui ne sont pas contrôlés en intégrité,<br />
alors il n’y a plus de garantie d’intégrité. C’est la raison pour laquelle des approches complémentaires comme<br />
LOMAC [LOMAC] ont été tentées.<br />
Le proj<strong>et</strong> LOMAC [LOMAC] représente une tentative de mise en place d’un contrôle d’accès obligatoire<br />
(MAC) non pénalisant pour les utilisateurs. Le contrôle d’accès obligatoire est dérivé du modèle “Low Water-<br />
Mark” [Bib77] <strong>et</strong> est implanté par un module chargeable dans une version 2.2 du noyau Linux (LKM). Sous<br />
LOMAC, le système est divisé en deux niveaux d’intégrité : haut <strong>et</strong> bas. L’idée est que les processus <strong>et</strong> fichiers<br />
de niveau bas représentent une menace potentielle pour l’intégrité du système. Les mécanismes de protection<br />
de LOMAC <strong>et</strong> du noyau s’ajoutent : la protection offerte par LOMAC est uniquement basée sur un niveau<br />
d’intégrité <strong>et</strong> non sur l’identification d’un utilisateur. Une opération sera permise seulement si LOMAC <strong>et</strong> le<br />
noyau décident de l’autoriser. Depuis juin 2001, un essai d’implémentation d’un LOMAC avancé avec plus<br />
de 2 niveaux est en cours de réalisation par NAI Labs [NAI]. Dans [Fra00] <strong>et</strong> [Fra01], Timothy Fraser, le<br />
principal concepteur de LOMAC, mentionne ses avantages <strong>et</strong> inconvénients par rapport à d’autres proj<strong>et</strong>s<br />
existants, dont KS OS [CD79], DTE [BSSW96], UCLA Secure Unix [PKKSUW79], <strong>et</strong> Secure-Enhanced<br />
Linux [LS01, SELINUX].<br />
111
Cuillandre & Chabaud<br />
4. Exemple d’utilisation sur LILO<br />
Lors de la mise au point du simulateur, de nombreux essais ont été réalisés sur le gestionnaire de démarrage<br />
pour Linux, LInux LOader [Alm98t]. Ce gestionnaire de démarrage perm<strong>et</strong> de lancer jusqu’à ��� systèmes<br />
d’exploitations.<br />
Lorsque LILO est installé comme gestionnaire de démarrage principal, le MBR contient le first stage boot<br />
loader. C<strong>et</strong>te portion de code a pour but de se transférer en mémoire, de charger <strong>et</strong> d’exécuter le second stage<br />
boot loader qui est la partie la plus importante puisqu’elle perm<strong>et</strong> l’interaction avec l’utilisateur <strong>et</strong> le choix du<br />
système d’exploitation à lancer.<br />
Nous avons vu que certains BIOS offrent une protection en écriture du MBR. Dans le cas de LILO, on ne<br />
peut garantir l’intégrité de la troisième étape de la séquence de démarrage avec ce type de protection. En eff<strong>et</strong>,<br />
LILO charge en mémoire de nombreux secteurs du périphérique qui contiennent, en plus du code exécutable,<br />
les données nécessaires à la localisation des secteurs de démarrage des systèmes d’exploitation.<br />
L’examen réalisé des deux étapes de LILO par le simulateur a permis de m<strong>et</strong>tre en évidence une incohérence<br />
dans la programmation du menu utilisateur en mode texte :<br />
– lorsque l’utilisateur commande l’affichage des systèmes d’exploitations disponibles, le programme ne<br />
parcourt pas les ��� champs possibles, mais s’arrête au premier champ vide détecté ;<br />
– lorsque l’utilisateur entre le nom d’un système d’exploitation, le programme vérifie systématiquement<br />
les ��� champs.<br />
C<strong>et</strong>te incohérence perm<strong>et</strong> d’insérer une séquence d’initialisation invisible à l’utilisateur (non <strong>propos</strong>ée dans<br />
l’interface) mais malgré tout accessible (l’option correspondante peut être saisie au clavier, elle sera activée).<br />
Par exemple, l’attaquant peut insérer une option toto qui va charger un noyau qu’il a lui-même modifié pour<br />
y avoir accès en toute circonstance. Ce noyau sera bien entendu situé dans la zone des données utilisateurs non<br />
contrôlable en intégrité.<br />
L’activation de c<strong>et</strong>te vulnérabilité nécessite un redémarrage de la machine <strong>et</strong> le code LILO pourra facilement<br />
être corrigé. Toutefois, même sans correction, l’utilisation de la méthode de contrôle <strong>propos</strong>ée perm<strong>et</strong>trait<br />
de détecter le branchement conditionnel supplémentaire qu’un attaquant pourrait ajouter en utilisant c<strong>et</strong>te<br />
faiblesse, puisque l’empreinte finale de la séquence d’initialisation en serait altérée.<br />
5. Conclusion<br />
Nous avons présenté une méthode de contrôle de l’intégrité de la séquence de démarrage d’un ordinateur de<br />
type PC depuis le lancement par le BIOS d’un secteur de démarrage MBR jusqu’au passage en mode protégé<br />
du processeur, supposé effectué par le noyau du système d’exploitation. C<strong>et</strong>te méthode suppose que le BIOS<br />
de la machine est intègre. Elle utilise un simulateur de processeur qui offre l’avantage de “suivre” l’exécution<br />
du code jusqu’au lancement du système d’exploitation, sans effectivement réaliser les opérations demandées.<br />
Un code viral qui se serait inséré dans la séquence d’initialisation ne serait donc pas réellement exécuté <strong>et</strong> ne<br />
pourrait empêcher sa détection.<br />
Avec l’utilisation simultanée d’un système de contrôle d’intégrité au niveau du système de fichiers,<br />
il est ainsi possible de détecter toute modification de la séquence de démarrage. À titre d’exemple, une<br />
incohérence dans le programme LILO a été mise en évidence, qui perm<strong>et</strong>trait à un attaquant d’insérer une option<br />
d’initialisation non présentée à l’utilisateur au niveau de l’interface de LILO. C<strong>et</strong>te option de branchement<br />
invisible serait toutefois détectée par la méthode <strong>propos</strong>ée.<br />
Remerciements<br />
Nous tenons à remercier les referees pour l’ensemble de leurs commentaires qui ont grandement contribué<br />
à l’amélioration espérée de c<strong>et</strong> article.<br />
112
Références<br />
Contrôle d’intégrité de la séquence de démarrage d’un ordinateur<br />
[AKFS98] W. A. Arbaugh, A. D. Keromytis, D. J. Farber, <strong>et</strong> J. M. Smith. Automated recovery in a<br />
secure bootstrap process. In Proceedings of the Intern<strong>et</strong> Soci<strong>et</strong>y Symposium on N<strong>et</strong>work and<br />
Distributed Systems Security (SNDSS), pages 155-167, Mars 1998.<br />
[AKS97] W. A. Arbaugh, D. J. Farber, <strong>et</strong> J. M. Smith. A secure and reliable bootstrap architecture. In<br />
Proceedings of the IEEE Security and Privacy Conference, pages 65-71, Mai 1997.<br />
[Alm98t] W. Almesberger. LILO Technical Overview, version 21, December 98.<br />
[Alm98u] W. Almesberger. LILO User’s Guide, version 21, December 98.<br />
[Ben01] W. C. Benton. Loadable kernel module exploits. Linux Journal, septembre 2001.<br />
[Bib77] K.J. Biba. Integrity Considerations for Secure Computer Systems, Electronic Systems Division,<br />
Hanscom Air Force Base, Bedford, MA, pages 27-31, Avril 1977.<br />
[Bis92] M. Bishop. An Overview of Computer Viruses in a Research Environment, 1992.<br />
[Bon91] V. Bontchev. The Bulgarian and Sovi<strong>et</strong> virus factories. In Proceedings of the First International<br />
Virus Bull<strong>et</strong>in Conference, Buckinghamshire, 1991.<br />
[BSSW96] L. Badger, D.F. Sterne, D.L. Sherman, <strong>et</strong> K.M. Walker. A domain and type enforcement UNIX<br />
prototype. USENIX Computing Systems, 1996.<br />
[CD79] E.J. McCamley <strong>et</strong> P.J. Drongowski. KSOS—The design of a secure operating system. In<br />
Proceedings of the National Computer Conference, vol. 48, AFIPS Press, pages 345-353, 1979.<br />
[Fra00] T. Fraser, LOMAC : Low water-mark integrity protection for COTS environments. In<br />
Proceedings of the 2000 IEEE Symposium on Security and Privacy, 2000.<br />
[Fra01] T. Fraser, LOMAC : MAC you can live with. In Proceedings of the FREENIX Track : USENIX<br />
Annual Technical Conference, Boston, Massachus<strong>et</strong>ts, juin 2001.<br />
[Gon98] L. Gong. Java 2 Platform Security Architecture, Sun Microsystems Inc., 1998.<br />
[IntelArc97] Intel Architecture Software Developer’s Manual, Volume 1 : Basic Architecture, 1997.<br />
[IntelRef97] Intel Architecture Software Developer’s Manual, Volume 2 : Instruction S<strong>et</strong> Reference, 1997.<br />
[IntelSpe96] Pentium Pro Family Developer’s Manual, Volume 1 : Specifications, 1996.<br />
[IntelSys99] Intel Architecture Software Developer’s Manual, Volume 3 : System Programming, 1999.<br />
[KS94] G. H. Kim, E. H. Spafford. The design and implementation of Tripwire : A file system integrity<br />
checker. In Proceedings of the 2nd ACM Conference on Computer and Communication<br />
Security. ACM Press, New York, 1994.<br />
[LOMAC] T. Fraser, Low water-mark mandatory access control (LOMAC) v1.1.2. http://<br />
opensource.nailabs.com/lomac/, février 2002.<br />
[LS01] P.A. Loscocco, S.D. Smalley, Integrating flexible support for security policies into the<br />
Linux operating system. In Proceedings of the FREENIX Track : USENIX Annual Technical<br />
Conference, Juin 2001.<br />
[NAI] N<strong>et</strong>work Associates Inc., http://opensource.nailabs.com/.<br />
[PCat84] International Business Machines Corporation. IBM Personal Computer AT Technical<br />
Reference, Boca Raton, FL, 1984.<br />
[PCxt86] International Business Machines Corporation. IBM Personal Computer XT and Portable<br />
Personal Computer Technical Reference, Boca Raton, FL, 1986.<br />
[Phoenix91] Phoenix Technologies Ltd. System BIOS for IBM PCs, Compatibles and EISA Computers.<br />
Addison Wesley, deuxième édition, 1991.<br />
113
Cuillandre & Chabaud<br />
[PKKSUW79] G.J. Popek, M. Kampe, C.S. Kline, A. Soughton, M. Urban, E.J. Walton, UCLA secure UNIX.<br />
In Proceedings of the National Computer Conference, vol. 48, AFIPS Press, page 355-364,<br />
1979.<br />
[RC95] M. Russinovich <strong>et</strong> B. Cogswell. Examining the Windows 95 Layered File System, Dr Dobb’s<br />
Journal, décembre 1995.<br />
[Riv92] R.L. Rivest. RFC 1321 : The MD5 Message-Digest Algorithm, Intern<strong>et</strong> Activities Board, 1992.<br />
[SELINUX] P. Loscocco. Security-Enhanced Linux, Information Assurance Research Group, National<br />
Security Agency, Avril 2001.<br />
[SHA95] FIPS 180-1. Secure Hash Standard, US Department of Commerce/NIST, 1995.<br />
114
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
1. Introduction<br />
Verifying Secrecy by Abstract Interpr<strong>et</strong>ation<br />
L. Bozga & Y. Lakhnech & M. Périn<br />
Vérimag<br />
2, avenue de Vignate<br />
38610 Gires, France<br />
� lbozga,lakhnech,perin� @imag.fr<br />
At the heart of almost every computer security architecture is a s<strong>et</strong> of cryptographic protocols that use<br />
cryptography to encrypt and sign data. They are used to exchange confidential data such as pin numbers<br />
and passwords, to authentify users or to guarantee anonymity of participants. It is well known that even under<br />
the idealized assumption of perfect cryptography, logical flaws in the protocol design may lead to incorrect<br />
behavior with undesired consequences. Maybe the most prominent example showing that cryptographic<br />
protocols are notoriously difficult to design and test is the Needham-Schroeder protocol for authentification. It<br />
has been introduced in 1978 [19]. An attack on this protocol has been found by G. Lowe using the CSP modelchecker<br />
FDR in 1995 [13]; and this led to a corrected version of the protocol [14]. Consequently there has been<br />
a growing interest in developing and applying formal m<strong>et</strong>hods for validating cryptographic protocols [15, 7].<br />
Most of this work adopts the so-called Dolev and Yao model of intruders. This model assumes idealized<br />
cryptographic primitives and a nond<strong>et</strong>erministic intruder that has total control of the communication n<strong>et</strong>work<br />
and capacity to forge new messages. It is known that reachability is undecidable for cryptographic protocols in<br />
the general case [10], even when a bound is put on the size of messages [9]. Because of these negative results,<br />
from the point of view of verification, the best we can hope for is either to identify decidable sub-classes as<br />
in [1, 21, 16] or to develop correct but incompl<strong>et</strong>e verification algorithms as in [18, 12, 11].<br />
In this talk, we present a correct but, in general, incompl<strong>et</strong>e verification algorithm to prove secrecy without<br />
putting any assumption on messages nor on the number of sessions. Proving secrecy means proving that secr<strong>et</strong>s,<br />
which are pre-defined messages, are not revealed to unauthorized agents. Our contribution is two fold:<br />
1. We define a concr<strong>et</strong>e operational model for cryptographic protocols, that are given by a s<strong>et</strong> of roles<br />
with associated transitions. In general, each transition consists in reading a message from the n<strong>et</strong>work<br />
and sending a message. Our semantic model allows an unbounded number of sessions and participants,<br />
where a participant can play different roles in parallel sessions. Secr<strong>et</strong>s are then specified by messages<br />
and are associated to sessions. All of this makes our model infinite. Therefore, we introduce a general and<br />
generic abstraction that reduces the problem of secrecy verification for all possible sessions to verifying a<br />
secr<strong>et</strong> in a model given by a s<strong>et</strong> of constraints on the messages initially known by the intruder and a s<strong>et</strong> of<br />
rules that describe how this knowledge evolves. Roughly speaking, the main idea behind this abstraction<br />
step is to fix an arbitrary session running b<strong>et</strong>ween arbitrary agents. Then, to identify all the other agents<br />
as well as their cryptographic keys and nonces. Thus, suppose we are considering a protocol where each<br />
session involves two participants playing the role ��� , respectively, ��� . We fix arbitrary participants, �<br />
and � , and an arbitrary session ��� . We identify all participants other than � and � and also identify all<br />
sessions in which neither � nor � are involved. Concerning the sessions, where � or � are involved<br />
except ��� , we make the following identifications:<br />
115<br />
� all sessions where � plays the role ��� (resp. ��� ), � plays the role ��� (resp. ��� ),
Bozga, Lakhnech, Périn<br />
all sessions where � (resp. B) plays the role of ��� (resp. ��� ) and the role ��� (resp. ��� ) is played by<br />
�<br />
a participant not in �<br />
, <strong>et</strong>c... �������<br />
Identifying sessions means also identifying the nonces and keys used in these sessions. This gives us<br />
a system described as a s<strong>et</strong> of transitions that can be taken in any order and any number of times but<br />
which refer to a finite s<strong>et</strong> of atomic messages. We then have to prove that the secr<strong>et</strong> is not revealed by<br />
these rules. Here, we should emphasize that, for instance, the m<strong>et</strong>hods of [6, 11] can profit from this<br />
abstraction as the obtained abstract system can be, in some cases, taken as starting point.<br />
2. Our second contribution is an original m<strong>et</strong>hod for proving that a secr<strong>et</strong> is not revealed by a s<strong>et</strong> of rules<br />
that model how the initial s<strong>et</strong> of messages known by the intruder evolves. In contrast to almost all existing<br />
m<strong>et</strong>hods, we do not try to compute or approximate the s<strong>et</strong>s of messages that can be known by the intruder.<br />
Our algorithm is rather based on the notion of ”the secr<strong>et</strong> being guarded, or kept under hat by a message”.<br />
For example, suppose that our secr<strong>et</strong> is the ��� nonce and consider the message �§�<br />
. Then,<br />
�¡�����¡�����������<br />
is guarded by �¡� �<br />
, if the inverse ���<br />
�<br />
� of ��� is not known by the intruder. The idea is then<br />
�������¡�������<br />
to compute a s<strong>et</strong> of guards that will keep the secr<strong>et</strong> unrevealed in all sent messages and such that the<br />
inverses of the keys used in this s<strong>et</strong> are also secr<strong>et</strong>s. The difficulty here is that this s<strong>et</strong> is, in general,<br />
infinite. Therefore, we introduce pattern terms which are terms used to represent s<strong>et</strong>s of guards. For<br />
instance the pattern term ��� ���<br />
����� says that the secr<strong>et</strong> will be guarded in any message �<br />
��� ���<br />
����� , �<br />
where the secr<strong>et</strong> is not a sub-message of �<br />
but may be a sub-message of ��� . The problem is, however,<br />
that there might be a rule ���<br />
that will send � unencrypted to the intruder if (s)he produces<br />
�����¦�������<br />
the message ���<br />
. Hence, the pattern �¨������� ��� ���<br />
����� will guard the secr<strong>et</strong> except when �<br />
�<br />
is � . Using<br />
this idea, we develop an algorithm that computes a stable s<strong>et</strong> of pattern terms that guard the secr<strong>et</strong>s in<br />
all sent messages. We developed a prototype in Caml that implements this m<strong>et</strong>hod. We have been able<br />
to verify several protocols taken from [4] including, for instance, the corrected version of the Needham-<br />
Schroeder protocol, different versions of Yahalom, as well as Otway-Rees.<br />
Related work Dolev, Even and Karp introduced the class of ping-pong protocols and showed its decidability.<br />
The restriction put on these protocols are, however, too restrictive and none of the protocols of [4] falls in this<br />
class. Recently, Comon, Cortier and Mitchell [6] extended this class allowing pairing and binary encryption<br />
while the use of nonces still cannot be expressed in their model. Reachability is decidable for the bounded<br />
number of sessions [1, 21, 16] or when nonce creation is not allowed and the size of messages is bounded [9].<br />
For the general case, on one hand model-checking tools have been applied to discover flaws in cryptographic<br />
protocols [13, 22, 17, 5]. The tool described in [5] is a model-cheker dedicated to cryptograhic protocols. On<br />
the other hand, m<strong>et</strong>hods based on induction and theorem proving have been developed (e.g. [20, 3, 8]). Closest<br />
to our work are partial algorithms based on abstract interpr<strong>et</strong>ation and tree automata that have been presented<br />
in [18, 12, 11]. The main difference is, however, that we do not compute the s<strong>et</strong> of messages that can be known<br />
by the intruder but a s<strong>et</strong> of guards as explained above.<br />
Another remark is that the operational semantics we provide in this paper is well-suited to investigate and<br />
relate several existing models that one can find in the literature such as the semantics using clauses to model<br />
transitions (e.g. [2]) or linear-logic (e.g. [9]). In an ongoing work, we use this semantics to prove relationships<br />
b<strong>et</strong>ween these models.<br />
References<br />
[1] R. M. Amadio <strong>et</strong> D. Lugiez. On the reachability problem in cryptographic protocols. In International<br />
Conference on Concurrency Theory, volume 1877, pages 380–394, 2000.<br />
[2] B. Blanch<strong>et</strong>. Abstracting cryptographic protocols by Prolog rules (invited talk). In Patrick Cousot, editor,<br />
8th International Static Analysis Symposium (SAS’2001), volume 2126 of Lecture Notes in Computer<br />
Science, pages 433–436, Paris, France, July 2001. Springer Verlag.<br />
116
Verifying Secrecy by Abstract Interpr<strong>et</strong>ation<br />
[3] D. Bolignano. Integrating proof-based and model-checking techniques for the formal verification of<br />
cryptographic protocols. Lecture Notes in Computer Science, 1427:77–??, 1998.<br />
[4] J. Clark <strong>et</strong> J. Jacob. A survey on authentification protocol. http://www.cs.york.ac.uk/˜jac/<br />
papers/drareviewps.ps, 1997.<br />
[5] E.M. Clarke, S. Jha, and W. Marrero. Using state space exploration and a natural deduction style message<br />
derivation engine to verify security protocols. In IFIP Working Conference on Programming Concepts<br />
and M<strong>et</strong>hods (PROCOMET), 1998.<br />
[6] H. Comon, V. Cortier, and J. Mitchell. Tree automata with one memory, s<strong>et</strong> constraints, and pingpong<br />
protocols. In Automata, Languages and Programming, 28th International Colloquium, ICALP<br />
2001, Cr<strong>et</strong>e, Greece, July 8-12, 2001, Proceedings, volume 2076 of Lecture Notes in Computer Science.<br />
Springer, 2001.<br />
[7] H. Comon <strong>et</strong> V. Shmatikov. Is it possible to decide wh<strong>et</strong>her a cryptographic protocol is secure or not?<br />
Journal of Telecommunications and Information Technology., paraître, 2002.<br />
[8] V. Cortier, J. Millen, and H. Rueß. Proving secrecy is easy enough. In Proc. 14th IEEE Computer Security<br />
Foundations Workshop (CSFW’01), Cape Br<strong>et</strong>on, Nova Scotia, Canada, June 2001, pages 97–110. IEEE<br />
Comp. Soc. Press, 2001.<br />
[9] N. Durgin, P. Lincoln, J. Mitchell, and A. Scedrov. Undecidability of bounded security protocols. In<br />
N. Heintze and Proceedings E. Clarke, editors, editors, Workshop on Formal M<strong>et</strong>hods and Security<br />
Protocols — FMSP, Trento, Italy, July 1999., 1999.<br />
[10] S. Even <strong>et</strong> O. Goldreich. On the security of multi-party ping pong protocols. Technical report, Israel<br />
Institute of Technology, 1983.<br />
[11] T. Gen<strong>et</strong> <strong>et</strong> F. Klay. Rewriting for Cryptographic Protocol Verification. In Proceedings 17th International<br />
Conference on Automated Deduction, volume 1831 of Lecture Notes in Artificial Intelligence. Springer-<br />
Verlag, 2000.<br />
[12] Jean Goubault-Larrecq. A m<strong>et</strong>hod for automatic cryptographic protocol verification. In Dominique Méry,<br />
Beverly Sanders, editors, Fifth International Workshop on Formal M<strong>et</strong>hods for Parallel Programming:<br />
Theory and Applications (FMPPTA 2000), number 1800 in Lecture Notes in Computer Science. Springer-<br />
Verlag, 2000.<br />
[13] G. Lowe. An attack on the Needham-Schroeder public-key authentification protocol. Information<br />
Processing L<strong>et</strong>ters, 56(3):131–133, November 1995.<br />
[14] G. Lowe. Breaking and fixing the Needham-Schroeder public-key protocol using fdr. In TACAS, number<br />
1055 in Lecture Notes in Computer Science, pages 147–166, 1996.<br />
[15] C. Meadows. Invariant generation techniques in cryptographic protocol analysis. In PCSFW: Proceedings<br />
of The 13th Computer Security Foundations Workshop. IEEE Computer Soci<strong>et</strong>y Press, 2000.<br />
[16] J. Millen <strong>et</strong> V. Shmatikov. Constraint solving for bounded-process cryptographic protocol analysis. In<br />
Proc. 8th ACM Conference on Computer and Communications Security (CCS ’01), pages 166–175, 2001.<br />
[17] J. C. Mitchell, M. Mitchell, <strong>et</strong> U. Stern. Automated analysis of cryptographic protocols using mur. In<br />
Proceedings of the 1997 Conference on Security and Privacy (S&P-97), pages 141–153, Los Alamitos,<br />
May 4–7 1997. IEEE Press.<br />
[18] D. Monniaux. Decision procedures for the analysis of cryptographic protocols by logics of belief. In 12th<br />
Computer Security Foundations Workshop. IEEE, 1999.<br />
117
Bozga, Lakhnech, Périn<br />
[19] R.M. Needham and M.D. Schroeder. Using encryption for authentication in large n<strong>et</strong>works of computers.<br />
CACM, 21(12):993–999, 1978.<br />
[20] L. Paulson. Proving properties of security protocols by induction. In 10th IEEE Computer Security<br />
Foundations Workshop (CSFW ’97), pages 70–83, June 1997. IEEE.<br />
[21] M. Rusinowitch and M. Turuani. Protocol insecurity with finite number of sessions is np-compl<strong>et</strong>e. In<br />
14th IEEE Computer Security Foundations Workshop (2001), pp. 174–190., 2001.<br />
[22] S. Schneider. Verifying authentication protocols with CSP. In 10th IEEE Computer Security Foundations<br />
Workshop (CSFW ’97), pages 3–17, June 1997. IEEE.<br />
118
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
<strong>Vérification</strong> de protocoles cryptographiques: la<br />
logique à la rescousse!<br />
Résumé<br />
Jean Goubault-Larrecq�<br />
1: LSV/CNRS UMR 8643 <strong>et</strong> <strong>ENS</strong> <strong>Cachan</strong>,<br />
61, avenue du président-Wilson,<br />
94235 <strong>Cachan</strong> CEDEX, France<br />
goubault@lsv.ens-cachan.fr<br />
La vérification de propriétés de sécurité de protocoles cryptographiques est une activité délicate <strong>et</strong><br />
importante. Après avoir passé en revue les principes de base de c<strong>et</strong>te activité, nous montrerons que la logique<br />
du premier ordre perm<strong>et</strong> à la fois une formalisation adéquate des protocoles cryptographiques <strong>et</strong> de certaines<br />
de leurs propriétés les plus courantes (secr<strong>et</strong>, authentication), <strong>et</strong> se prête bien à des mécanismes d’abstraction<br />
automatique qui en perm<strong>et</strong>tent une vérification automatique aisée. Le lien entre logique du premier ordre <strong>et</strong><br />
automates d’arbres y est ici fondamental.<br />
1. Introduction<br />
La sécurité des systèmes d’information est aujourd’hui un domaine en pleine effervescence, voire à<br />
la mode. Parmi les différents aspects de la sécurité informatique, la cryptologie <strong>et</strong> l’étude des protocoles<br />
cryptographiques a pris une importance considérable. La cryptologie est originellement l’étude des moyens<br />
perm<strong>et</strong>tant de transm<strong>et</strong>tre des messages secr<strong>et</strong>s, <strong>et</strong> remonte à l’antiquité. Depuis, la portée des méthodes<br />
cryptologiques s’est considérablement étendue, pour inclure des préoccupations de garantie d’authenticité <strong>et</strong><br />
d’intégrité des messages reçus par exemple. Mais aussi, comme la sécurité des messages repose sur l’usage de<br />
clés de chiffrement ou de signature, la cryptologie a dû aussi traiter des problèmes de distribution sécurisée de<br />
clés à des tiers, de révocation de clés supposées peu fiables, de récupération de clés perdues par des utilisateurs<br />
réputés honnêtes, <strong>et</strong>c.<br />
La cryptologie est donc un domaine riche [50], mais qui s’est longtemps limité essentiellement aux<br />
applications militaires. On peut considérer que le surgissement d’intérêt pour la cryptographie dans les années<br />
1990 <strong>et</strong> 2000 est dû au développement du commerce électronique. Ce dernier terme recouvre pour commencer<br />
les échanges chiffrés d’information qui ont lieu lorsque l’on r<strong>et</strong>ire de l’argent dans un distributeur de bill<strong>et</strong>s<br />
à l’aide d’une carte bancaire, où l’ordinateur qu’est le distributeur de bill<strong>et</strong>s s’engage dans un dialogue avec<br />
la carte du client <strong>et</strong> possiblement avec un serveur de la banque pour vérifier que l’utilisateur de la carte est<br />
honnête, dispose de la somme demandée sur son compte, <strong>et</strong> ne pourra pas récupérer les bill<strong>et</strong>s demandés<br />
sans que son compte en soit débité, notamment. Le commerce électronique recouvre aussi, par exemple, les<br />
paiements par carte à l’aide de terminaux portables, dans les supermarchés ou les restaurants, où l’utilisateur<br />
doit confirmer son identité en entrant son code PIN à quatre chiffres. Toutes ces applications demandent des<br />
garanties de sécurité élevées, portant sur des propriétés de secr<strong>et</strong> <strong>et</strong> d’authenticité comme ci-dessus, mais aussi<br />
de nombreuses autres propriétés, parmi lesquelles, la non-duplication (des factures, par exemple, dans l’intérêt<br />
du client), de non-révocation (des commandes, dans l’intérêt du commerçant), d’anonymat (dans le cadre des<br />
micro-paiements, où l’on souhaite offrir au client l’équivalent électronique du bill<strong>et</strong> de banque, qui ne porte<br />
pas le nom de son utilisateur, contrairement au chèque par exemple), <strong>et</strong>c. La cryptologie aurait cependant pu<br />
119
J. Goubault-Larrecq<br />
rester un domaine relativement peu connu du grand public sans l’Intern<strong>et</strong>, le World-Wide Web <strong>et</strong> en particulier<br />
le protocole SSL introduit par N<strong>et</strong>scape <strong>et</strong> son successeur TLS [18]. En 2000, il est possible de faire des achats<br />
depuis un browser Web, qui négocie un protocole garantissant un certain niveau de secr<strong>et</strong> <strong>et</strong> d’authentification<br />
avec le serveur d’un commerçant, <strong>et</strong> l’utilise ensuite pour chiffrer les négociations de produits <strong>et</strong> de tarifs<br />
conduites par l’utilisateur du browser avec le commerçant.<br />
Or il se trouve que si, depuis les années 1980, on dispose d’algorithmes cryptographiques suffisamment<br />
sûrs, il n’en est pas de même, loin s’en faut, des protocoles cryptographiques. Nous le montrons au travers d’un<br />
exemple en section 2, <strong>et</strong> y illustrons les particularités de la sécurité cryptographique. Nous montrons ensuite<br />
comment on peut modéliser <strong>et</strong> soit vérifier des protocoles cryptographiques, soit détecter des attaques, en<br />
section 3. Nous serons ici relativement partiaux, <strong>et</strong> nous contenterons de présenter une variante d’une approche<br />
due à Dolev <strong>et</strong> Yao, qui a le mérite d’être simple, de se prêter à l’automatisation, <strong>et</strong> de se concentrer sur<br />
les problèmes de sécurité principaux. C<strong>et</strong>te modélisation se prête cependant peu à l’automatisation, <strong>et</strong> nous<br />
montrons en section 4 comment formaliser différemment les mêmes protocoles, de sorte que des techniques<br />
d’approximation standard, inspirées de [24], perm<strong>et</strong>tent d’obtenir des preuves automatiques de sécurité. Nous<br />
concluons en section 5.<br />
2. Un exemple de protocole cryptographique<br />
2.1. Premières tentatives<br />
Tentons d’imaginer comment perm<strong>et</strong>tre à deux principaux (ordinateurs, cartes à puce, éventuellement aussi<br />
êtres humains) A <strong>et</strong> B d’obtenir une clé �¤��� qu’eux seuls connaissent, <strong>et</strong> qui leur perm<strong>et</strong>tra de chiffrer les<br />
messages qu’ils désirent échanger par la suite. Une solution simple est de faire créer ����� par A, qui l’envoie<br />
en clair à B. Ceci a cependant de nombreux défauts. D’abord, la clé ����� ne peut pas être considérée secrète :<br />
il est facile pour un intrus I d’espionner la ligne de communication entre A <strong>et</strong> B <strong>et</strong> de récupérer ����� . Ensuite,<br />
la clé ����� ne peut pas non plus être considérée comme authentique par B : il est aussi facile pour I de couper<br />
la ligne de communication entre A <strong>et</strong> B <strong>et</strong> de la rediriger de I vers B ; toute clé ��� envoyée par I à B sera non<br />
authentique.<br />
Supposons donc que A <strong>et</strong> B ont déjà en commun une clé �������§� , dite à long terme, <strong>et</strong> partagée uniquement<br />
entre eux deux. A peut alors créer la clé ����� comme précédemment, mais au lieu de l’envoyer en clair, il<br />
la chiffre d’abord avec la clé �������¦� , au moyen d’un algorithme de chiffrement sûr (quel qu’il soit), obtenant<br />
ainsi le message chiffré ���¤��������������� . A envoie ensuite ���¤��������������� à B. Si l’algorithme de chiffrement est<br />
suffisamment sûr, la seule façon pour un intrus de récupérer ����� à partir de ����������� ������� est de connaître la<br />
clé �������¦� pour déchiffrer ���¤������� ������� . Si �¤�����¦� est maintenue secrète par A <strong>et</strong> B, l’intrus ne pourra donc pas<br />
récupérer la valeur de ����� par l’espionnage seul des lignes de communication. Si de plus le chiffrement inclut<br />
suffisamment de redondance dans le message chiffré pour que le déchiffrement de ����������� ������� à l’aide d’une<br />
clé autre que �¤�����¦� échoue, l’intrus ne pourra pas non plus passer un message de la forme �����¦��� ������� à B,<br />
espérant que B utilisera une clé ��� qu’il aurait concoctée spécialement pour que B l’utilise sans le savoir à la<br />
place de la clé légitime �¤��� . En eff<strong>et</strong>, l’intrus ne sait pas chiffrer avec �������¦� , ne disposant pas de c<strong>et</strong>te dernière.<br />
Si ce protocole — car c’en est un, malgré sa simplicité — semble donc offrir de meilleures garanties de<br />
sécurité, grâce à l’utilisation de moyens de chiffrement, il ne semble par contre pas très utile. Le lecteur attentif<br />
aura sans doute remarqué qu’en principe ce protocole ne résout rien : pour obtenir une clé ����� entre A <strong>et</strong> B,<br />
il faut déjà avoir une clé �������¦� entre A <strong>et</strong> B. En réalité, �������¦� est typiquement une clé extrêmement sûre,<br />
par exemple une clé à 1024 bits à utiliser avec l’algorithme RSA [50]. Mais c<strong>et</strong> avantage a un prix : chiffrer<br />
<strong>et</strong> déchiffrer avec �¤�����¦� peut prendre de l’ordre de 1000 fois plus longtemps qu’avec un algorithme comme<br />
DES avec des clés de longueur effective 56 bits [50]. On préfère donc utiliser pendant peu de temps des clés<br />
relativement courtes, <strong>et</strong> renouveler ces clés régulièrement en utilisant la clé plus sûre �������¦� par un protocole<br />
comme celui ci-dessus. C’est pourquoi �������¦� est appelée une clé à long terme <strong>et</strong> ����� est une clé de session.<br />
La distribution de la clé �������¦� elle-même peut être effectuée à l’aide du protocole de Diffie-Hellman [19], par<br />
120
exemple, qui repose sur des considérations de théorie des nombres.<br />
Protocoles cryptographiques: la logique à la rescousse!<br />
En fait, ce protocole souffre de problèmes plus graves. Même s’il semble être sûr grâce à l’utilisation de<br />
méthodes de chiffrement, il n’en est rien. Rappelons qu’une clé de session est bien moins sûre qu’une clé à<br />
long terme comme �������¦� . Il est donc prudent de supposer qu’une clé de session ��� utilisée il y a suffisamment<br />
longtemps a pu rentrer en la possession d’un intrus, que ce soit parce que l’intrus a eu tout le temps de trouver<br />
la clé ��� à partir des différents messages chiffrés �����¦��� échangés entre A <strong>et</strong> B, par exemple par exploration<br />
brute de l’espace de toutes les clés possibles ; ou bien plus simplement parce que A ou B a de façon plus ou<br />
moins involontaire diffusé �¤� en clair après utilisation. L’intrus, qui avait d’autre part récupéré le message<br />
�����¦��� ������� par espionnage des lignes de communication, peut maintenant passer ��������� ������� à B, sachant que<br />
B va prendre la vieille clé �¤� pour la clé attendue �¤��� . Tout message � que B chiffrera avec c<strong>et</strong>te clé sera<br />
envoyé sous la forme ��������� <strong>et</strong> non ���������¨� , ce qui perm<strong>et</strong>tra à l’intrus de les déchiffrer <strong>et</strong> de récupérer � .<br />
Une telle attaque est appelée attaque par rejeu, car pour tromper B l’intrus a rejoué un message, �����¦��� ������� ,<br />
d’une ancienne session du même protocole entre A <strong>et</strong> B.<br />
Pour empêcher les attaques par rejeu, on complique le protocole pour inclure des garanties de fraîcheur<br />
dans les messages, autrement dit des données additionnelles qui perm<strong>et</strong>tent aux principaux de vérifier que<br />
les messages reçus sont récents, <strong>et</strong> donc pas des versions rejouées d’anciens messages. Une solution est<br />
d’apparier les messages avec une estampille temporelle � : A lit l’heure � à partir d’une horloge locale, <strong>et</strong><br />
envoie le couple �¤�����¨� chiffré avec �������¦� , soit ��������������� ������� à B, <strong>et</strong> B vérifie que le champ � du couple<br />
déchiffré est une heure suffisamment récente. Les estampilles temporelles sont d’un maniement délicat, la<br />
notion de “suffisamment récent” étant relativement vague pour commencer ; d’autre part pour que le mécanisme<br />
fonctionne, il faut encore que les horloges des différents principaux soient synchronisées, <strong>et</strong> ce par un protocole<br />
lui-même sécurisé, pour éviter qu’un intrus n’attaque le système en désynchronisant les horloges dans le but<br />
d’effectuer de nouveau des attaques par rejeu.<br />
Une solution plus simple est l’utilisation de nonces. B, qui maintenant se méfie des attaques par rejeu,<br />
va initier la session <strong>et</strong> tirant un nombre aléatoire ��� (le nonce), <strong>et</strong> va l’envoyer en clair à A. A va ensuite<br />
créer la clé ����� , <strong>et</strong> envoyer le message ���¤��������������������� à B. À réception de ce message, B va vérifier que le<br />
message se déchiffre correctement avec �������¦� , puis qu’il obtient ainsi un couple dont la deuxième composante<br />
est exactement le nonce �¡� . Si tout s’est bien passé, B conclut que �¤��� est une bonne clé récente pour<br />
communiquer avec A. En eff<strong>et</strong>, avec très forte probabilité (<strong>et</strong> surtout si ��� est un nombre sur une grande<br />
largeur de bits, disons 128), le nombre �¡� n’a jamais circulé que ce soit en clair ou chiffré sur les lignes<br />
de communication : �¡� est une valeur fraîche. Si l’intrus avait pu construire ����������������� ������� , il n’avait donc<br />
pas pu le construire avant que �¡� ne soit inventé par B, <strong>et</strong> la vérification par B que ��� est bien la deuxième<br />
composante du couple chiffré, sous l’hypothèse que la clé à long terme �������¦� est toujours inconnue de l’intrus,<br />
perm<strong>et</strong> donc d’assurer que la paire �¤��������� , <strong>et</strong> donc la clé ����� est bien récente <strong>et</strong> ne vient pas d’un message<br />
rejoué. On note en abrégé ce protocole :<br />
�§�<br />
����� ��� ���<br />
������������������� ��� �������<br />
B A<br />
A B<br />
Pour autant, ce protocole est-il sûr ? Rien ne perm<strong>et</strong> de l’affirmer. En fait, l’intrus pourrait jouer le rôle de A<br />
tout du long, <strong>et</strong> créer lui-même la clé �¤��� . Les protocoles utilisés en réalité sont plus complexes, <strong>et</strong> utilisent en<br />
général un troisième principal de confiance. Ici, la solution classique est de faire intervenir un serveur de clés<br />
S, dont le rôle est de fabriquer une clé ����� à la demande pour A <strong>et</strong> B, <strong>et</strong> de la leur communiquer dans une série<br />
de messages chiffrés avec des clés à long terme �¤��� <strong>et</strong> ����� respectivement partagées entre A <strong>et</strong> S d’une part,<br />
entre B <strong>et</strong> S d’autre part.<br />
2.2. Un protocole cryptographique réaliste<br />
Comme exemple de c<strong>et</strong>te famille plus réaliste de protocoles impliquant un tiers de confiance S, considérons<br />
le protocole suivant, dû à Needham <strong>et</strong> Schroeder [42]. Le but est que seuls A <strong>et</strong> B (<strong>et</strong> S, en toute rigueur)<br />
121
J. Goubault-Larrecq<br />
connaissent �¤��� à la fin du protocole. Voici ce que font A, B <strong>et</strong> S dans ce protocole (voir aussi la figure 1).<br />
�¦�<br />
�������������<br />
��� ���<br />
��� ��� �����������¤�������������������¨���������������¨�<br />
��� �����������¨���������<br />
S A<br />
A S<br />
A B<br />
�<br />
���<br />
�<br />
���������������<br />
��������� ���<br />
�<br />
�����¨�<br />
��� B A<br />
A B<br />
A B S<br />
new Na<br />
write A, B, Na<br />
read A, B, Na<br />
new sym key Kab<br />
write {Na, B, Kab, {Kab, A | Kbs} | Kas}<br />
read {, , Kab, message | Kas}<br />
write message<br />
read {Nb | Kab}<br />
write {Nb+1 | Kab}<br />
read {Kab, A | Kbs}<br />
new Nb<br />
write {Nb | Kab}<br />
read { | Kab}<br />
FIG. 1 – Le protocole de Needham-Schroeder à clés secrètes<br />
En clair, voici comment se déroule une session du protocole. D’abord (message 1 ci-dessus, commandes<br />
new Na <strong>et</strong> write A, B, Na en haut à gauche de la figure 1, qui sont écrites dans le langage de l’outil CPV<br />
[26]), A envoie à S un message composé de sa propre identité, que l’on note � , de l’identité � de B, <strong>et</strong> d’un<br />
nonce ��� . (La création de ce dernier est effectuée par l’instruction new Na de la figure 1.) Les identités sont<br />
des identificateurs des principaux, par exemple des numéros de téléphone, des numéros de compte ou de carte<br />
bancaire, ou des URL. Ici, les identités de A <strong>et</strong> de B serviront au serveur S à r<strong>et</strong>rouver les clés à long terme<br />
����� <strong>et</strong> ����� à l’étape 2. S les r<strong>et</strong>rouve typiquement dans une base de données, à partir des identités de A <strong>et</strong> de<br />
B. Il est tentant de croire que les identités des principaux pourraient servir à authentifier les messages, mais ce<br />
n’est pas suffisant en général : il est facile de r<strong>et</strong>rouver l’identité de n’importe qui, <strong>et</strong> n’importe quel intrus peut<br />
alors l’utiliser pour se faire passer pour n’importe qui.<br />
Lorsque le message de l’étape 1 arrive à son destinataire S (read A, B, Na en figure 1), S renvoie le<br />
message ���������������������������������������������¨� à A. C’est un message un peu plus compliqué, qui a pour premier but<br />
d’envoyer la clé ����� nouvellement créée (new sym key Kab en figure 1) à A <strong>et</strong> à B sous pli confidentiel.<br />
Pour ceci, S fabrique la paire consistant en ����� <strong>et</strong> � , qu’il chiffre ensuite avec la clé ����� , obtenant le message<br />
qu’on a noté ������������������� . Bien que ce message fasse partie d’un message que S envoie à A, A ne pourra<br />
pas accéder à ����� en le déchiffrant, car seuls B <strong>et</strong> S connaissent la clé ����� par hypothèse ; en fait, le message<br />
������������������� ne sert qu’à être récupéré par A pour le renvoyer à B à l’étape 3. C’est à l’étape 3 que B déchiffrera<br />
ce message <strong>et</strong> en r<strong>et</strong>irera la valeur de �¤��� . En attendant, S apparie ce message ���¤�����¨��������� avec le nonce<br />
��� envoyé par A, l’identité de B, <strong>et</strong> de nouveau la clé ����� . (Le chiffrement d’un message M par la clé K,<br />
usuellement noté ������� , est {M | K} dans la notation de l’outil CPV [26].)<br />
Revenons à l’étape 2 du protocole. A reçoit maintenant le message ���������¤�������������������¨����������������� , il<br />
utilise sa copie de la clé ����� pour le déchiffrer <strong>et</strong> ainsi récupérer le nonce �¡� , la valeur de l’identité<br />
de B, la clé �¤��� nouvellement créée par S, ainsi qu’un message qui est censé être ������������������� <strong>et</strong><br />
que A enverra à B à l’étape suivante. La figure 1 est plus précise quant à ce que A fait à c<strong>et</strong>te étape<br />
(read {, , Kab, message | Kas}) : A vérifie que la première composante du message<br />
déchiffré est exactement (la notation ) le nonce �¡� que A avait créé en étape 1. C<strong>et</strong>te vérification assure A<br />
que le message ���������¤�������������������¨������������� �¨� est frais, <strong>et</strong> donc que la clé �¤��� est elle-même fraîche.<br />
A envoie ensuite à l’étape 3 le sous-message (message dans la figure 1) qu’il n’avait pas pu déchiffrer,<br />
<strong>et</strong> qui est censé être ���������¨����� ��� . B le reçoit, obtient l’identité de A <strong>et</strong> la clé �¤��� . Il s’engage ensuite dans<br />
122
Protocoles cryptographiques: la logique à la rescousse!<br />
deux étapes de protocole supplémentaires, 4. <strong>et</strong> 5., pour s’assurer qu’il possède la même ����� clé que A. Pour<br />
ceci, B crée un nouveau �¡� nonce , qu’il envoie chiffré par la �¤��� clé à A. Si A est d’accord sur la valeur de<br />
, il pourra déchiffrer ���¡����� �¨� , fabriquer �����<br />
�<br />
, le rechiffrer avec �¤��� <strong>et</strong> le renvoyer à B. Noter qu’on<br />
�����<br />
pourrait modifier le protocole de sorte que A renvoie n’importe quel autre message fabriqué à partir ��� de <strong>et</strong><br />
différent ��� de . Il ne peut pas ���¡�������¨� renvoyer , sinon l’intrus pourrait intercepter le message 4 <strong>et</strong> le réinjecter<br />
directement à B.<br />
Ce protocole est-il sûr ? La clé ����� , que ce soit celle reçue par A ou celle reçue par B, est-elle véritablement<br />
connue uniquement de A, B, <strong>et</strong> S ? Les clés �¤��� de A <strong>et</strong> B sont-elles les mêmes ? A peut-il avoir confiance en<br />
le fait que seul B (à part S) connaît �¤��� ? Ce sont quelques-unes des questions que l’on peut se poser.<br />
En fait, ce protocole n’est pas sûr. On peut montrer qu’il existe des attaques où les clés ����� reçues par A <strong>et</strong><br />
B sont différentes. Celle de A est toujours secrète (connue uniquement de A <strong>et</strong> S), mais celle de B peut provenir<br />
d’un rejeu. L’attaque typique est celle de la figure 2.<br />
C A B S<br />
write {Kab , A | Kbs}<br />
0<br />
read {Nb | Kab<br />
0<br />
}<br />
write {Nb+1 | Kab }<br />
0<br />
Kab 0<br />
read {Kab, A | Kbs}<br />
new Nb<br />
write {Nb | Kab}<br />
Kab 0<br />
read { | Kab}<br />
FIG. 2 – Une attaque contre le protocole de Needham-Schroeder à clés secrètes<br />
Elle consiste pour l’intrus C à rejouer un message 3. d’une ancienne session, ���������§�¨��������� disons ,<br />
suffisamment ancienne pour que C ait pu prendre connaissance de l’ancienne clé de ������� session . Il initie<br />
directement une session avec B à l’étape 3 (noter que B n’intervient pas avant c<strong>et</strong>te étape), qui demande<br />
confirmation en créant le �¡� nonce , <strong>et</strong> en envoyant le ���¡��������� � message à A. C déroute toutes les<br />
communications depuis B, <strong>et</strong> déchiffre lui-même ce dernier message, �����<br />
�<br />
calcule <strong>et</strong> le rechiffre �¤����� avec .<br />
Ainsi B dispose d’une vieille clé au lieu d’une fraîche. De plus c<strong>et</strong>te clé est connue de l’intrus.<br />
Le protocole à clés symétriques de Needham-Schroeder présenté ci-dessus est caractéristique des protocoles<br />
cryptographiques. Bien qu’il ait été publié, <strong>et</strong> ainsi soumis au regard critique de la communauté des chercheurs<br />
du domaine, il contient une faille de sécurité qui n’a été découverte que quelques années plus tard. Les failles<br />
sont parfois extrêmement subtiles. Dans le cas du protocole d’Otway-Rees [43], l’attaque [35] exige qu’un<br />
même principal joue deux rôles différents (ceux de A <strong>et</strong> de B) au cours d’une même session. Dans ce dernier<br />
cas, il a fallu six ans pour découvrir l’existence d’une attaque, mais il faut parfois plus longtemps. Un cas<br />
extrême est le protocole de Needham-Schroeder à clés publiques [42] (à ne pas confondre avec celui de la<br />
section 2.2), dont l’attaque a été découverte dix-sept ans plus tard [34].<br />
En tout état de cause, ces quelques exemples ont permis à la communauté scientifique de prendre conscience<br />
de la nécessité de moyens systématiques de recherche d’attaques, ou a contrario de preuve formelle de sécurité<br />
des protocoles cryptographiques.<br />
2.3. Si vous n’êtes pas encore convaincu...<br />
L’attaque de la section précédente sur le protocole de Needham-Schroeder ne convainc pas toujours. Elle<br />
est en eff<strong>et</strong> difficile à mener : l’intrus doit d’abord casser par force brute une clé ������� d’une ancienne session,<br />
puis l’utiliser pour tromper B en se faisant passer pour un participant A honnête.<br />
L’attaque sur le protocole de Needham-Schroeder à clés publiques est probablement plus convaincante de ce<br />
point de vue, en particulier parce qu’elle est systématique : elle réussit toujours, <strong>et</strong> il n’y a pas besoin de casser<br />
une clé par force brute auparavant. De plus, elle détruit le mythe communément répandu que la cryptographie<br />
123
J. Goubault-Larrecq<br />
à clés publiques fournirait une solution miracle à tous les problèmes de la cryptographie. La figure 3 présente<br />
un diagramme de la façon dont devrait se dérouler le protocole de façon normale.<br />
new Na<br />
write {Na, A | Kb}<br />
A B<br />
read {, Nb | Ka^−1}<br />
write {Nb | Kb}<br />
Clé publique de B;<br />
B déchiffre avec sa clé privée<br />
Clé publique de A;<br />
A déchiffre avec sa clé privée.<br />
read {Na, A | Kb^−1}<br />
new Nb<br />
write {Na, Nb | Ka}<br />
read { | Kb^−1}<br />
FIG. 3 – Le protocole de Needham-Schroeder à clés publiques<br />
Le but de ce protocole est de perm<strong>et</strong>tre à A de transm<strong>et</strong>tre un secr<strong>et</strong> Na à B, <strong>et</strong> à B de transm<strong>et</strong>tre un secr<strong>et</strong><br />
Nb à A, en s’assurant que la valeur de Na reçue par B provient authentiquement de A, <strong>et</strong> que la valeur de Nb<br />
reçue par A provient authentiquement de B. On note ici Kb^-1 la clé inverse de Kb.<br />
La figure 4 présente l’attaque découverte par Lowe [34] dix-sept ans après l’invention du protocole.<br />
new Na<br />
write {Na, A | Ki}<br />
A C<br />
B<br />
read {, Nb | Ka^−1}<br />
write {Nb | Ki}<br />
A commence<br />
par dialoguer avec C... qui détourne<br />
la conversation:<br />
read {Na, A | Ki^−1}<br />
write {Na, A | Kb}<br />
read M<br />
write M<br />
read {Nb | Ki^−1}<br />
write {Nb | Ka}<br />
read {Na, A | Kb^−1}<br />
new Nb<br />
write {Na, Nb | Ka}<br />
read { | Ka^−1}<br />
Ici, B croit dialoguer<br />
avec A, alors que c’est avec C.<br />
FIG. 4 – L’attaque de l’intermédiaire sur Needham-Schroeder à clés publiques<br />
On notera que l’intrus C joue ici à la fois le rôle d’un participant (B) honnête avec A, <strong>et</strong> est par contre<br />
malhonnête dans une session jouée en parallèle avec B, auprès de qui il se fait passer pour A. En fait, C se sert<br />
des informations obtenues dans une session honnête avec A pour se faire passer pour A auprès de B.<br />
Le fait que l’attaque nécessite que l’intrus joue en même temps dans deux sessions en parallèle, <strong>et</strong> qu’il est<br />
de plus à la fois honnête dans une session <strong>et</strong> malhonnête dans l’autre, explique probablement qu’on n’y ait pas<br />
pensé pendant autant de temps.<br />
Pour sa simplicité, nous continuerons cependant à nous référer à l’exemple de protocole de Needham-<br />
Schroeder à clés secrètes de la section 2.1.<br />
124
3. Le modèle de Dolev-Yao <strong>et</strong> ses applications<br />
Protocoles cryptographiques: la logique à la rescousse!<br />
Nous allons ici expliquer le modèle de Dolev-Yao, <strong>et</strong> effectuer une première tentative de traduction des<br />
protocoles cryptographiques en formules de logique du premier ordre. C<strong>et</strong>te traduction a quelques défauts, que<br />
nous corrigerons en section 4.<br />
3.1. Les principes fondamentaux<br />
Un modèle simple servant de fondement à l’étude des protocoles cryptographiques est dû à Dolev <strong>et</strong> Yao<br />
[20]. Il connaît de nombreuses variantes <strong>et</strong> a servi de support à de nombreuses méthodes de vérification<br />
[37, 9, 10, 11, 45, 44, 17, 3, 31, 25, 40, 26, 22].<br />
En premier lieu, il consiste à simplifier le modèle de communication entre principaux, en prenant en compte<br />
la quasi-omnipotence des intrus. Nul n’est besoin de préciser le modèle de communication (files, réseaux avec<br />
ou sans panne, avec ou sans duplication ou perte ou réordonnancement de messages, <strong>et</strong>c.) entre principaux :<br />
l’intrus pouvant espionner <strong>et</strong> dérouter toutes les lignes de communication, toute communication d’un message<br />
� entre deux principaux peut être simulée par un envoi de � à l’intrus, suivi d’un envoi de � par l’intrus au<br />
destinataire souhaité. Comme l’intrus peut simuler n’importe quel envoi <strong>et</strong> réception de message, on simplifie<br />
le modèle de communication en supposant que tout message envoyé est envoyé à l’intrus, <strong>et</strong> tout message reçu<br />
l’est de l’intrus.<br />
En second lieu, le modèle de Dolev <strong>et</strong> Yao suppose que les messages envoyés <strong>et</strong> reçus ne sont pas ni des<br />
nombres ni des suites de bits, mais des éléments d’une algèbre de termes, éventuellement modulo une théorie<br />
équationnelle. Les messages sont engendrés par une grammaire de la forme :<br />
����������� ������������������������������������¦������� ������������������������� �����������������������<br />
où � parcourt un ensemble de données de base (entiers, réels, <strong>et</strong>c.), � parcourt un ensemble de clés,<br />
��������������������� est le couple formé de ��� <strong>et</strong> de ��� , ��������� récupère la première composante du couple � ,<br />
���¦����� récupère la deuxième composante, ����������������������� chiffre le message � avec la clé � , tandis que<br />
����������������������� déchiffre le message chiffré � à l’aide de la clé � . Les messages sont à comprendre modulo<br />
la théorie équationnelle :<br />
���<br />
���������������������������¨���<br />
���<br />
���¦�����������������������¨���<br />
�����¦� ����������������������� ���<br />
� ����������������������������������������������� �<br />
�<br />
En particulier, toute tentative de déchiffrer (codé ici par ) en utilisant une clé<br />
différente de fournit un terme qui est prouvablement différent de dans<br />
la théorie équationnelle ci-dessus — plus précisément, qui est différent de<br />
théorie équationnelle.<br />
dans le modèle initial de c<strong>et</strong>te<br />
����������������������������������������������� �<br />
Troisièmement <strong>et</strong> finalement, le modèle de Dolev <strong>et</strong> Yao représente l’intrus comme un système déductif, qui<br />
représente tous les messages qu’un intrus peut fabriquer par un ensemble de règles, qui définissent un prédicat<br />
(“à partir de l’ensemble de messages ��� �<br />
, l’intrus peut fabriquer le � message ”) :<br />
�<br />
�<br />
1.<br />
���<br />
�<br />
: de tout ensemble � � �<br />
simple) ;<br />
de messages augmenté d’un message , l’intrus peut inférer (rejeu<br />
2. Si �<br />
<strong>et</strong> ����� �<br />
, alors ����� �<br />
����������������������� : l’intrus peut fabriquer tous les couples de messages<br />
�<br />
formés de messages qu’il peut fabriquer ;<br />
3. Si �<br />
�����<br />
�<br />
��� alors �<br />
�<br />
�<br />
����������� <strong>et</strong> �<br />
�<br />
�����¦����� : l’intrus peut extraire les composantes des couples ;<br />
�<br />
125
J. Goubault-Larrecq<br />
4. Si �<br />
souhaite ;<br />
5. Si �<br />
����<br />
<strong>et</strong> �<br />
��� � alors �<br />
������������������������� �<br />
toute clé qu’il sait fabriquer ;<br />
: l’intrus peut tenter de déchiffrer tout message avec<br />
6. Si �<br />
��� � ����� <strong>et</strong> dans la théorie équationnelle ci-dessus, alors �<br />
��� �<br />
� � �����������������������<br />
� �����������������������<br />
.<br />
L’intrus peut produire des messages en utilisant ces règles en aussi grand nombre <strong>et</strong> aussi souvent que<br />
nécessaire. Par contre, l’intrus ne peut pas produire de message d’aucune autre façon. Notamment, l’intrus ne<br />
peut pas produire à partir de , à moins de ne pouvoir produire la clé ou de ne pouvoir<br />
produire sans partir de .<br />
��� <strong>et</strong> �<br />
�<br />
��� alors �<br />
�<br />
3.2. Modélisation en logique du premier ordre<br />
������������������������� : l’intrus peut effectuer tous les chiffrements qu’il<br />
�<br />
Sous ces hypothèses, il est maintenant raisonnablement facile de représenter une ou plusieurs sessions d’un<br />
protocole cryptographique, ainsi que les hypothèses initiales (dans l’exemple de la section 2.2, le fait que �����<br />
<strong>et</strong> ����� sont initialement secrètes, c’est-à-dire impossibles à produire par l’intrus) <strong>et</strong> les propriétés à prouver. À<br />
titre d’exemple, montrons comment le protocole de Needham-Schroeder à clés symétriques de la section 2.2<br />
peut être décrit à l’aide d’une formule. Nous utilisons une notation à la Prolog pour bien montrer l’analogie<br />
avec l’écriture d’un programme : la notation A :- B1, ., Bn est la clause “B1 <strong>et</strong> ... <strong>et</strong> Bn impliquent<br />
A”. Nous conviendrons aussi que les identificateurs commençant par une minuscule sont des constantes, les<br />
variables commençant par des majuscules, comme en Prolog.<br />
En premier, on va coder les comportements des principaux A, B, <strong>et</strong> S. Pour ceci, on représente chaque<br />
principal comme un automate, dont l’état est un � -upl<strong>et</strong> comportant un champ décrivant à quelle étape du<br />
protocole le principal se trouve (un compteur de programme), <strong>et</strong> autant de champs que nécessaires pour donner<br />
des valeurs aux variables locales. Par exemple, A maintiendra un champ pour son identité � , un pour celle de<br />
B, un pour la valeur du nonce ��� , un pour la clé �¤��� , un pour la clé �¤��� , un pour le message message (que<br />
nous noterons M), <strong>et</strong> un pour le nonce ��� . Le prédicat<br />
Pa ((S, A, B, Na, Kas, Kab, Nb), E, (S’, A’, B’, N’a, K’as, K’ab, N’b), E’)<br />
exprimera que A peut passer de l’état<br />
(S, A, B, Na, Kas, Kab, Nb)<br />
à l’état<br />
(S’, A’, B’, N’a, K’as, K’ab, N’b)<br />
alors que l’intrus disposait de tous les messages dans l’ensemble E <strong>et</strong> dispose après c<strong>et</strong>te action de tous les<br />
messages dans l’ensemble E’. On écrira alors le rôle de A (la suite des actions qu’il exécute, cf. la colonne de<br />
gauche de la figure 1) par exemple comme suit.<br />
Voici d’abord la clause décrivant la transition effectuée par A qui ém<strong>et</strong> le message 1, passant de<br />
l’état avant-1 (un symbole dénotant l’état où se situe A juste avant d’envoyer le message 1) à l’état<br />
entre-1-<strong>et</strong>-2 (un autre symbole dénotant l’état où se trouve A une fois qu’il a envoyé le message 1,<br />
attendant de recevoir le message 2) :<br />
Pa((avant-1, A, B, _, Kas, Kab, M, Nb), E,<br />
(entre-1-<strong>et</strong>-2, A, B, Na, Kas, Kab, M, Nb), E’) :-<br />
Na = nonce-A-1,<br />
E’ = add (pair (A, pair (B, pair (Na, nil))), E).<br />
L’instruction new Na est ici approximée par la contrainte que la variable Na doive être égale à la constante<br />
nonce-A-1, qui représente toutes les valeurs possibles du nonce Na, au cours de n’importe quelle exécution<br />
126
Protocoles cryptographiques: la logique à la rescousse!<br />
du protocole par A. C<strong>et</strong>te approximation est correcte au sens où, si nous arrivons à prouver que le protocole<br />
ainsi codé en Prolog est sûr, alors il le sera effectivement. Nous verrons en section 4.2 une façon plus précise<br />
de modéliser les nonces.<br />
L’envoi du message � ������������� de A à S est tout simplement représenté par l’ajout de ce message (le<br />
terme du premier ordre pair (A, pair (B, pair (Na, nil)))) à l’ensemble des connaissances E<br />
de l’intrus. Ceci fournit un nouvel ensemble de connaissances E’ Nous laissons pour l’instant le terme add non<br />
spécifié. En toute rigueur, il doit obéïr à de nouvelles équations exprimant que E est un ensemble de messages,<br />
que nous ne précisons pas ici.<br />
Définissons un prédicat binaire knows codant la ��<br />
relation . Il est facile de le faire en Prolog (exercice :<br />
r<strong>et</strong>ranscrire les clauses 1.–6. de la section 3.1 en Prolog).<br />
La deuxième transition de A consiste à recevoir le ���������¤��������������������������������� �¨� message , puis à passer<br />
à l’état entre-2-<strong>et</strong>-3. Techniquement, A doit d’abord recevoir un message M1 : dans le modèle de Dolev-<br />
Yao, un tel message est n’importe quel message que l’intrus peut fabriquer, autrement dit n’importe quel<br />
message tel que knows(E,M1) est déductible. A doit ensuite déchiffrer (en utilisant decrypt) le message<br />
M1, puis vérifier que le texte déchiffré est une � ��� � ������������������� liste , ��� � où est exactement le ��� nonce créé<br />
à la précédente étape par A, <strong>et</strong> ��� l’identité est exactement l’identité du correspondant � souhaité . On ne peut<br />
pas demander à A ni de vérifier le contenu de la ����� clé , ni de déchiffrer le � message . Finalement, lors d’une<br />
telle transition on peut supposer que l’intrus n’apprend rien, <strong>et</strong> que donc son état de connaissances E’ après la<br />
transition est le même que celui, E, avant la transition.<br />
Pa((entre-1-<strong>et</strong>-2, A, B, Na, Kas, _, _, Nb), E,<br />
(entre-2-<strong>et</strong>-3, A, B, Na, Kas, Kab, M, Nb), E’) :knows(E,<br />
M1),<br />
decrypt(M1, Kas) = pair (N’a, pair (B’, pair (Kab, pair (M, nil)))),<br />
N’a = Na, B’ = B,<br />
E’ = E.<br />
Le reste de la modélisation est maintenant clair. Voici la troisième transition de A, qui consiste juste à<br />
envoyer le message � , censé être ���������¨����� ��� , à B — donc directement à l’intrus :<br />
Pa ((entre-2-<strong>et</strong>-3, A, B, Na, Kas, Kab, M, Nb), E,<br />
(entre-3-<strong>et</strong>-4, A, B, Na, Kas, Kab, M, Nb), E’) :-<br />
E’ = add (M, E).<br />
Puis A reçoit le message ���¡��������� :<br />
Pa ((entre-3-<strong>et</strong>-4, A, B, Na, Kas, Kab, M, _), E,<br />
(entre-4-<strong>et</strong>-5, A, B, Na, Kas, Kab, M, Nb), E’) :knows(E,<br />
M2),<br />
decrypt(M2, Kas) = Nb,<br />
E’ = E.<br />
Enfin A ���¡���<br />
�<br />
������� envoie :<br />
Pa ((entre-4-<strong>et</strong>-5, A, B, Na, Kas, Kab, M, _), E,<br />
(après-5, A, B, Na, Kas, Kab, M, Nb), E’) :-<br />
E’ = add (encrypt (Nb+1, Kab), E).<br />
On écrit de même une série de clauses définissant le prédicat Pb caractérisant les actions possibles de B,<br />
dont l’état instantané est de la forme<br />
(S, Kab, A, Nb, Kbs)<br />
127
J. Goubault-Larrecq<br />
<strong>et</strong> le prédicat Ps caractérisant les actions possibles de S, dont l’état instantané est de la forme<br />
(S, A, B, Na, Kab, Kas, Kbs)<br />
On peut maintenant décrire la composition parallèle des trois principaux A, B, <strong>et</strong> S. Une configuration<br />
globale est un quadrupl<strong>et</strong> (Ea, Eb, Es, E) comportant un état Ea de A (un septupl<strong>et</strong><br />
(S, A, B, Na, Kas, Kab, Nb)), un état Eb de B (un quintupl<strong>et</strong> (S, Kab, A, Nb, Kbs)), un<br />
état Es de S (un septupl<strong>et</strong> (S, A, B, Na, Kab, Kas, Kbs)), <strong>et</strong> un ensemble de messages E récupérés<br />
par l’intrus. Définissons un prédicat P décrivant les actions possibles de la composition parallèle de A, B, <strong>et</strong> S :<br />
P ((Ea, Eb, Es, E), (E’a, E’b, E’s, E’))<br />
décrit toutes les transitions possibles de l’état global (Ea, Eb, Es, E) vers l’état global (E’a, E’b, E’s, E’),<br />
par entrelacement entre les actions de A, de B, <strong>et</strong> de S :<br />
P((Ea, Eb, Es, E), (E’a, E’b, E’s, E’)) :-<br />
Pa (Ea, E, E’a, E’), Eb=E’b, Es=E’s.<br />
P((Ea, Eb, Es, E), (E’a, E’b, E’s, E’)) :-<br />
Ea=E’a, Pb(Eb, E, E’b, E’), Es=E’s.<br />
P((Ea, Eb, Es, E), (E’a, E’b, E’s, E’)) :-<br />
Ea=E’a, Eb=E’b, Ps(Es, E, E’s, E’).<br />
Une exécution est une suite éventuellement vide de transitions, <strong>et</strong> exec peut être définie comme la clôture<br />
réflexive transitive de P, de sorte que<br />
exec((Ea, Eb, Es, E), (E’a, E’b, E’s, E’))<br />
soit vrai si le système global peut évoluer de (Ea, Eb, Es, E) vers l’état (E’a, E’b, E’s, E’) en<br />
un nombre quelconque d’étapes :<br />
exec((Ea, Eb, Es, E), (Ea, Eb, Es, E)). % pas d’action.<br />
exec((Ea, Eb, Es, E), (E’’a, E’’b, E’’s, E’’)) :- % une transition,<br />
% suivie d’une exécution:<br />
P((Ea, Eb, Es, E), (E’a, E’b, E’s, E’)),<br />
exec((E’a, E’b, E’s, E’), (E’’a, E’’b, E’’s, E’’)).<br />
Notons ���<br />
la conjonction de toutes ces clauses, préalablement universellement quantifiées. On a ainsi<br />
���<br />
entièrement spécifié toutes les exécutions possibles du protocole cryptographique, incluant non seulement les<br />
exécutions normales, comme celle de la figure 1, mais aussi toutes les exécutions pathologiques, comme celle<br />
de la figure 2.<br />
�§��������� Notons la modélisation du prédicat (� � knows ) telle que décrite dans les points 1.-6. à la<br />
section 3.1, r<strong>et</strong>ranscrite en logique du premier ordre.<br />
Vérifier que la valeur de ����� que A possède à la fin du protocole est secrète, par exemple, en supposant que<br />
����� <strong>et</strong> ����� sont initialement secrètes revient à prouver la formule :<br />
�<br />
�<br />
�<br />
�<br />
�<br />
�<br />
�������§�������������<br />
���<br />
�<br />
���<br />
�<br />
�<br />
�<br />
�<br />
�<br />
���<br />
�<br />
�<br />
�<br />
�<br />
�<br />
���<br />
�<br />
�<br />
�<br />
�<br />
�<br />
�����<br />
���<br />
���<br />
�<br />
�<br />
�<br />
���<br />
��� avant-1� _� _� _��������� _� _� _���<br />
���������<br />
�<br />
�����<br />
� ���������<br />
���<br />
����¤�����<br />
�����<br />
���<br />
�<br />
�<br />
�<br />
���<br />
��� avant-1� _� _� _���¤�������<br />
���<br />
�<br />
�������¤��� ���<br />
�<br />
�<br />
�<br />
���<br />
��� avant-1� _� _� _�������������������������<br />
���������������¤�����������<br />
�<br />
�����<br />
� ���������<br />
���<br />
128<br />
�<br />
�����<br />
����¤�����<br />
���<br />
�<br />
�����<br />
� ���������<br />
���<br />
�<br />
���<br />
�<br />
�<br />
�
�<br />
�����<br />
���<br />
�<br />
�<br />
���<br />
���<br />
�<br />
�<br />
���<br />
���<br />
�<br />
�<br />
���<br />
���������<br />
�<br />
�<br />
� ��� � � ��� � � ��� ���<br />
�<br />
�<br />
�<br />
exec���<br />
�<br />
�<br />
� � � � � � � � � �����<br />
�<br />
�¤��� après-5� _� _� _� _��������� _�<br />
���<br />
�<br />
�����<br />
� �������<br />
�<br />
Protocoles cryptographiques: la logique à la rescousse!<br />
���<br />
�<br />
�<br />
���<br />
� ���<br />
�<br />
���<br />
� ���<br />
�<br />
���<br />
�����<br />
���¨�<br />
���<br />
En clair, si les �¤��� clés �¤��� , ����� , ne sont pas connues dans l’état initial de connaissances ��� ���<br />
de l’intrus, �<br />
alors pour tout état final où A est au compteur après-5, la ����� version de la clé que A est censé partager<br />
avec B n’est pas connue de l’intrus dans son état final de connaissances �����<br />
. �<br />
C<strong>et</strong>te formule est prouvable en logique du premier ordre interprétée modulo la théorie équationnelle de la<br />
section 3.1 (à un détail près, lié à la nature inductive de la définition ��<br />
de , que nous verrons en section 3.3).<br />
On peut pour s’en convaincre utiliser des assistants de preuve comme Coq [10, 11] ou Isabelle [45], ou des<br />
systèmes de démonstration automatique [31]. On peut ainsi vérifier des propriétés de sécurité sous diverses<br />
hypothèses initiales. Par exemple, dans la formule ci-dessus, on a pris des hypothèses relativement libérales ;<br />
notamment, on n’a pas demandé que les ����� clés �¤��� ou aient les mêmes valeurs pour A <strong>et</strong> pour S, <strong>et</strong> pour<br />
B <strong>et</strong> pour S respectivement. En fait, A <strong>et</strong> B pourraient déjà avoir subi des attaques, avec comme conséquence<br />
que par exemple A <strong>et</strong> S ne sont pas d’accord sur la valeur ����� de . Ceci ne comprom<strong>et</strong> pas le secr<strong>et</strong> ����� de<br />
à la fin de l’exécution de A, du moment que la ����� clé de A <strong>et</strong> la ����� clé de S sont toutes les deux secrètes<br />
initialement.<br />
De même, on peut prouver que les différentes variantes des clés à long terme ����� <strong>et</strong> ����� restent toujours<br />
secrètes à toute étape du protocole. Par contre, la formule similaire tendant à établir que le ����� de B est secr<strong>et</strong><br />
à la fin de l’exécution de B est fausse <strong>et</strong> donc non prouvable : l’attaque de la figure 2 est un contre-exemple.<br />
La recherche de preuve perm<strong>et</strong> de donner une idée du contre-exemple, néanmoins les systèmes de preuve<br />
automatique sont souvent incapables d’extraire un contre-exemple automatiquement. Des systèmes de modelchecking<br />
comme FDR [34] sont plus directement orientés vers la détection d’attaque, mais ne fournissent<br />
aucune garantie de sécurité au cas où aucune attaque n’est trouvée, car ils travaillent sur des abstractions à états<br />
finis des protocoles cryptographiques, qui sont des systèmes à états infinis ; certains travaux montrent cependant<br />
que sous certaines hypothèses, des abstractions à suffisamment d’états finis suffisent pour obtenir des garanties<br />
de sécurité [53].<br />
3.3. Commentaires <strong>et</strong> extensions<br />
Prédicat �<br />
<strong>et</strong> théories inductives. Le prédicat � �<br />
��� est défini comme étant défini inductivement par les<br />
�<br />
clauses 1.-6. de la section 3.1. Autrement dit, l’ensemble des �<br />
�<br />
����� couples tels que �<br />
��� est le plus p<strong>et</strong>it<br />
�<br />
tel que les clauses 1.-6. sont vérifiées. L’aspect inductif perm<strong>et</strong> en particulier de montrer des assertions de la<br />
forme ���<br />
��� . Or la formalisation en logique du premier ordre ne perm<strong>et</strong> pas d’inclure c<strong>et</strong> aspect inductif. Il<br />
�<br />
y a plusieurs solutions à ce problème : utiliser un assistant de preuve incluant des principes inductifs, c’est-àdire<br />
de récurrence [10, 11, 45], ou bien coder sous forme de formules de logiques du premier ordre quelques<br />
principes suffisants pour démontrer des formules de la forme ���<br />
��� [11]. Il se trouve qu’en fait un faible<br />
�<br />
nombre de telles formules est nécessaire : El Kadhi [22] dégage une notion de théorème de transfert, de la<br />
forme “sous certaines hypothèses, si ���<br />
��� alors �<br />
� �<br />
� ��� ”, qui perm<strong>et</strong> de conclure qu’une donnée<br />
�����<br />
secrète le reste même après l’écriture du message ��� , <strong>et</strong> montre qu’avec essentiellement trois théorèmes<br />
�<br />
de transfert, on peut établir que certaines données secrètes le restent au cours d’un protocole. ([22] considère<br />
en fait le problème plus difficile de valider automatiquement un programme, par analyse statique, en ce qui<br />
concerne la non-divulgation de données sensibles en présence de primitives cryptographiques.)<br />
Enrichissement de la théorie équationnelle. La théorie équationnelle des messages de la section 3.1<br />
peut être enrichie pour prendre en compte certaines propriétés algébriques, notamment des algorithmes de<br />
chiffrement. Par exemple, le chiffrement à l’aide de l’algorithme RSA a de nombreuses propriétés, parmi<br />
lesquels ����������������� � ������������������������������� � , qui mènent à des attaques. Pour établir de façon certaine<br />
129
J. Goubault-Larrecq<br />
la sécurité d’un protocole cryptographique, toutes les équations valides doivent être ajoutées à la théorie<br />
équationnelle. Un certain nombre de telles équations est fourni dans [1].<br />
� � �<br />
�<br />
Appauvrissement de la théorie équationnelle. A contrario, les réalisations informatiques professionnelles<br />
de protocoles cryptographiques incluent de nombreuses précautions de codage (chiffrement en mode CBC<br />
plutôt que par blocs, inclusion d’information redondante de typage pour éviter les confusions de types, <strong>et</strong>c.<br />
[50]). Par exemple, au lieu de chiffrer par en utilisant RSA directement, on va d’abord encoder<br />
par exemple en ASN.1 [32], puis appliquer RSA sur le message résultant avec la clé . Ces précautions ont<br />
essentiellement pour eff<strong>et</strong> d’invalider toutes les équations non triviales (autres que de la forme �<br />
tenaient sur l’algorithme de chiffrement brut. On peut pousser l’élimination de la théorie équationnelle plus<br />
loin, dans ces conditions : à cause des informations de types incluses, on peut reconnaître si un message<br />
est un couple ou un chiffrement, avec faible probabilité d’erreur. Ceci perm<strong>et</strong> de se passer intégralement<br />
des opérateurs ��� , ��� , <strong>et</strong> ������������� . Par exemple, au lieu d’exprimer que �<br />
�<br />
� ) qui<br />
� � ������������� � ��������������������������������� nil�¨�¨�¨� dans la modélisation du protocole de la section 3.2, on<br />
�����������<br />
écrira directement que �<br />
������������������������������� � ������������������������������������������������� nil�¨�¨�¨����������� . On peut alors<br />
�<br />
entièrement se passer de l’égalité dans la modélisation (comme dans [11, 26]), ce qui simplifie grandement la<br />
recherche de preuve ; notamment la recherche automatique de preuve au premier ordre sans égalité est beaucoup<br />
plus simple qu’avec égalité.<br />
����� <strong>et</strong> �������������������������������<br />
�<br />
L’approche par réécriture. Une autre modélisation des protocoles cryptographiques utilise, elle,<br />
uniquement la notion de réécriture [31, 25]. L’état global du système est représenté comme un terme modulo la<br />
théorie équationnelle de la section 3.2 <strong>et</strong> l’associativité <strong>et</strong> la commutativité de l’opérateur d’union ensembliste<br />
utilisé pour former l’ensemble E des messages connus de l’intrus. L’exécution du protocole est représentée par<br />
la réécriture de ce terme, directement. Pour montrer que ����� reste secr<strong>et</strong> dans toute exécution du protocole<br />
(par exemple), on montre qu’il n’est pas déductible d’aucun état global accessible depuis les états initiaux, soit<br />
directement [31], soit par calcul d’un sur-ensemble de c<strong>et</strong> ensemble des états accessibles par une méthode qui<br />
termine toujours (par l’utilisation d’automates d’arbres, par exemple [25]).<br />
Authentification. Nous n’avons traité jusqu’ici que des propriétés de secr<strong>et</strong>. Une autre propriété<br />
fondamentale est l’authentification. Un moyen simple de traiter de l’authentification est de conserver dans la<br />
modélisation une information sur l’identité du créateur réel de toute donnée. On ajoute pour cela, par exemple,<br />
une variable de relation � entre messages <strong>et</strong> identités de participants parmi les composantes de l’état global :<br />
�����¨��� est dans la relation � si <strong>et</strong> seulement si le participant � est capable de produire le message � .<br />
Formellement, on peut utiliser un prédicat ternaire �������������������¨���¨��� (“�����¨��� est dans la relation � ”) <strong>et</strong> une<br />
constante i dénotant l’identité de l’intrus. Les deux propriétés à maintenir durant l’exécution du protocole sont,<br />
d’une part, que si �<br />
��� alors ������������������� i����� , <strong>et</strong> d’autre part que lorsqu’un participant � construit un<br />
�<br />
� message , �������������������������¨��� alors pour tout sous-message non ��� variable � de . Le fait qu’un message<br />
reçu par � , par exemple sous la forme ����������� , vienne authentiquement de � reviendra à vérifier que tout<br />
�<br />
tel que ��������������������������� est en fait égal à � . Ceci interdit en particulier que ������������������� i����� , autrement<br />
�<br />
dit que l’intrus ait pu fabriquer le � message , mais aussi �������������§���������¨��� que par exemple, �<br />
�<br />
��� avec , ce<br />
qui interdit que l’intrus ait pu rejouer un �����¦����� message venant � de même sans avoir accès � à . Une telle<br />
approche de l’authentification est à l’œuvre, quoique sous une forme en apparence différente, dans [14, 25, 31].<br />
C<strong>et</strong>te notion d’authentification inclut la notion d’intégrité, qui exprime que le message n’a pas été modifié<br />
depuis sa création. Différents auteurs utilisent des notions différentes d’authenticité, voir par exemple la notion<br />
d’“agreement” [54] qui exprime que si M est authentiquement de A, alors lorsque B termine sa session, A a<br />
lui-même auparavant commencé la partie correspondante de la session.<br />
Multi-sessions. Il est important de comprendre dans combien de sessions un même principal peut participer.<br />
Dans le protocole de la section 3.2, par exemple, A <strong>et</strong> B vont typiquement participer à une session, puis<br />
130
Protocoles cryptographiques: la logique à la rescousse!<br />
éventuellement à une autre, <strong>et</strong> ainsi de suite, en séquence ; ce qu’on appelle le mode multi-sessions séquentiel.<br />
Notre modélisation considérait que A s’arrêtait après une session, ce qui est trop restrictif. Le serveur de clés S,<br />
lui, peut participer à de nombreuses sessions en parallèle (le mode multi-sessions parallèle). Plus subtilement,<br />
on peut envisager des modes de fonctionnement où un même principal endosse plusieurs rôles (celui de A,<br />
celui de B par exemple) soit à la suite, soit même en parallèle. Ainsi l’attaque de Paulson [46] sur le protocole<br />
d’Otway-Rees demande à ce qu’un même principal joue en même temps le rôle de A dans une session <strong>et</strong> le rôle<br />
de B dans une autre. L’attaque de Lowe [34] sur Needham-Schroeder à clés publiques nécessite que l’intrus<br />
joue à la fois le rôle du participant B honnête dans une session avec A, <strong>et</strong> le rôle d’un participant malhonnête<br />
A dans une autre session parallèle avec B.<br />
Il existe des réponses partielles à ce genre de situations. Notamment, l’algorithme de [17] considère tous<br />
les principaux comme des complices de l’intrus : si A ������������� lit à l’étape 4. du protocole de la section 3.2,<br />
<strong>et</strong> �������<br />
�<br />
�����¨� renvoie à l’étape 5., par exemple, alors on peut considérer que A agit comme un complice de<br />
l’intrus, qui perm<strong>et</strong> à ce dernier de �������<br />
�<br />
��� ��� déduire à partir ���¡����� �¨� de même sans ����� connaître . Ceci est<br />
utilisé dans [26] pour modéliser de façon efficace <strong>et</strong> raisonnablement précise le comportement des principaux<br />
en multi-sessions parallèle.<br />
Algorithmes de chiffrement à clés publiques. Jusqu’ici nous n’avons traité que de méthodes de chiffrement<br />
<strong>et</strong> de déchiffrement à clés symétriques : pour déchiffrer un message chiffré avec une � clé , c’est � encore<br />
qu’on doit utiliser. Des algorithmes comme RSA utilisent une notion de clés asymétriques : on chiffre avec<br />
une � clé , <strong>et</strong> on déchiffre avec la clé ��� � inverse . La théorie équationnelle de la section 3.1 doit alors être<br />
modifiée, l’équation portant ������������� sur ������������� <strong>et</strong> ��������������������������������������������� � �¤��� devenant . Il est<br />
aussi nécessaire d’ajouter ��� � � �<br />
��� l’équation . Notons que même en présence de paires de clés inverses, il<br />
est possible de se passer d’équations, cf. [26].<br />
Autres propriétés de sécurité <strong>et</strong> commerce électronique. Le commerce électronique pose des défis<br />
supplémentaires à relever [13]. D’abord, les propriétés de secr<strong>et</strong> <strong>et</strong> d’authentification, si elles sont toujours<br />
fondamentales, ne sont plus les propriétés essentielles que l’on cherche à prouver. Des propriétés plus<br />
complexes sont à établir : non-duplication de messages (factures), non-révocation de messages (commandes),<br />
ainsi que nous l’avons déjà mentionné dans l’introduction. Ces propriétés plus complexes requièrent de<br />
travailler sur des abstractions du protocole, lesquelles peuvent être en grande partie calculées automatiquement<br />
[12, 6]. Un autre aspect complexe des protocoles électroniques est qu’ils incluent typiquement non pas deux<br />
principaux (plus un serveur S) de confiance, mais trois principaux (l’ach<strong>et</strong>eur, le vendeur, la banque) tels que<br />
tout sous-ensemble de deux se méfie du troisième. Il est donc plus délicat de séparer le monde en deux zones,<br />
les principaux de confiance <strong>et</strong> l’intrus, tout principal étant considéré comme un intrus par les deux autres.<br />
Bolignano [13] montre comment moduler une modélisation dans le style de la section 3.2 pour inclure non<br />
seulement des hypothèses initiales de secr<strong>et</strong>, mais aussi des hypothèses d’honnêt<strong>et</strong>é des différents principaux<br />
du protocole. La méthode de [16] perm<strong>et</strong> aussi de modéliser des secr<strong>et</strong>s entre participants honnêtes qui ne<br />
soient pas connus d’autres participants honnêtes.<br />
4. Logique du premier ordre, types, automates d’arbres <strong>et</strong> vérification<br />
approchée de protocoles cryptographiques<br />
Nous allons donc changer légèrement le modèle, pour corriger les quelques défauts mentionnés en<br />
section 3.3 de la modélisation de la section 3.2. Ceci sera fait en section 4.1. Il s’agit en particulier du<br />
modèle adopté dans le cadre du proj<strong>et</strong> EVA [28]. Nous montrons comment les processus EVA se traduisent<br />
en ensembles de clauses de Horn (en programmes Prolog) en section 4.2, raffinant ainsi la traduction de la<br />
section 3.2. En principe, il suffirait de lancer un interprète Prolog pour vérifier les protocoles cryptographiques<br />
EVA, mais ceci ne fonctionne pas, nous verrons pourquoi <strong>et</strong> comment contourner le problème en section 4.3.<br />
131
J. Goubault-Larrecq<br />
Les approximations <strong>propos</strong>ées dans c<strong>et</strong>te section sont cependant trop grossières, <strong>et</strong> nous montrons comment<br />
les raffiner, par des transformations de programmes Prolog préservant leur sémantique en section 4.5. Nous<br />
verrons enfin pourquoi on a quand même besoin de théories équationnelles en section 4.6, <strong>et</strong> les problèmes<br />
techniques que ceci entraîne.<br />
4.1. Le modèle EVA<br />
Tout d’abord, nous allons nous passer de théorie équationnelle — en tout cas jusqu’en section 4.6. Ensuite,<br />
nous allons introduire des constructions perm<strong>et</strong>tant de parler de chiffrement tant à clés symétriques qu’à clés<br />
asymétriques. De plus, nous allons aussi spécialiser les opérateurs de chiffrement en fonction d’un paramètre<br />
additionnel définissant l’algorithme de chiffrement utilisé, ce qui nous perm<strong>et</strong>tra d’être plus fins dans la<br />
modélisation de protocoles utilisant plusieurs méthodes de chiffrement, comme par exemple le handshake SSL<br />
ou TLS [18], où l’algorithme de chiffrement utilisé in fine est négocié entre les principaux dans une première<br />
phase.<br />
La grammaire des termes EVA est la suivante :<br />
Term : := id variable<br />
�<br />
� �<br />
�<br />
�<br />
� �<br />
crypt (Term, Term, Term) chiffrement (algo, texte, clé)<br />
tuple (Term) -upl<strong>et</strong><br />
nil () liste vide<br />
cons (Term, Term) liste non vide<br />
d (Term) conversion *D* message<br />
� �<br />
� �<br />
� �<br />
� �<br />
�<br />
� Term�<br />
Term� �<br />
� Term�<br />
� Term�<br />
� Term�<br />
� Term�<br />
Term� �<br />
Term� �<br />
p (Term) conversion principal message<br />
a (Term) conversion *algo* message<br />
sa (Term) conversion sym_algo *algo*<br />
aa (Term) conversion asym_algo *algo*<br />
vanilla () algorithme symétrique par défaut<br />
apply (id, ) application de fonction définie<br />
hash-apply (id, ) application de fonction one-way<br />
secr<strong>et</strong>-apply (id, ) application de fonction secrète<br />
hash-secr<strong>et</strong>-apply (id, ) application de fonction secrète one-way<br />
apply-pubk (Term, id, ) appl. de constructeur de clé publique<br />
(algo, constructeur, arguments)<br />
hash-apply-pubk (Term, id, ) appl. de constructeur de clé publique one-way<br />
(algo, constructeur, arguments)<br />
apply-privk (Term, id, ) appl. de constructeur de clé privée<br />
(algo, constructeur, arguments)<br />
hash-apply-privk (Term, id, ) appl. de constructeur de clé privée one-way<br />
(algo, constructeur, arguments)<br />
On notera que les �����§����������������� chiffrements , qui �����¦� représentent , ont maintenant un argument<br />
� supplémentaire , qui désigne le nom d’un algorithme de chiffrement. � Intuitivement, est un nom d’algorithme<br />
connu comme “DES”, “RSA”, “IDEA”. Les contraintes de typage (que nous ne reproduirons pas ici [28]) font<br />
qu’un algorithme est toujours de la �����§���<br />
�����<br />
�¨� forme — dénotant un algorithme à clés symétriques — ou de la<br />
— un algorithme à clés publiques. Une originalité du modèle est que la décision de déchiffrer<br />
�¨�<br />
���������<br />
�����<br />
forme<br />
avec la clé � elle-même, ou bien avec un certain inverse de � , dépend ici non pas de la forme de �<br />
�������<br />
mais de l’algorithme utilisé pour déchiffrer (voir aussi [22]).<br />
Les règles de typage font aussi que les seuls termes qui sont des messages sont d’une des formes :<br />
– une variable �<br />
�����§����������������� � � �<br />
�<br />
;<br />
– ou où est un nom d’algorithme <strong>et</strong> <strong>et</strong> des messages ; noter que, contrairement<br />
à d’autres approches, il n’y a pas de type spécifique pour les clés, en particulier les clés<br />
elles-mêmes des messages chiffrés ;<br />
peuvent être<br />
132
Protocoles cryptographiques: la logique à la rescousse!<br />
– �§�����������§���������������§�������������<br />
�����<br />
���������������������������¨�<br />
�����<br />
�¨�¨� ou , qui représente � un -upl<strong>et</strong> de messages,<br />
que nous � �����������<br />
�����<br />
������� noterons par souci de concision ;<br />
– ������� ou , qui représente un � obj<strong>et</strong> d’un type de base *D*, typiquement des chaînes de bits ;<br />
– ������� ou , qui représente une � identité , de type principal ;<br />
– �����§�������¨� ou � (algorithme de chiffrement symétrique, de type sym_algo) �������������¨� ou � (algorithme<br />
de chiffrement asymétrique, de type asym_algo) ;<br />
– �������� -�����¦�������§� -���������¦���¡ ��������<br />
�����<br />
������� ou , où les croch<strong>et</strong>s dénotent des parties optionnelles : il s’agit<br />
de l’application d’une fonction de nom aux ��� arguments , . . ��� ., . Si le préfixe hash est présent,<br />
l’intrus est supposé ne pas pouvoir r<strong>et</strong>rouver les ��� arguments , . . ��� ., à partir du message composé<br />
(c’est une fonction de hachage). Si secr<strong>et</strong> est présent, l’intrus est supposé ne pas pouvoir construire le<br />
message composé à partir des ��� arguments , . . ��� ., ;<br />
– � ������� -���������§� -�����£¢¥¤��������§¦£¤��������¨ ��������<br />
�����<br />
������� ou , qui perm<strong>et</strong> de construire soit une clé publique<br />
(si pubk) soit une clé privée (si privk) ; de plus, si le préfixe hash est présent, l’intrus n’est<br />
pas supposé pouvoir r<strong>et</strong>rouver les ��� arguments , . . ��� ., à partir du message composé. Les clés<br />
sont supposées être inverses l’une<br />
�������<br />
-���£¢©¤������� ��������<br />
�����<br />
��� ��� <strong>et</strong> �������§� -�����§¦�¤������¨ ��������<br />
�����<br />
�������¦�<br />
de l’autre — pourvu que les � arguments , ��� , , . . ��� ., soient les mêmes. De même avec<br />
-�������¦� -���©¢©¤ <strong>et</strong> ������� -�������¦� -�����§¦�¤ .<br />
�������<br />
4.2. Modélisation en clauses de Horn<br />
La première chose à faire est de définir le prédicat knows que nous utilisions en section 3.2 pour modéliser<br />
les capacités déductives de l’intrus.<br />
4.2.1. Conditions initiales<br />
Un changement que nous apportons à la modélisation de l’intrus est que knows(E,M) va maintenant<br />
signifier, non pas que M est déductible à partir de la liste de messages E, mais que M est déductible à partir<br />
de E <strong>et</strong> d’un ensemble de messages initialement connus de l’intrus �<br />
, qui sera spécifié via un autre prédicat<br />
�<br />
knows0.<br />
Si l’on n’écrit pas de clause avec knows0 en tête, alors �<br />
sera vide, <strong>et</strong> on sera ramené au cas précédent.<br />
�<br />
Plus intéressant est le fait que l’on peut décrire ainsi des ensembles �<br />
infinis. Dans CPV ([26], section 4.4 de<br />
�<br />
la version longue), il est notamment montré que l’on peut ainsi modéliser l’ensemble �<br />
maximal des messages<br />
�<br />
que peut connaître l’intrus, lorsque l’on suppose qu’il ne connaît pas certains messages. Par exemple, si l’on<br />
suppose que :<br />
initialement l’intrus ne connaît aucune clé privée, c’est-à-dire aucun message commençant par<br />
���¦�<br />
������� -���§�������§� -�������¦� ou par � ������� -���������§� -�����§¦�¤<br />
�<br />
alors on spécifiera �<br />
par le prédicat knows0 défini comme suit. On introduit un prédicat auxiliaire<br />
�<br />
not-knows0 qui définit le complément de knows0, ainsi qu’un prédicat exists0 qui définit l’ensemble<br />
des messages qui existent initialement. Ici, un message qui existe initialement est n’importe quel message qui<br />
peut être construit avec tous les symboles de fonction � sauf . L’intention est que les nonces créés ultérieurement<br />
dans le protocole seront des � termes de type *D*, <strong>et</strong> convertis en �����¨� messages . La notion d’existence initiale<br />
perm<strong>et</strong> de parler des messages qui ne mentionnent aucun nonce créé ultérieurement. (Ceci suppose que les<br />
conditions initiales ne mentionnent aucun nonce. On ne perd en fait pas en généralité en faisant c<strong>et</strong>te hypothèse :<br />
si l’on souhaite que certains nonces soient en fait connus de l’intrus initialement, il suffit d’ajouter au protocole<br />
quelques transitions initiales divulguant les nonce souhaités à l’intrus, comme dans la section suivante.)<br />
La notion d’existence initiale est formalisée directement par le prédicat exists0 :<br />
exists0(crypt(A, M, K)) :- exists0(A), exists0(M), exists0(K).<br />
exists0(tuple(L)) :- exists0(L).<br />
133
J. Goubault-Larrecq<br />
exists0(nil()).<br />
exists0(cons(M, L)) :- exists0(M), exists0(L).<br />
exists0(p(_)).<br />
exists0(a(_)).<br />
exists0(apply(F, M1, ..., Mn)) :- exists0(M1), ..., exists0(Mn).<br />
exists0(hash-apply(F, M1, ..., Mn)) :- exists0(M1), ..., exists0(Mn).<br />
exists0(secr<strong>et</strong>-apply(F, M1, ..., Mn)) :- exists0(M1), ..., exists0(Mn).<br />
exists0(hash-secr<strong>et</strong>-apply(F, M1, ..., Mn)) :- exists0(M1), ..., exists0(Mn).<br />
exists0(apply-pubk(A, F, M1, ..., Mn)) :- exists0(M1), ..., exists0(Mn).<br />
exists0(hash-apply-pubk(A, F, M1, ..., Mn)) :- exists0(M1), ..., exists0(Mn).<br />
exists0(apply-privk(A, F, M1, ..., Mn)) :- exists0(M1), ..., exists0(Mn).<br />
exists0(hash-apply-privk(A, F, M1, ..., Mn)) :- exists0(M1), ..., exists0(Mn).<br />
Pour formaliser l’hypothèse ���¦� , on commence par écrire :<br />
not-knows0(secr<strong>et</strong>-apply(_, ...)).<br />
not-knows0(hash-secr<strong>et</strong>-apply(_, ...)).<br />
not-knows0(apply-privk(_, _, ...)).<br />
not-knows0(hash-apply-privk(_, _, ...)).<br />
ce qui exprime que l’intrus n’est effectivement pas capable de déduire les messages supposés secr<strong>et</strong>s<br />
initialement.<br />
�������<br />
� � �<br />
�������<br />
On écrit maintenant à quelles conditions un message chiffré est inconnu initialement. (Nous nous<br />
contenterons de traiter des algorithmes de chiffrement symétriques par souci de simplicité.) Le message<br />
ne peut pas être connu de l’intrus si <strong>et</strong> seulement si est lui-même inconnu <strong>et</strong> est connue. En eff<strong>et</strong>, si<br />
était inconnue, alors doit être dans �<br />
�����¦� � : sinon, intuitivement, on pourrait rajouter à �<br />
�<br />
���¦�<br />
sans<br />
violer la condition ci-dessus, contredisant la maximalité de �<br />
� � �<br />
� � �����¦�<br />
. Si est connue, en revanche, alors doit<br />
être lui-même inconnu sinon l’intrus pourrait déduire à partir de <strong>et</strong> . On écrit donc :<br />
not-knows0(crypt(a(sa(_)), M, K)) :- not-knows0(M), knows0(K).<br />
Un � -upl<strong>et</strong> est inconnu si <strong>et</strong> seulement si au moins une de ses composantes est inconnue, ce qu’on peut écrire<br />
comme suit :<br />
not-knows0(tuple(L)) :- not-knows-list0(L).<br />
not-knows-list0(cons(M, _)) :- not-knows0(M).<br />
not-knows-list0(cons(M, L)) :- knows0(M), not-knows-list0(L).<br />
Sachant ce qui est inconnu de l’intrus, nous pouvons maintenant définir ce qui est connu de l’intrus initialement.<br />
D’abord, l’intrus est supposé connaître toutes les ��� � identités , tous les algorithmes de ���<br />
chiffrement<br />
toutes les clés � ������� -���������¦� -���©¢©¤��<br />
��� �<br />
publiques<br />
mentionnés dans l’hypothèse ���¦� :<br />
�����<br />
� , mais aucune donnée de base ���<br />
�����<br />
� ,<br />
�����<br />
� , ni aucun des secr<strong>et</strong>s<br />
knows0(p(_)).<br />
knows0(a(_)).<br />
knows0(apply-pubk(_, _, M1, ..., Mn)) :- exists0(M1), ..., exists0(Mn).<br />
knows0(hash-apply-pubk(_, _, M1, ..., Mn) :- exists0(M1), ..., exists0(Mn).<br />
�����¦� ������� Pour ce qui est des chiffrements, l’intrus connaît , autrement dit doit être dans �<br />
�<br />
�<br />
, si <strong>et</strong> seulement<br />
si est dans �<br />
� � �<br />
� � �<br />
� � �������<br />
�������<br />
<strong>et</strong> est un message qui existe initialement, ou bien est un message qui existe initialement<br />
<strong>et</strong> est inconnu. En eff<strong>et</strong>, supposons le contraire : est initialement inconnu, <strong>et</strong> est initialement connu<br />
(noter que comme est connu, il existe initialement, donc <strong>et</strong> aussi). Alors le raisonnement que nous<br />
avons effectué plus haut pour le prédicat not-knows0 appliqué aux chiffrements montre que nécessairement<br />
sera inconnu initialement, une contradiction. On écrit donc :<br />
134
Protocoles cryptographiques: la logique à la rescousse!<br />
knows0(crypt(a(sa(_)), M, K)) :- knows0(M), exists0(K).<br />
knows0(crypt(a(sa(_)), M, K)) :- exists0(M), not-knows0(K).<br />
Il reste à préciser la définition de knows0 sur les autres symboles de fonction. C’est simple :<br />
knows0(tuple(L)) :- knows-list0(L).<br />
knows-list0(nil()).<br />
knows-list0(cons(M, L)) :- knows0(M), knows-list0(L).<br />
knows0(p(_)).<br />
knows0(a(_)).<br />
knows0(apply(F, M1, ..., Mn)) :- knows0(M1), ..., knows(Mn).<br />
knows0(hash-apply(_, M1, ..., Mn)) :- exists0(M1), ..., exists0(Mn).<br />
Noter que apply se comporte exactement comme tuple, alors que hash-apply se comporte comme un<br />
chiffrement avec une clé inconnue de l’intrus.<br />
4.2.2. Déductions de l’intrus<br />
La notion de conditions initiales de la section précédente est probablement la plus compliquée de toute<br />
la formalisation. La formalisation de knows est beaucoup plus transparente. D’abord, un message M est<br />
déductible de �<br />
union E s’il est dans � �<br />
, ou dans E : �<br />
knows(E, M) :- knows0(M).<br />
knows(E, M) :- in-list(E,M).<br />
in-list(cons(M, _), M).<br />
in-list(cons(_, L), M) :- in-list(L, M).<br />
Ensuite, on écrit les règles pour le � � prédicat , adaptées au modèle décrit informellement en début de<br />
section 4.1 :<br />
knows(E, crypt(_, M, K)) :- knows(E, M), knows(E, K).<br />
knows(E, M) :- knows(E, crypt(a(sa(_)), M, K)), knows(E, K).<br />
knows(E, M) :- knows(E, crypt(a(aa(A)), M,<br />
apply-pubk(a(aa(A)), F, M1, ..., Mn))),<br />
knows(E, apply-privk(a(aa(A)), F, M1, ..., Mn)).<br />
knows(E, M) :- knows(E, crypt(a(aa(A)), M,<br />
hash-apply-pubk(a(aa(A)), F, M1, ..., Mn))),<br />
knows(E, hash-apply-privk(a(aa(A)), F, M1, ..., Mn)).<br />
knows(E, M) :- knows(E, crypt(a(aa(A)), M,<br />
apply-privk(a(aa(A)), F, M1, ..., Mn))),<br />
knows(E, apply-pubk(a(aa(A)), F, M1, ..., Mn)).<br />
knows(E, M) :- knows(E, crypt(a(aa(A)), M,<br />
hash-apply-privk(a(aa(A)), F, M1, ..., Mn))),<br />
knows(E, hash-apply-pubk(a(aa(A)), F, M1, ..., Mn)).<br />
Les quatre dernières clauses énoncent que si l’intrus �����§� connaît <strong>et</strong> la clé ��� � inverse pour l’algorithme de<br />
chiffrement asymétrique A, alors l’intrus � connaît aussi. On notera que la notion de clés inverses est définie<br />
par le fait que l’inverse �������� -���������¦� -���£¢¥¤��<br />
�����<br />
� de � ������� -���������§� -�����§¦�¤��<br />
��� �<br />
� est <strong>et</strong> réciproquement. (Exercice :<br />
revenir à la section précédente <strong>et</strong> traiter des conditions initiales pour les chiffrements à clés asymétriques. Il est<br />
nécessaire d’introduire des prédicats énonçant quand un message doit avoir un inverse pour un algorithme A<br />
donné qui est connu initialement, resp. inconnu initialement.)<br />
���<br />
Pour � les -upl<strong>et</strong>s, on exprime � ����� que<br />
: �<br />
�<br />
�<br />
�����<br />
��� ��� est connu si <strong>et</strong> seulement si chaque �<br />
135<br />
� est connu,
J. Goubault-Larrecq<br />
knows(E, tuple(L)) :- knows-list(E, L).<br />
knows(E, nil()).<br />
knows(E, cons(M, L)) :- knows(E, M), knows-list(E, L).<br />
knows(E, M) :- knows-list(E, cons(M, L)).<br />
knows-list(E, L) :- knows-list(E, cons(M, L)).<br />
knows-list(E, L) :- knows(E, tuple(L)).<br />
On peut découper l’ensemble de clauses ci-dessus en deux sous-ensembles. Les trois premières clauses<br />
expriment que l’intrus peut fabriquer � des -upl<strong>et</strong>s, les trois dernières qu’il peut décomposer � des -upl<strong>et</strong>s. Les<br />
��� diffèrent précisément en fonction du fait que l’intrus<br />
���<br />
� ������� -�����§�������§� -���������¦���¡ ��������<br />
�����<br />
constructions<br />
peut ou non fabriquer de tels (�¦��������� messages ), <strong>et</strong> qu’il peut ou non décomposer de tels (������� messages ).<br />
On écrit donc :<br />
knows(E, apply(F, M1, ..., Mn)) :- knows(E, M1), ..., knows(E, Mn).<br />
knows(E, M1) :- knows (E, apply (F, M1, ..., Mn)).<br />
...<br />
knows(E, Mn) :- knows (E, apply (F, M1, ..., Mn)).<br />
knows(E, hash-apply(F, M1, ..., Mn)) :- knows(E, M1), ..., knows(E, Mn).<br />
knows(E, M1) :- knows (E, secr<strong>et</strong>-apply (F, M1, ..., Mn)).<br />
...<br />
knows(E, Mn) :- knows (E, secr<strong>et</strong>-apply (F, M1, ..., Mn)).<br />
<strong>et</strong> il n’y a donc aucune clause portant sur hash-secr<strong>et</strong>-apply.<br />
Les autres clauses sont alors faciles à écrire :<br />
knows(E, p(_)).<br />
knows(E, a(_)).<br />
knows(E, apply-pubk(A, F, M1, ..., Mn)) :- knows(E, M1), ..., knows(E, Mn).<br />
knows(E, M1) :- knows (E, apply-pubk (A, F, M1, ..., Mn)).<br />
...<br />
knows(E, Mn) :- knows (E, apply-pubk (A, F, M1, ..., Mn)).<br />
knows(E, hash-apply-pubk(A, F, M1, ..., Mn)) :knows(E,<br />
M1), ..., knows(E, Mn).<br />
knows(E, M1) :- knows (E, apply-privk (A, F, M1, ..., Mn)).<br />
...<br />
knows(E, Mn) :- knows (E, apply-privk (A, F, M1, ..., Mn)).<br />
4.2.3. Modélisation des protocoles<br />
Nous n’allons pas redire comment modéliser un protocole cryptographique comme celui de la section 3.2.<br />
Cependant la structure des termes représentant les messages est suffisamment différente pour que nous<br />
expliquions ici comment la modélisation en termes de clauses de Horn opère dans le nouveau contexte.<br />
En particulier, nous allons éviter d’utiliser le prédicat Prolog d’égalité, ce qui simplifiera notre travail de<br />
vérification dans la suite. Nous allons aussi éviter d’utiliser des primitives Prolog (éventuellement non<br />
spécifiées) comme nous l’avons fait en section 3.2.<br />
La modélisation des envois de message ne change fondamentalement pas. Cependant, nous allons éviter<br />
d’utiliser une fonction externe add comme dans le passage de avant-1 à entre-1-<strong>et</strong>-2 pour l’agent A<br />
136
Protocoles cryptographiques: la logique à la rescousse!<br />
(cf. section 3.2), <strong>et</strong> nous allons changer la spécification de la création du ��� nonce de façon plus précise.<br />
En plus des � composants � , ��� , ����� , ����� , � , ��� , <strong>et</strong> d’une constante dénotant la ligne du protocole<br />
que nous utilisions dans la modélisation de l’état de l’agent A en section 3.2, nous allons inclure un entier<br />
Ses dénotant le numéro de session où l’agent joue le rôle de A. (Un entier est ici un terme de la forme<br />
ce numéro de session. En fait, pour des questions de fidélité des approximations que nous effectuerons à partie<br />
de la section 4.3, nous allons considérer que le nonce �¡� est une fonction nonce-A-1 non seulement de �<br />
mais aussi des valeurs courantes des autres variables de l’état de � :<br />
�<br />
����� �<br />
�������¨�<br />
����� �<br />
� , représentant un entier en unaire.) Le nonce �¡� nouvellement créé sera alors une fonction de<br />
Pa((avant-1, Ses, A, B, _, Kas, Kab, M, Nb), E<br />
(entre-1-<strong>et</strong>-2, Ses, A, B,<br />
nonce-A-1(Ses, A, B, Kas, Kab, M, Nb),<br />
Kas, Kab, M, Nb),<br />
cons ([A, B, nonce-A-1(Ses, A, B, Kas, Kab, M, Nb)], E)).<br />
Ceci est exactement équivalent à la clause :<br />
Pa((avant-1, Ses, A, B, _, Kas, Kab, M, Nb), E<br />
(entre-1-<strong>et</strong>-2, Ses, A, B, Na, Kas, Kab, M, Nb), E’) :-<br />
Na=nonce-A-1(Ses, A, B, Kas, Kab, M, Nb),<br />
E’=cons ([A, B, Na], E).<br />
en adoptant pour = la sémantique de l’égalité de Prolog. Quoique la deuxième forme soit plus lisible que la<br />
première, <strong>et</strong> plus proche de ce que nous avons écrit en section 3.2, nous adopterons le premier style d’écriture<br />
pour bien montrer que nous n’avons pas besoin de prédicat d’égalité.<br />
Pour modéliser la réception du message ����������������������������������������������� par A dans la deuxième étape du<br />
protocole. Ici deux problèmes se posent : comme exprimer le déchiffrement de ce message sans utiliser de<br />
fonction decrypt comme en section 3.2, <strong>et</strong> comment vérifier que les composantes ��� <strong>et</strong> � du message une<br />
fois déchiffré sont égales aux composantes �¡� <strong>et</strong> � stockées dans l’état de A, sans utiliser de prédicat d’égalité.<br />
Les deux problèmes sont très simples, en fait.<br />
� �<br />
� �<br />
¤����������<br />
�<br />
����������� �<br />
¤����������<br />
�<br />
������� ���£� � ��� � �<br />
�<br />
Dans le premier cas, pour déchiffrer le message reçu avec une clé , <strong>et</strong> récupérer le texte en clair il suffit<br />
d’exprimer que, si l’on rechiffrait avec la clé , on obtiendrait un terme déductible par l’intrus ; autrement<br />
dit, on doit avoir . Si la méthode de chiffrement était asymétrique, pour déchiffrer avec<br />
nous demanderions que soit satisfait, où est l’inverse de pour l’algorithme de<br />
chiffrement considéré. (Si n’est pas une clé pour l’algorithme de chiffrement donné, le déchiffrement est<br />
impossible, <strong>et</strong> la transition impliquant le déchiffrement ne sera pas franchie.)<br />
Dans le deuxième cas, la vérification de l’égalité des deux occurrences de ��� s’opérera naturellement en<br />
plaçant la même variable logique ��� aux deux occurrences concernées (ci-dessous, en argument dans les états<br />
de A, <strong>et</strong> à l’intérieur du prédicat knows). On aboutit à la clause :<br />
Pa((entre-1-<strong>et</strong>-2, Ses, A, B, Na, Kas, _, _, Nb), E,<br />
(entre-2-<strong>et</strong>-3, Ses, A, B, Na, Kas, Kab, M, Nb), E) :knows(E,<br />
crypt(a(sa(vanilla())), [Na, B, Kab, M], Kas)).<br />
Bien que nous ayons présenté la traduction en clauses de Horn sur un exemple, il est clair que le processus<br />
est en fait automatisable. Nous laissons le reste de la dérivation du protocole en exercice, ayant en fait exploré<br />
dans les deux clauses ci-dessus toutes les constructions nécessaires à modéliser les protocoles cryptographiques.<br />
En particulier, nous supposons que nous avons maintenant un ensemble ���<br />
de clauses de Horn, définissant<br />
���<br />
toutes les exécutions possibles du protocole au travers d’un prédicat binaire exec, tel exec�������¡��� que est<br />
déductible à partir de ���<br />
si <strong>et</strong> seulement s’il existe une exécution du protocole partant de la configuration<br />
���<br />
globale � <strong>et</strong> aboutissant à la configuration globale � � .<br />
137
J. Goubault-Larrecq<br />
4.2.4. Qu’est-ce qu’une preuve de sécurité ?<br />
Nous avons dorénavant un ensemble de clauses de Horn décrivant précisément toutes les exécutions<br />
possibles d’un protocole donné. Nous avons encore à préciser comment nous modélisons les propriétés de<br />
sécurité. Il existe de nombreuses propriétés de sécurité auxquelles on peut s’intéresser, <strong>et</strong> nous allons nous<br />
intéresser uniquement à des propriétés d’accessibilité, c’est-à-dire des propriétés de la forme :<br />
Peut-on atteindre, depuis une configuration globale initiale, une configuration globale vérifiant la propriété � ?<br />
où � est une propriété des configurations globales. En guise d’exemple, nous allons considérer la propriété<br />
suivante :<br />
Peut-on atteindre, depuis une configuration globale initiale, une configuration globale où l’agent A est dans<br />
l’état entre-2-<strong>et</strong>-3 <strong>et</strong> possède une clé �¤��� déductible par l’intrus ?<br />
Autrement dit, si l’on en prend la négation, est-il toujours vrai que la clé ����� que A reçoit à l’étape 2<br />
du protocole est secrète ? Ici la propriété � est que, considérant une configuration globale de la forme<br />
((entre-2-<strong>et</strong>-3, _, _, _, _, _, Kab, _, _), Eb, Es, E), on ait knows(E, Kab).<br />
Il est facile d’écrire une clause qui sera déclenchée dès que la propriété d’accessibilité est réalisée :<br />
non-secr<strong>et</strong>() :exec(((avant-1,<br />
0(), _, _, _, Kas-of-A, _, _),<br />
(avant-1, 0(), _, _, _, Kbs-of-B),<br />
(avant-1, 0(), _, _, _, Kab-of-S, Kas-of-S, Kbs-of-S),<br />
nil()),<br />
((entre-2-<strong>et</strong>-3, _, _, _, _, _, Kab-of-A, _, _), _, _, E)),<br />
not-knows0(Kas-of-A),<br />
not-knows0(Kas-of-S),<br />
not-knows0(Kbs-of-B),<br />
not-knows0(Kbs-of-S),<br />
not-knows0(Kab-of-S),<br />
knows(E, Kab-of-A).<br />
Littéralement, le nouveau prédicat non-secr<strong>et</strong>() sera déductible de l’ensemble de clauses ���<br />
<strong>et</strong> ���<br />
de la clause ci-dessus si <strong>et</strong> seulement s’il existe une exécution du protocole, partant d’un état initial où<br />
l’intrus n’a encore récupéré aucun message (l’ensemble E initial est nil()), telle que les clés initiales<br />
<strong>et</strong> �¤��� des divers principaux ainsi que la clé ����� créée par le serveur � sont secrètes (les conditions<br />
�����<br />
not-knows0(...)), <strong>et</strong> aboutissant à un état où A se trouve à l’état entre-2-<strong>et</strong>-3 <strong>et</strong> dispose d’une clé<br />
qui est connue de l’intrus à ce point. En d’autres termes, non-secr<strong>et</strong>() sera déductible si <strong>et</strong> seulement<br />
�����<br />
si la propriété d’accessibilité est vérifiée. (On notera ici qu’on n’a pas supposé que les différentes ����� clés ,<br />
par exemple, de A <strong>et</strong> de S étaient les mêmes ; il n’est pas difficile d’imposer c<strong>et</strong>te condition, cependant ceci<br />
affaiblit la portée de la propriété de sécurité vérifiée.)<br />
Il est important de noter que le fait que non-secr<strong>et</strong>() soit déductible signifie qu’un état où la clé �����<br />
n’est pas secrète est accessible depuis les conditions initiales. Autrement dit, qu’une attaque est possible.<br />
Il est naturel de penser qu’une déduction, une preuve d’un prédicat tel que non-secr<strong>et</strong>() devrait avoir<br />
quelque chose à voir avec une preuve de sécurité. Il est important de remarquer que les deux notions de preuves<br />
sont en fait complémentaires, <strong>et</strong> non identiques :<br />
– Une preuve d’accessibilité (ici, de non-secr<strong>et</strong>()) est une attaque.<br />
– Une preuve de sécurité correspond à l’absence d’une preuve d’accessibilité.<br />
En général, un moyen constructif de montrer qu’un preuve (d’accessibilité, ici) n’existe pas est de construire un<br />
contre-modèle. C<strong>et</strong>te observation cruciale est due à P<strong>et</strong>er Selinger [51]. Nous allons voir comment construire<br />
automatiquement de tels modèles, dans un grand nombre de cas, en sections 4.3 <strong>et</strong> suivantes.<br />
138
4.2.5. Comment décider une propriété d’accessibilité ?<br />
Protocoles cryptographiques: la logique à la rescousse!<br />
À ce point, le problème de l’accessibilité dans les protocoles cryptographiques est réduit au problème de la<br />
prouvabilité dans le fragment des clauses de Horn de la logique classique du premier ordre. Malheureusement,<br />
ce problème est indécidable.<br />
Que la prouvabilité dans ce cadre logique soit indécidable peut signifier l’une des deux choses suivantes :<br />
ou bien la vérification de protocoles cryptographiques est intrinsèquement difficile, ou bien nous nous sommes<br />
trompés de langage pour traduire les protocoles cryptographiques <strong>et</strong> avons compliqué le problème inutilement.<br />
Il s’avère qu’en fait, la vérification de protocoles cryptographiques est effectivement difficile, en fait indécidable<br />
elle-même [21] sauf dans certains cas relativement limités (nombre de sessions borné <strong>et</strong> pas de boucle dans les<br />
rôles des principaux, état initial �<br />
de l’intrus connu <strong>et</strong> fini, voir par exemple [49]). Nous allons voir que la<br />
�<br />
formalisation au premier ordre offre des possibilités de vérification intéressantes, nonobstant son indécidabilité.<br />
La première façon de décider d’un ensemble de clauses de Horn est d’utiliser un outil de démonstration<br />
automatique de formules du premier ordre. Parmi les plus adaptés aujourd’hui, on compte Otter [36], Vampire<br />
[47], SPASS [57], E-S<strong>et</strong>heo [41], notamment. C<strong>et</strong>te approche de la vérification des protocoles cryptographiques<br />
est notamment celle <strong>propos</strong>ée par Weidenbach [55].<br />
Le problème de la prouvabilité en logique du premier ordre est indécidable, mais les outils ci-dessus sont<br />
compl<strong>et</strong>s : s’il existe une preuve, ils la trouveront (en principe du moins). En conséquence, ces outils peuvent :<br />
– trouver une preuve, c’est-à-dire une attaque ;<br />
– ou terminer sans avoir trouvé une preuve, c’est-à-dire fournir une preuve de sécurité ;<br />
– ou ne pas terminer, auquel cas le protocole est sûr, mais on ne le saura jamais.<br />
Le deuxième cas est rare, <strong>et</strong> l’approche, telle quelle, n’aboutit que très peu souvent à une preuve de sécurité.<br />
De plus, même lorsqu’un de ces outils termine sans avoir trouvé de preuve, il est difficile d’en extraire un<br />
argument de sécurité (un modèle, donc) qui soit indépendamment vérifiable par d’autres sources — un besoin<br />
grandissant, notamment dans la certification CC [15].<br />
Au passage, en principe la simple utilisation de Prolog serait elle-même envisageable. En pratique, Prolog<br />
réalise une stratégie de recherche de preuve incomplète, qui n’est donc même pas garantie de trouver une<br />
attaque en temps fini s’il en existe une, au contraire des outils ci-dessus.<br />
Un cas intéressant est dû à Blanch<strong>et</strong> [7], qui montre qu’au lieu d’utiliser des techniques à base de résolution<br />
comme dans certains des outils ci-dessus (résolution ordonnée en SPASS, hyperrésolution en Otter), un<br />
raffinement légèrement différent où une forme de résolution ordonnée restreinte à certaines formes de clauses<br />
(la résolution gardée) est utilisé, pour compléter l’ensemble de clauses initiale. Si ce processus termine, alors on<br />
peut effacer un grand nombre de clauses devenues inutiles, <strong>et</strong> une autre forme de résolution (appelée recherche<br />
en arrière avec détection de cycles ; il s’agit d’hyperrésolution positive) produit alors une procédure de décision<br />
qui termine sur l’ensemble de clauses résultant. Blanch<strong>et</strong> applique c<strong>et</strong>te méthode à la vérification du protocole<br />
Skeme [7]. Il est à noter que la phase de prétraitement par résolultion gardée ne termine pas toujours. De plus,<br />
le modèle de Blanch<strong>et</strong> est légèrement différent du nôtre.<br />
4.3. Approximations <strong>et</strong> types descriptifs<br />
Une autre approche de la vérification de protocoles cryptographiques, <strong>et</strong> en fait de n’importe quel problème<br />
indécidable, est par approximation. En général, l’idée est de transformer le problème � à résoudre en un<br />
problème � � qui soit décidable d’une part, <strong>et</strong> tel que d’autre part une réponse positive à � � implique une<br />
réponse positive à � .<br />
L’approximation du problème de la prouvabilité est un problème difficile, <strong>et</strong> à l’heure actuelle non résolu<br />
de façon satisfaisante. La bonne nouvelle ici est l’observation de Selinger : vérifier des propriétés de sécurité<br />
(au moins celles d’accessibilité) est la négation du problème de la prouvabilité, à savoir le problème de la<br />
satisfiabilité, c’est-à-dire l’existence d’un modèle.<br />
Or on connaît une famille extrêmement efficace d’approximations pour le problème de la satisfiabilité : les<br />
139
J. Goubault-Larrecq<br />
typage descriptifs. Il s’agit de familles d’algorithmes de typage de programmes Prolog, qui tentent de découvrir<br />
les types des variables qui mènent à une déduction réussie d’un but donné. Par exemple, considérons l’ensemble<br />
de clauses :<br />
double(0(),0()).<br />
double(s(X),s(s(Y))) :- double(X,Y).<br />
Il est relativement facile de se convaincre que les seules formules dérivables de la forme double�����¨��� sont<br />
telles que � est un entier en unaire, <strong>et</strong> � est un entier pair, qui vaut le double de � .<br />
Un mécanisme de typage descriptif est un moyen d’attribuer à chaque variable � de chaque clause un<br />
type � , c’est-à-dire un ensemble de termes clos (sans variables), tel que toute utilisation de la clause dans une<br />
déduction instantiera � à un terme du type � (plus précisément, un terme dont toutes les instances closes sont<br />
dans � ). Dans l’exemple ci-dessus, on peut ainsi attribuer à � dans la deuxième clause le type ����� des entiers<br />
unaires :<br />
<strong>et</strong> à � le type ������� des entiers pairs :<br />
������� ��� 0����� s�������¨�<br />
�������¡����� 0����� s� s�����������¨�<br />
Connaissant ces types, on constate que, si on ajoute aux clauses ci-dessus la clause<br />
false :- double (X, s(0())).<br />
il n’y a aucun moyen de déduire false. On peut bien sûr le voir en lançant un des outils de démonstration<br />
automatique mentionnés plus haut. L’exemple est suffisamment simple pour qu’un prouver à base de résolution<br />
ordonnée, comme SPASS, termine sans trouver de contradiction. Mais c’est encore plus visible par typage : si<br />
on pouvait déduire false, ç’aurait été avec une valeur du deuxième argument de double paire, par typage.<br />
Mais on ne peut déduire false qu’en passant la valeur un (s(0())), qui n’est pas paire.<br />
Il n’est a priori pas facile de trouver de tels types descriptifs. Frühwirth <strong>et</strong> al. [24] <strong>propos</strong>e une méthode<br />
extrêmement élégante <strong>et</strong> complètement automatisée. Elle procède en trois étapes (nous prenons quelques<br />
libertés avec [24]), consistant à transformer l’ensemble de clauses initial ��� en un nouvel ensemble de clauses<br />
� décrivant les types des variables :<br />
– On crée un nouveau prédicat type, prenant un argument, <strong>et</strong> autant de symboles de ©� fonctions<br />
qu’il y a de symboles de � prédicats dans l’ensemble de ��� clauses de départ. L’idée est que<br />
����������<br />
type�¡<br />
ensemble de toutes les ���������<br />
formules<br />
�������¨� sera déductible de � si ���������<br />
�����<br />
�¨����� est déductible de ��� : type décrit un sur-<br />
�����<br />
������� déductibles de ��� .<br />
�����<br />
– Pour toute clause � de ��� , de la forme<br />
�¨�����£���<br />
<strong>et</strong> chaque variable libre � de � , on crée un prédicat type-� -� , prenant un argument. L’idée est que<br />
�����<br />
�¨����� :-� �������¨���<br />
�����<br />
������� � ���<br />
�����<br />
����������� ���<br />
�����<br />
���������<br />
utilisant la � clause , comme dans l’exemple ci-dessus. ����� Soient<br />
, listées de gauche à droite. (Il est possible qu’une même variable soit donc listée plusieurs<br />
�������<br />
fois.) �����<br />
��� Soient les termes<br />
-�����¨� sera déductible de � si � est une valeur possible pour la variable � dans une déduction<br />
�����<br />
type-�<br />
les variables libres dans la tête<br />
�����<br />
�����<br />
���������<br />
�����<br />
�����<br />
����� où �<br />
type�¡ ������<br />
����� � �����<br />
�����<br />
���<br />
�����<br />
�<br />
� ���<br />
�<br />
�<br />
���<br />
�<br />
des variables fraîches, <strong>et</strong> distinctes deux à deux. Soient<br />
est remplacée par , . On remplace alors par les clauses :<br />
�����<br />
��� �����¨� :- type-� -�������������<br />
�����<br />
� type-� -���������¦�<br />
�����<br />
����� �����<br />
-����������� :- type�¡ �� � ���������<br />
type-�<br />
�����<br />
������� � �¨���<br />
type�¡ ���������� ���<br />
�����<br />
�����������¨�<br />
�<br />
-���������¦� :- type�¡ �� � ���������<br />
�����<br />
������� � �¨���<br />
�����<br />
� type�¡ �� � ����� ���<br />
�����<br />
������� � �¨�<br />
type-�<br />
140
Par exemple, en partant des clauses ci-dessus, on obtient :<br />
Protocoles cryptographiques: la logique à la rescousse!<br />
type(f-double(0(), 0())).<br />
type(f-double(s(X), s(s(Y)))) :- type-C2-X(X), type-C2-Y(Y).<br />
type-C2-X(X) :- type(f-double(X,Y)).<br />
type-C2-Y(Y) :- type(f-double(X,Y)).<br />
On peut se demander quel est l’avantage de décrire les types des variables d’un ensemble de clauses ��� par<br />
un autre ensemble de clauses. Il se résume en ceci : savoir si un type est vide est décidable — <strong>et</strong> le problème<br />
est DEXPTIME-compl<strong>et</strong> [24].<br />
Ceci nous mène à une procédure d’approximation, qui termine en temps exponentiel, pour examiner la<br />
sécurité des protocoles cryptographiques :<br />
1. Traduire le protocole cryptographique en un ensemble ���<br />
de clauses, plus les clauses correspondant<br />
���<br />
aux propriétés de sécurité, comme en section 4.2, obtenant un ensemble de ��� clauses .<br />
2. Produire l’approximation par types descriptifs � .<br />
3. Décider par l’algorithme de [24] si l’une des propriétés d’accessibilité est déductible de � . Si ce n’est<br />
pas le cas, alors le protocole cryptographique est sûr, par rapport aux propriétés demandées, sous les<br />
hypothèses initiales données, <strong>et</strong> dans le modèle de sécurité choisi. Sinon, on ne peut pas conclure.<br />
On notera que les deux premiers étapes s’effectuent en temps polynomial. Bien que la dernière partie s’effectue<br />
en temps exponentiel, elle est souvent rapide (d’une fraction de seconde à quelques minutes).<br />
Il est montré que l’algorithme de [24] produit en plus un automate d’arbres finis décrivant exactement un<br />
modèle, qui de plus est un modèle fini. Ce modèle est, d’après l’observation de Selinger, exactement ce que<br />
nous cherchions en termes de preuve de sécurité.<br />
Dans l’exemple du prédicat double ci-dessus, c<strong>et</strong> algorithme essentiellement produit l’ensemble de<br />
clauses suivant pour le prédicat de typage type-C2-Y :<br />
type-C2-Y(0()).<br />
type-C2-Y(s(s(Y))) :- type-C2(Y).<br />
qui est exactement le type des entiers unaires pairs, que nous avions écrit sous forme du type ������� ci-dessus.<br />
Nous avons donc trouvé une méthode automatique qui trouve des preuves de sécurité de propriétés<br />
d’accessibilité de protocoles cryptographiques. C<strong>et</strong>te méthode n’est pas complète : il y a des protocoles<br />
cryptographiques sûrs que c<strong>et</strong>te méthode ne parviendra pas à prouver. Mais elle est correcte : un protocole<br />
présentant une attaque ne pourra pas être prouvé par c<strong>et</strong>te méthode (il n’y a aucun modèle). En un sens, il<br />
s’agit bien d’un algorithme de typage : tout protocole typé est correct, mais il existe des protocoles corrects non<br />
typés ; c’est exactement la philosophie du typage de ML par exemple [39], où tout programme typé est correct<br />
au sens où il n’y aura pas d’erreur de types à l’exécution, mais il existe des programmes ne présentant aucune<br />
erreur à l’exécution <strong>et</strong> qui pourtant ne sont pas bien typés.<br />
La question cruciale ici est : c<strong>et</strong>te méthode de vérification est-elle suffisamment précise ? Autrement dit, la<br />
proportion de protocoles sûrs que c<strong>et</strong>te méthode arrive à montrer corrects est-elle satisfaisante ? Nous allons<br />
répondre à c<strong>et</strong>te question en section 4.5.<br />
4.4. À <strong>propos</strong> de la relation entre clauses <strong>et</strong> automates d’arbres<br />
En fait, les techniques de résolution ordonnée [23], qui forment déjà le cœur du prouveur SPASS [57],<br />
terminent sur la classe des clauses que l’on obtient par la procédure d’approximation ci-dessus. (On pourra<br />
aussi consulter [27] pour un traitement compl<strong>et</strong> de ce genre de clauses, généralisés à l’ordre supérieur, par des<br />
techniques de résolution ordonnée.)<br />
141
J. Goubault-Larrecq<br />
Fixons une signature � , c’est-à-dire un ensemble de symboles de fonction, équipés d’une arité, c’est-à-dire<br />
du nombre d’arguments que prend chaque symbole de fonction. Un automates d’arbres non déterministe � est<br />
un ensemble fini de clauses de la forme :<br />
Les clauses (1) sont appelées des clauses montantes, ou des transitions ordinaires d’automates d’arbres. Elles<br />
��������<br />
�����<br />
�������¨� :-� �����������<br />
�����<br />
������������� (1)<br />
���¡<br />
peuvent se lire : ��� “si est un terme reconnu à ��� l’état , <strong>et</strong> . . ., ��� <strong>et</strong> est reconnu à ��� l’état , alors le terme<br />
�����<br />
������� est reconnu à l’état � ”.<br />
��������<br />
Par exemple, l’automate suivant reconnaît l’ensemble des listes d’entiers pairs :<br />
q-even(0()).<br />
q-even(s(X)) :- q-odd(X).<br />
q-odd(s(X)) :- q-even(X).<br />
q-list-even(nil()).<br />
q-list-even(cons(X,Y)) :- q-even(X), q-list-even(Y).<br />
On représente souvent les automates d’arbres par des hypergraphes, c’est-à-dire des graphes dont les arcs (les<br />
transitions) passent par deux ou davantage de somm<strong>et</strong>s. L’automate ci-dessus se représente alors notamment<br />
comme en figure 5. Il y a notamment une transition étiqu<strong>et</strong>ée par le symbole de fonction cons qui va de la paire<br />
d’états q-even, q-list-even vers l’état q-list-even, <strong>et</strong> qui représente la dernière clause ci-dessus.<br />
0<br />
q even<br />
S (_)<br />
q odd<br />
cons (_, _)<br />
S (_)<br />
nil<br />
q list−even<br />
FIG. 5 – Un automate d’arbres reconnaissant les listes d’entiers pairs<br />
En réalité, les clauses montantes ne sont des transitions normales d’automates d’arbres que quand les<br />
variables ��� , . . ., ��� sont distinctes deux à deux. Dans le cas contraire, on obtient des automates dits à<br />
contraintes d’égalité entre frères [8].<br />
On peut compliquer la notion d’automates d’arbres. Notamment, un automate d’arbres alternant a en plus<br />
des clauses intersection de la forme :<br />
Un automate bidirectionnel peut aussi inclure des clauses descendantes, de la forme :<br />
�<br />
:-� ���������<br />
�����<br />
����������� (2)<br />
�������<br />
� ��������<br />
�����<br />
�¨�����¨�����<br />
�<br />
�<br />
���<br />
�<br />
� ���<br />
����� ���<br />
��� ���<br />
:-���¡ �<br />
��� �<br />
où ���<br />
�<br />
�<br />
� , ���<br />
�<br />
����� � . Si �����<br />
����� �<br />
�����<br />
������� “si est reconnu � en , �<br />
�<br />
alors est reconnu �<br />
��������<br />
en<br />
���<br />
� (3)<br />
, il s’agit d’une clause descendante standard, qui signifie<br />
� ���<br />
”, <strong>et</strong> qui est souvent appelée une transition<br />
d’empilement (“pushdown transition”). Les autres clauses descendantes sont dites conditionnelles. Par exemple,<br />
���<br />
�<br />
��� :-���¡ ����������¤���¨�����������¤���<br />
�<br />
exprime que ����������¤��� si est reconnu � en , <strong>et</strong> pourvu ��� que soit aussi reconnu ��� en , ��� alors est reconnu<br />
� � en . Par exemple, si la clause<br />
142
knows(crypt(A, M, K)) :- knows(M), knows(K).<br />
Protocoles cryptographiques: la logique à la rescousse!<br />
qui exprime que l’intrus peut toujours chiffrer, est une clause montante, la clause symétrique<br />
knows(M) :- knows(crypt(A, M, K)), knows(K)<br />
qui exprime que l’intrus peut chiffrer à condition de posséder la bonne clé, est une clause descendante<br />
conditionnelle.<br />
�����¨� � �<br />
� ��� � �����<br />
Rappelons qu’un atome est l’application d’un symbole de prédicat à un terme . Un littéral est<br />
un atome (un littéral positif ) ou la négation (un littéral négatif ) d’un atome . Une clause est une<br />
����� �����<br />
������� �����������<br />
disjonction de littéraux. Il s’agit d’une clause de Horn si <strong>et</strong> seulement si elle contient au plus un<br />
littéral positif. Nous avons constamment noté la clause de Horn jusqu’ici sous la forme<br />
� ���������<br />
�<br />
����������� �����������¡��� ����� �<br />
� � � �<br />
� Une interprétation de Tarski est un tripl<strong>et</strong> où le<br />
domaine de est un ensemble non vide ; pour chaque symbole de fonction d’arité , est une fonction<br />
:-�����<br />
�����<br />
����� . �<br />
������������� ����������������� ��� ������� � �<br />
�<br />
� � de � vers ; <strong>et</strong> pour chaque � prédicat ��� , est un sous-ensemble � de . L’interprétation d’un � terme dans<br />
un � environnement , qui envoie chaque variable vers un élément � de , est définie ����������������� � par ����� � �����<br />
,<br />
�������� ��������������� ���������������<br />
���¡<br />
dans � l’environnement ) est définie sur les formules atomiques <strong>et</strong> les littéraux ��������������¨� par ��������������� ssi �<br />
,<br />
. Pour chaque clause � , on dit que � satisfait � , en abrégé ������ , si <strong>et</strong><br />
���<br />
<strong>et</strong> ����������������¨� ssi ���������<br />
�¨�������¥����� . La relation ���������� (“� est vraie dans l’interprétation � ,<br />
� � � ���������� �<br />
������ � ������ � � �<br />
� ������<br />
seulement si pour tout environnement , il y a un littéral dans tel que . Pour tout ensemble<br />
de clauses, on pose , où est un ensemble de clauses, ssi<br />
insatisfiable ssi pour aucune interprétation de Tarski .<br />
pour toute clause de . est<br />
Une interprétation de Herbrand est un ensemble d’atomes clos (sans variables libres). Il s’agit d’un cas<br />
particulier d’une interprétation de Tarski, � où est figé <strong>et</strong> contraint à être l’ensemble des termes clos, �<br />
�<br />
<strong>et</strong><br />
envoie � chaque -upl<strong>et</strong> de termes �������<br />
�����<br />
������� clos vers le terme ��������<br />
�����<br />
������� clos . Dans ces conditions, se<br />
donner une collection �§� d’ensembles de termes clos (une interprétation de Tarski) revient exactement à se<br />
donner une interprétation de Herbrand, à savoir l’ensemble des atomes vrais � dans ; <strong>et</strong> réciproquement.<br />
Un résultat standard de théorie de la preuve est qu’un ensemble de clauses � est satisfiable si <strong>et</strong> seulement<br />
si � a un modèle de Herbrand, autrement dit une interprétation de Herbrand � telle que ������ . Il est bien<br />
connu, <strong>et</strong> facile de voir, que tout ensemble satisfiable de clauses de Horn a un plus p<strong>et</strong>it modèle de Herbrand,<br />
qui estjuste l’intersection de tous ses modèles de Herbrand. C’est en particulier vrai pour un automate d’arbres,<br />
possiblement alternant ou bidirectionnel.<br />
On peut alors définir formellement l’ensemble des termes reconnus à l’état � par l’automate � , pour chaque<br />
symbole de prédicat � , comme étant l’ensemble des termes clos � tels que �����¨� soit dans le plus p<strong>et</strong>it modèle<br />
de Herbrand de � . L’ensemble des termes reconnus à � forme le langage ��������� . On dit que l’état � est vide<br />
dans � si <strong>et</strong> seulement si ��������� est vide.<br />
Il n’est pas difficile de voir que � est vide dans � si <strong>et</strong> seulement si � augmenté de la clause ��������� est<br />
satisfiable. En eff<strong>et</strong>, si � est vide alors le plus p<strong>et</strong>it modèle de Herbrand de � ne contient aucun atome clos de<br />
la forme �����¨� , donc rend ������� � vraie. Réciproquement, si � plus ������� � est satisfiable, alors son plus p<strong>et</strong>it<br />
modèle de Herbrand ne contient certainement aucun atome de la forme �����¨� . Comme tout modèle de � plus<br />
������� � en est aussi un de � , le plus p<strong>et</strong>it modèle de Herbrand de � est inclus dans celui de � plus ��������� ,<br />
donc ne contient aucun atome clos de la forme �����¨� lui non plus. Donc � est vide dans � .<br />
Plus généralement, on peut considérer des clauses qui ne sont pas de Horn. Appelons un bloc toute clause<br />
de la forme �<br />
:<br />
�<br />
���<br />
�¥�<br />
sont soit � soit � (��� signifiant � , ��� signifiant ��� ). Il est à noter qu’un bloc a au plus une<br />
�<br />
�����<br />
�<br />
�<br />
��� � (4)<br />
�<br />
où les signes<br />
variable � libre . ������� Écrivons un bloc de variable � libre . Considérons des clauses qui sont de l’une des<br />
�<br />
143
J. Goubault-Larrecq<br />
deux formes suivantes : les clauses simples sont les blocs, <strong>et</strong> les clauses complexes sont de la forme :<br />
��<br />
���<br />
�<br />
�<br />
��������<br />
����� �<br />
�������¨���<br />
�<br />
�<br />
�¡ �<br />
�<br />
� � ��� � � (5)<br />
�<br />
�¥�<br />
������������� �������������<br />
�����<br />
���<br />
�<br />
��� ���<br />
�¨����� ��������<br />
�<br />
�����<br />
� �������<br />
où sont des blocs, <strong>et</strong> . Noter que <strong>et</strong> les variables , . . ., sont les mêmes<br />
pour chaque dans (5), <strong>et</strong> que les variables libres de la clause sont toutes libres dans .<br />
Les clauses montantes <strong>et</strong> les clauses descendantes sont toutes des clauses complexes. Les clauses simples<br />
incluent les clauses intersection <strong>et</strong> les clauses de la forme . Mais ce format perm<strong>et</strong> encore davantage<br />
de liberté, <strong>et</strong> il se trouve que ce format de clauses correspond essentiellement à un format de contraintes<br />
ensemblistes positives, ou encore à un format clausal pour la sous-classe monadique de la logique du premier<br />
ordre [2], comme observé par Bachmair <strong>et</strong> Ganzinger [4].<br />
La technique de résolution ordonnée avec splitting est une méthode de preuve correcte <strong>et</strong> complète pour<br />
la logique du premier ordre en forme clausale : on consultera [23, 56] pour une introduction au domaine. Il<br />
s’agit de techniques inventées vers la fin des années 1960. La résolution ordonnée avec splitting termine sur des<br />
clauses de la forme (4) <strong>et</strong> (5), l’ordre sur les atomes étant pris comme l’ordre naturel sur la taille des atomes :<br />
en fait c<strong>et</strong>te stratégie de recherche de preuve ne peut fabriquer qu’un nombre fini de clauses, <strong>et</strong> termine donc<br />
après les avoir toutes engendrées. Si l’ensemble de clauses restant contient la clause vide, alors l’ensemble de<br />
clauses de départ est insatisfiable, sinon il est satisfiable (il y a un modèle).<br />
On notera que les clauses obtenus par l’algorithme de la section 4.3 sont presque des clauses ascendantes <strong>et</strong><br />
des clauses descendantes. On peut en fait définir une procédure d’approximation de clauses de Horn générales<br />
en clauses d’automates bidirectionneles qui est très proche de celle de la section 4.3 comme suit. On suppose<br />
d’abord qu’on a transformé les clauses en clauses dont les symboles de prédicat prennent tous exactement<br />
un argument. Ensuite, tant qu’il y a un � terme dans le � clause qui n’est ni une variable ni de la forme<br />
�����<br />
��������<br />
�����¨�¨� , alors � est de la forme ��������<br />
�����<br />
prédicats nouveaux ��� , . . ., ��� , <strong>et</strong> � variables fraîches ��� , . . ., ��� , <strong>et</strong> remplacer la clause � par :<br />
�<br />
������� , disons �����������<br />
où � est le signe opposé de<br />
�����<br />
����� � ����������� �<br />
�<br />
���¡ ��������<br />
�����<br />
�¨�����¨������� � ��� � � �<br />
�������<br />
�<br />
�<br />
(toutes les occurrences de<br />
�¨����� en particulier. Créer �<br />
����������� (6)<br />
dénotent ici le même signe).<br />
��� (7)<br />
� Une fois ces transformations terminées, on transforme toute clause � de la forme ���������¥����� , où ��� <strong>et</strong> ���<br />
�<br />
sont deux littéraux avec des ensembles de variables libres distincts mais non disjoints, ���������¥� ��� � ������ en , où<br />
� ������ est une version renommée de ������� � , c’est-à-dire dont toutes les variables libres ont été remplacées par<br />
���<br />
de nouvelles. Ce processus termine, <strong>et</strong> fournit des disjonctions de clauses simples <strong>et</strong> complexes qui n’ont aucune<br />
variable en commun. Ceci se ramène aisément à un ensemble de clauses simples ou complexes, décidables par<br />
résolution ordonnée <strong>et</strong> splitting, par splitting. (Voir par exemple [27].)<br />
Nous avons donc rebouclé la boucle : partant d’une modélisation en clauses de Horn, que l’on peut traiter<br />
par des techniques de résolution, nous avons défini une approximation qui est une légère extension d’un<br />
automate bidirectionnel alternant d’arbres, <strong>et</strong> de nouveau les techniques fondées sur la résolution ordonnée<br />
s’appliquent ; c<strong>et</strong>te fois-ci elles terminent, <strong>et</strong> fournissent un algorithme de décision pour la satisfiabilité des<br />
clauses d’automates, donc pour la vacuité des langages définis par automates bidirectionnels alternants.<br />
4.5. Transformations de programmes <strong>et</strong> améliorations de la précision<br />
Revenons à la question posée en fin de section 4.3 : la méthode d’approximation des ensembles de clauses<br />
de Horn par des automates d’arbres est-elle suffisamment précise ? Il se trouve que non, c<strong>et</strong>te méthode de<br />
vérification n’est pas suffisamment précise dans le cadre des protocoles cryptographiques. Cependant, certaines<br />
transformations préliminaires de l’ensemble de clauses ��� améliorent grandement la précision de l’algorithme<br />
de typage de la section 4.3.<br />
144
4.5.1. Inlining<br />
Protocoles cryptographiques: la logique à la rescousse!<br />
�<br />
knows� �����<br />
�<br />
�<br />
�����<br />
Considérons les différents appels à knows dans la modélisation de la section 4.2. L’algorithme de typage<br />
descriptif de la section 4.3 va chercher à déterminer un type pour des termes de la forme ,<br />
c’est-à-dire à déterminer un sur-ensemble de tous les couples tels que �<br />
�<br />
est une liste de messages<br />
récupérés par l’intrus <strong>et</strong> est un ensemble possible de messages déductibles de �<br />
� �����<br />
�<br />
. L’ensemble de tous ces<br />
couples sera décrit en un unique état (par un unique prédicat) de l’automate. Dans de nombreux cas, ceci induit<br />
une perte d’information, <strong>et</strong> la technique de la section 4.3 va faire un amalgame entre des couples venant<br />
de l’étape 1 du protocole avec des couples venant de l’étape 2, avec des couples venant de l’étape 3 ; elle sera<br />
alors insuffisante pour montrer qu’un protocole est effectivement sûr.<br />
Une façon simple de contourner ce problème est de définir des versions spécialisées du prédicat knows<br />
pour chaque étape du protocole. En d’autres mots, si l’on considère deux clauses différentes utilisant knows,<br />
comme celles définissant Pa en section 4.2.3, on souhaite les réécrire en remplaçant le prédicat knows dans<br />
chaque par un nouveau prédicat, knows-1 dans le première, knows-2 dans la seconde, <strong>et</strong> ainsi de suite. On<br />
remplacera donc des clauses de la forme :<br />
... :- ..., knows(E, M), ...<br />
... :- ..., knows(E, M), ...<br />
par<br />
... :- ..., knows-1(E, M), ...<br />
... :- ..., knows-2(E, M), ...<br />
<strong>et</strong> l’on créera autant de clauses définissant knows-1, resp. knows-2, qu’il y avait de clauses définissant<br />
knows (voir section 4.2.2). Autrement dit, on créera les clauses :<br />
knows-1(E, M) :- knows0(M). knows-2(E, M) :- knows0(M).<br />
knows-1(E, M) :- in-list-1(E,M). knows-2(E, M) :- in-list-2(E,M).<br />
in-list-1(cons(M, _), M). in-list-2(cons(M, _), M).<br />
in-list-1(cons(_, L), M) :- in-list-2(cons(_, L), M) :in-list-1(L,<br />
M). in-list-2(L, M).<br />
knows-1(E, crypt(_, M, K)) :- knows-2(E, crypt(_, M, K)) :knows-1(E,<br />
M), knows-1(E, K). knows-2(E, M), knows-2(E, K).<br />
<strong>et</strong> ainsi de suite.<br />
Formellement, pour inliner un prédicat � (ici, knows), on liste les clauses ��� , . . ., ��� qui ont un atome<br />
��� � �<br />
�<br />
�<br />
�<br />
�<br />
�<br />
�¤����� �<br />
����������� ���<br />
� ���<br />
� :-�����<br />
�����<br />
���<br />
�����<br />
�¨�����<br />
� ���<br />
� �����<br />
�<br />
������� ��������������� � ���<br />
�¡���<br />
�<br />
�����<br />
�<br />
�<br />
����������� �<br />
�<br />
� ���������<br />
de la forme dans leur corps (à droite de :-), mais pas dans leur tête (à gauche de :-). On crée<br />
, pour chaque entre <strong>et</strong> . La seconde étape<br />
consiste à créer les clauses définissant les nouveaux prédicats . Pour ceci, soit le plus p<strong>et</strong>it ensemble de<br />
prédicats contenant <strong>et</strong> tel que si <strong>et</strong> il existe une clause de la forme ,<br />
alors . Soit aussi l’ensemble des clauses dont la tête est de la forme avec<br />
. Pour définir il suffit de, d’abord, créer de nouveaux prédicats distincts deux à deux, pour<br />
chaque , ���<br />
�<br />
�����������<br />
�<br />
� �<br />
� � �<br />
��� �����<br />
��� � ��� �¨����� ���������<br />
���<br />
, ensuite de créer pour chaque clause , la clause obtenue en remplaçant<br />
tout prédicat apparaissant dans par .<br />
C<strong>et</strong>te méthode est appelée inlining, parce qu’elle correspond exactement à la technique d’inlining de<br />
procédures en compilation, ici adaptée à Prolog. L’inlining produit un ensemble de clauses à partir d’un<br />
ensemble de clauses , tel que, pour tout prédicat non inliné , est déductible de si <strong>et</strong><br />
seulement s’il est déductible de : c’est en cela que l’inlining est correct.<br />
��� �<br />
nouveaux ��� prédicats , . . ��� ., , <strong>et</strong> on � remplace �<br />
�<br />
par � dans<br />
145
J. Goubault-Larrecq<br />
4.5.2. Partitionnement<br />
Un autre cas de perte d’information se présente notamment dans la gestion des numéros de session.<br />
Rappelons que nous avons introduit des numéros de session Ses en section 4.2.3. Nous ne nous en sommes<br />
pas servis ; typiquement, leur besoin se fait sentir lorsque les principaux tournent en boucle. Ici nous avons<br />
considéré que A effectuait les étapes 1, 2, 3, 4, 5, puis s’arrêtait. Dans la réalité il est plus raisonnable de penser<br />
que A va ensuite boucler <strong>et</strong> revenir à l’étape 1, par exemple. Il est alors raisonnable d’incrémenter le numéro de<br />
session. Ceci perm<strong>et</strong> notamment de distinguer deux nonces créés en deux étapes identiques du protocole, mais<br />
dans deux sessions différentes. Notamment, les nonces créés par A à l’étape 1 dans la session initiale seront de<br />
la forme :<br />
nonce-A-1(0(), ...)<br />
alors que ceux créés dans les sessions suivantes seront de la forme :<br />
nonce-A-1(s(_), ...)<br />
On peut raffiner la précision de l’approximation de la section 4.3 en distinguant les deux cas. Par exemple, la<br />
transition pour A passant de avant-1 à entre-1-<strong>et</strong>-2 de la section 4.2.3 sera découpée en deux clauses<br />
selon que la session est la session initiale ou pas :<br />
Pa((avant-1, 0(), A, B, _, Kas, Kab, M, Nb), E<br />
(entre-1-<strong>et</strong>-2, 0(), A, B,<br />
nonce-A-1(0(), A, B, Kas, Kab, M, Nb),<br />
Kas, Kab, M, Nb),<br />
cons ([A, B, nonce-A-1(0(), A, B, Kas, Kab, M, Nb)], E)).<br />
Pa((avant-1, s(Ses’), A, B, _, Kas, Kab, M, Nb), E<br />
(entre-1-<strong>et</strong>-2, s(Ses’), A, B,<br />
nonce-A-1(s(Ses’), A, B, Kas, Kab, M, Nb),<br />
Kas, Kab, M, Nb),<br />
cons ([A, B, nonce-A-1(s(Ses’), A, B, Kas, Kab, M, Nb)], E)).<br />
C<strong>et</strong>te transformation est générale, <strong>et</strong> nous l’appelons partitionnement, ici de la variable Ses dans la clause<br />
donnée.<br />
C<strong>et</strong>te transformation nécessite cependant pour être plus précise que les termes soient typés. Bien que nous<br />
n’ayons pas insisté sur ce point, c’est le cas dans la formalisation utilisée ici, voir le début de la section 4.1 :<br />
pour chaque � variable que nous souhaitons partitionner dans une � clause , considérons son � type (message,<br />
*D*, *algo*, <strong>et</strong>c.), <strong>et</strong> enfin la �� liste , . . �� ., des symboles de fonctions dont le type résultat � est . �����<br />
Nous<br />
� � , . . ., enfin � dans laquelle<br />
�����<br />
� �����¡�<br />
sont des variables distinctes deux à deux, <strong>et</strong> nouvelles.<br />
�<br />
fabriquons � alors � clauses, dans � laquelle est remplacée ������������ par<br />
est remplacée par ������������ ����������� . Ici les �<br />
�<br />
Le partitionnement préserve tous les plus p<strong>et</strong>its modèles de Herbrand, mais pas nécessairement les autres<br />
modèles.<br />
4.5.3. Ensembles magiques<br />
Une autre transformation classique en Prolog est celle des ensembles magiques. Elle est utile en particulier<br />
en conjonction avec la transformation par partitionnement, qui a tendance à engendrer de nombreuses clauses<br />
qui ne servent à rien dans aucune dérivation. La technique des ensembles magiques perm<strong>et</strong> de guider la<br />
recherche de preuves [5].<br />
La technique est relativement simple encore une fois. Supposons que nous ayons une clause<br />
. Créons de nouveaux symboles de prédicats (que nous représenterons en ajoutant le préfixe<br />
�����<br />
:-�����<br />
�����<br />
�<br />
146
Protocoles cryptographiques: la logique à la rescousse!<br />
magic-). La formule magic-� intuitivement sera vraie si on estime avoir besoin de prouver � . On modifie<br />
alors la clause ci-dessus en la clause<br />
:- magic-���������<br />
�����<br />
�<br />
�����<br />
qui exprime que l’on n’aura le droit d’utiliser c<strong>et</strong>te clause que si magic-� est vraie, c’est-à-dire si on a<br />
demandé à prouver � . La technique est élégante, dans la mesure où l’on peut ainsi guider la recherche de<br />
preuve de sorte qu’elle ne cherche à dériver que des formules qui ont une chance de servir à la preuve, sans<br />
avoir à se plonger dans des détails algorithmiques : le formalisme logique se charge de tout.<br />
On doit aussi rajouter des clauses exprimant les dépendances entre formules. On écrira notamment :<br />
:- magic-�<br />
magic-���<br />
� :- magic-�<br />
magic-�<br />
�����<br />
magic-��� :- magic-�<br />
Autrement dit, si on a besoin de dériver � , on a a priori à dériver �¡� , . . ., ��� . Ce sont les ensembles magiques<br />
(“magic s<strong>et</strong>s”). Le raffinement des motifs magiques (“magic templates”) introduit une interaction non triviale<br />
avec la recherche de preuve proprement dite. Au lieu des clauses ci-dessus, on écrit :<br />
:- magic-�<br />
magic-���<br />
� :- magic-�������<br />
magic-�<br />
�����<br />
:- magic-��������� ����� � �<br />
magic-���<br />
Autrement dit, si on a besoin de � dériver on doit �¡� dériver . Mais on n’a à ��� dériver que si d’une part on a<br />
besoin de � dériver , mais aussi si d’autre part on a réussi à ��� prouver .<br />
Il est finalement nécessaire d’ajouter une clause à l’ensemble de clauses transformé exprimant quel<br />
est le résultat que nous souhaitons démontrer. Dans l’exemple de la section 4.2, si l’on souhaite dériver<br />
non-secr<strong>et</strong>(), on ajoutera à l’ensemble des clauses transformées par ensembles ou motifs magiques, la<br />
clause :<br />
magic-non-secr<strong>et</strong>().<br />
Ainsi la recherche de preuve sera spécialisée à la recherche d’une attaque sur le secr<strong>et</strong> de ����� du principal A<br />
à l’étape 2, à l’exclusion de toute autre dérivation. On consultera [5] pour le cas de formules du premier ordre<br />
(avec variables). Ce n’est pas spécialement plus compliqué.<br />
Ces transformations ne préservent la dérivabilité que des ���������<br />
atomes<br />
. �¨�����<br />
magic-���������<br />
�����<br />
clause<br />
4.6. À <strong>propos</strong> du besoin de théories équationnelles<br />
�����<br />
�����<br />
������� pour lesquels on a ajouté la<br />
Il est parfois besoin de raisonner modulo une théorie équationnelle, c’est-à-dire en considérant que certaines<br />
égalités entre termes doivent être valides. Jusqu’ici, deux termes (deux messages) étaient égaux si <strong>et</strong> seulement<br />
s’ils étaient deux termes identiques, ce qui cadrait bien avec notre vision d’une cryptographie idéale. Cependant,<br />
un certain nombre de primitives cryptographiques vérifient des équations supplémentaires.<br />
Nous donnons un exemple dans le domaine des schémas d’accord de clé en groupe (“group key agreement”).<br />
Considérons le protocole d’accord de clé initial IKA.1 [52] (anciennement GDH.2). Ce protocole est utilisé<br />
pour créer une clé de groupe initial dans la suite de protocoles CLIQUES, <strong>et</strong> fonctionne comme suit.<br />
147
J. Goubault-Larrecq<br />
On suppose qu’on dispose d’une fonction de hachage cryptographique � , <strong>et</strong> une opération � , qui est<br />
associative <strong>et</strong> commutative, <strong>et</strong> a un élément neutre � . Autrement dit, on considère des messages qui sont des<br />
termes construits à l’aide des symboles de fonction � , � <strong>et</strong> � , <strong>et</strong> modulo la théorie équationnelle AC1 :<br />
����������� ��������� ���������<br />
�����������������������������������������<br />
Typiquement, ces fonctions sont réalisés par une exponentielle modulaire, comme dans le protocole de Diffie-<br />
Hellman [19]. Autrement dit, on a fixé deux constantes � entières � <strong>et</strong> , ������� <strong>et</strong> �������£��� vaut . L’opération<br />
est alors la multiplication <strong>et</strong> � est l’entier � � . Nous utilisons aussi la fonction binaire cons <strong>et</strong> la constante<br />
nil��� cons������� cons�������<br />
�����<br />
� cons��� ��� nil�<br />
�����<br />
�¨�<br />
� �����������<br />
�����<br />
������� �<br />
�<br />
pour représenter des listes, <strong>et</strong> nous abrégeons par la<br />
notation . Par souci de simplicité, nous supposons qu’il y a trois membres dans le groupe<br />
, �<br />
� , �<br />
� . Le protocole IKA.1 est défini pour un nombre arbitraire de membres. Le but est que tous les<br />
membres obtiennent une clé commune, connue d’eux seuls. De plus, aucun ne doit pouvoir influer sur le choix<br />
de la clé, typiquement imposer une clé qu’il aurait choisie aux autres membres.<br />
On suppose que quiconque possède ������� <strong>et</strong> ��� peut calculer ������������� . C’est certainement le cas dans<br />
la réalisation ci-dessus : si j’ai �����������������©��� , alors je peux le m<strong>et</strong>tre à la puissance ��� modulo � , <strong>et</strong><br />
obtenir ��� � � ��� ��� ����� ���©����� ��������� � � .<br />
Passons à la description du protocole proprement dit. En premier, IKA.1 effectue une phase montante<br />
(“upflow”) : �<br />
la paire � ��������������������� , où ��� est un nonce frais ; nous allons modéliser ici<br />
�<br />
nonce frais (une autre constante �¡�<br />
envoie à � �<br />
comme une simple constante. Ensuite ��� �<br />
�<br />
��� à partir de ������� <strong>et</strong> ��� .<br />
���������<br />
Une fois ceci fait, �<br />
� envoie � ����������������������������������������� à �<br />
� , où ��� est un autre<br />
����� ). Ceci est possible, grâce à l’hypothèse que quiconque peut fabriquer<br />
commence la phase descendante (“downflow”), <strong>et</strong> diffuse à tous le message<br />
�<br />
����������������������������������� , où ��� est un troisième nonce créé par � �<br />
. À partir de ce message, tous les<br />
�<br />
membres peuvent calculer la clé de �����¤��������������� groupe .<br />
On peut modéliser toutes les exécutions du protocole via des clauses de Horn comme en section 4.2, c<strong>et</strong>te<br />
fois-ci modulo la théorie AC1. Écrivons quelques-unes de ces clauses. La technique de typage descriptif de<br />
la section 4.4 s’adapte au cas des théories équationnelles. En fait, on peut même modéliser IKA.1 sous forme<br />
de clauses de Horn modulo AC1 qui sont directement des clauses d’automates d’arbres bidirectionnels (non<br />
alternants), voir [29]. Le problème de la vacuité des automates d’arbres bidirectionnels alternants modulo AC1<br />
est indécidable, mais en absence d’alternance, c’est-à-dire de clauses intersection, <strong>et</strong> de clauses descendantes<br />
conditionnelles, ce problème est de nouveau décidable ; en fait, même le problème de la vacuité de l’intersection<br />
d’un nombre fini de langages définis sans alternance est décidable [30], ce qui perm<strong>et</strong> de traiter le cas du<br />
protocole IKA.1 [29]. L’algorithme de décision est cependant non trivial.<br />
Le lecteur sera peut-être curieux de savoir que la propriété de secr<strong>et</strong> de la clé de groupe échoue. Autrement<br />
dit, il y a une attaque, qui consiste pour l’intrus à rejouer le premier message lors du troisième échange de<br />
messages [38]. Il est à noter qu’IKA.1 a en fait été conçu pour un modèle où l’intrus est un voyeur pur, c’està-dire<br />
que l’intrus ne peut en fait qu’espionner le trafic réseau, <strong>et</strong> non fabriquer des messages, ni envoyer<br />
des messages, ni détourner des lignes de communication. La version authentifiée d’IKA.1 semble éviter c<strong>et</strong>te<br />
attaque. Sa modélisation nécessite l’utilisation d’automates modulo AC1 non alternants mais avec des clauses<br />
descendantes conditionnelles. Le problème de la décidabilité de tels automates est à l’heure actuelle ouvert.<br />
5. Conclusion<br />
Le domaine de la modélisation <strong>et</strong> de la vérification des protocoles cryptographiques a connu une véritable<br />
explosion dans les années 1990. On dispose à l’entrée des années 2000 de toute une gamme de modèles <strong>et</strong> de<br />
méthodes. Les modèles dérivés de celui de Dolev <strong>et</strong> Yao semblent être les plus avancés en ce qui concerne<br />
l’expressivité <strong>et</strong> l’automatisation, mais ils sont encore relativement abstraits, comparés notamment au modèle<br />
plus opérationnel du spi-calcul <strong>et</strong> du pi-calcul appliqué, <strong>et</strong> surtout au modèle réaliste des machines de Turing<br />
probabilistes cher aux cryptologues. Il reste encore de nombreuses améliorations à apporter aux modèles à la<br />
148
Protocoles cryptographiques: la logique à la rescousse!<br />
Dolev-Yao (automatisation, gestion des différents modes multi-sessions, extension aux problèmes propres au<br />
commerce électronique ou à d’autres domaines, par exemple le vote anonyme, en particulier). A côté de cela,<br />
il est nécessaire aujourd’hui de formaliser les rapports entre les différents modèles, par exemple pour justifier<br />
formellement certains choix apparemment arbitraires du modèle de Dolev-Yao (par exemple, pourquoi l’intrus<br />
n’est-il pas autorisé à créer des nonces ? Ceci poserait des problèmes dans la vérification, <strong>et</strong> on peut supposer<br />
sans perte de généralité que tous les nonces de l’intrus ont été créés à l’avance — à condition de faire attention<br />
à ne pas imposer des conditions initiales trop contraignantes). Plus finement, on peut souhaiter intégrer des<br />
considérations probabilistes dans des modèles à la Dolev-Yao, dans le but d’évaluer les risques d’attaques dans<br />
le style du modèle à base de machines de Turing probabilistes. Quelques tentatives préliminaires ont déjà été<br />
effectuées [33].<br />
Références<br />
[1] M. Abadi and C. Fourn<strong>et</strong>. Mobile values, new names, and secure communication. In Proceedings of the<br />
28th ACM Symposium on Principles of Programming Languages (POPL’01), pages 104–115, 2001.<br />
[2] W. Ackermann. Solvable Cases of the Decision Problem. Studies in Logic and the Foundations of<br />
Mathematics. North-Holland, Amsterdam, 1954.<br />
[3] D. Amadio, Roberto <strong>et</strong> Lugiez. On the reachability problem in cryptographic protocols. In<br />
CONCUR’2000, pages 380–394. Springer Verlag LNCS 1877, 2000.<br />
[4] L. Bachmair, H. Ganzinger, and U. Waldmann. S<strong>et</strong> constraints are the monadic class. In Proc. 8th Annual<br />
IEEE Symposium on Logic in Computer Science (LICS’93), pages 75–83. IEEE Computer Soci<strong>et</strong>y Press,<br />
1993.<br />
[5] F. Bancilhon, D. Maier, Y. Sagiv, and J. D. Ullman. Magic s<strong>et</strong>s and other strange ways to implement logic<br />
programs (extended abstract). In Proceedings of the International Conference on Management of Data<br />
and Symposium on Principles of Database Systems. ACM Press, 1986.<br />
[6] A. Bidoit, Michel <strong>et</strong> Boisseau. Abstract interpr<strong>et</strong>ation : An algebraic approach. In Workshop on Algebraic<br />
Data Types (WADT’01). Springer Verlag LNCS, 2001.<br />
[7] B. Blanch<strong>et</strong>. Abstracting cryptographic protocols by Prolog rules (invited talk). In P. Cousot, editor,<br />
Proceedings of the 8th International Static Analysis Symposium (SAS’2001), pages 433–436, Paris,<br />
France, 2001. Springer-Verlag Lectures Notes in Computer Science 2126.<br />
[8] B. Bogaert and S. Tison. Equality and disequality constraints on direct subterms in tree automata. In<br />
Proceedings of Symp. on Theor<strong>et</strong>ical Aspects of Computer Science (STACS ’92), pages 161–172. Springer-<br />
Verlag LNCS 577, 1992.<br />
[9] D. Bolignano. Une approche à la vérification formelle des protocoles cryptographiques. Technique <strong>et</strong><br />
Science Informatique, 1995.<br />
[10] D. Bolignano. <strong>Vérification</strong> formelle de protocoles cryptographiques à l’aide de Coq. In Actes des journées<br />
GDR, 1995.<br />
[11] D. Bolignano. Formal verification of cryptographic protocols. In Proceedings of the ACM Conference on<br />
Computer and Communication Security, 1996.<br />
[12] D. Bolignano. Towards a mechanization of cryptographic protocol verification. In O. Grumberg, editor,<br />
9th International Conference on Computer Aided Verification (CAV’97), pages 131–142. Springer LNCS<br />
1254, 1997.<br />
[13] D. Bolignano. Towards the formal verification of electronic commerce protocols. In 10th IEEE Computer<br />
Security Foundations Workshop, 1997.<br />
[14] M. Burrows, M. Abadi, and R. Needham. A logic of authentication. Proceedings of the Royal Soci<strong>et</strong>y,<br />
426(1871) :233–271, 1989.<br />
149
J. Goubault-Larrecq<br />
[15] Common criteria, version 2.1, iso is 15408. http://csrc.nist.gov/cc/ccv20/ccv2list.<br />
htm.<br />
[16] V. Cortier, J. Millen, and H. Ruess. Proving secrecy is easy enough. In 14th IEEE Computer Security<br />
Foundations Workshop, 2001.<br />
[17] M. Debbabi, M. Mejri, N. Tawbi, and I. Yahmadi. Formal automatic verification of authentication<br />
cryptographic protocols. In 1st IEEE International Conference on Formal Engineering M<strong>et</strong>hods<br />
(ICFEM’97). IEEE, 1997.<br />
[18] T. Dierks and C. Allen. The TLS protocol, IETF RFC 2246. http://www.i<strong>et</strong>f.org/rfc/<br />
rfc2246.txt, Jan. 1999.<br />
[19] W. Diffie and M. Hellman. New directions in cryptography. IEEE Transactions on Information Theory,<br />
IT-22(6) :644–654, Nov. 1976.<br />
[20] D. Dolev and A. C. Yao. On the security of pubic key protocols. IEEE Transactions on Information<br />
Theory, IT-29(2) :198–208, Mar. 1983.<br />
[21] N. Durgin, P. D. Lincoln, J. C. Mitchell, and A. Scedrov. Undecidability of bounded security protocols.<br />
In Proceedings of the FLOC Workshop on Formal M<strong>et</strong>hods in Security Protocols, 1999.<br />
[22] N. El Kadhi. Automatic verification of confidentiality properties of cryptographic programs. N<strong>et</strong>working<br />
and Information Systems, 2001.<br />
[23] C. Fermüller, A. Leitsch, U. Hustadt, and T. Tamm<strong>et</strong>. Resolution Decision Procedures, chapter 25, pages<br />
1791–1849. Volume II of Robinson and Voronkov [48], 2001.<br />
[24] T. Frühwirth, E. Shapiro, M. Y. Vardi, and E. Yardeni. Logic programs as types for logic programs. In<br />
LICS’91, 1991.<br />
[25] T. Gen<strong>et</strong> and F. Klay. Rewriting for cryptographic protocol verification (extended version). Technical<br />
report, CNET-France Telecom, 1999. http://www.loria.fr/~gen<strong>et</strong>/Publications/<br />
Gen<strong>et</strong>Klay-RR99.ps.<br />
[26] J. Goubault-Larrecq. A m<strong>et</strong>hod for automatic cryptographic protocol verification (extended abstract). In<br />
Proceedings of the Workshop on Formal M<strong>et</strong>hods in Parallel Programming, Theory and Applications<br />
(FMPPTA’2000), Lecture Notes in Computer Science LNCS 1800, pages 977–984. Springer Verlag,<br />
2000. L’URL http://www.dyade.fr/fr/actions/vip/jgl/cpv.ps.gz pointe vers une<br />
version plus complète.<br />
[27] J. Goubault-Larrecq. Higher-order positive s<strong>et</strong> constraints. In CSL’02. Springer Verlag LNCS,<br />
2002. Disponible en rapport de recherche LSV-02-6, Lab. Specification and Verification,<br />
<strong>ENS</strong> de <strong>Cachan</strong>, juill<strong>et</strong> 2002, http://www.lsv.ens-cachan.fr/Publis/RAPPORTS_LSV/<br />
rr-lsv-2002-6.rr.ps.<br />
[28] J. Goubault-Larrecq. Les syntaxes <strong>et</strong> la sémantique du langage de spécification EVA. Rapport technique<br />
EVA 3, LSV/CNRS UMR 8643 <strong>et</strong> <strong>ENS</strong> <strong>Cachan</strong>, July 2002. Version 6, proj<strong>et</strong> RNTL EVA (Explication<br />
<strong>et</strong> <strong>Vérification</strong> Automatique de protocoles cryptographiques, http://www.lsv.ens-cachan.fr/<br />
~goubault/EVA.html).<br />
[29] J. Goubault-Larrecq and K. N. Verma. Alternating two-way AC-tree automata. Research report, LSV,<br />
Sept. 2002. To appear. Submitted.<br />
[30] J. Goubault-Larrecq and K. N. Verma. Alternating two-way AC-tree automata. Research Report LSV-02-<br />
1, LSV, January 2002.<br />
[31] F. Jacquemard, M. Rusinowitch, and L. Vigneron. Compiling and verifying security protocols. In<br />
Proceedings of the 7th Conference on Logic for Programming and Automated Reasoning (LPAR’2000),<br />
pages 131–160. Springer Verlag LNCS 1955, 2000.<br />
[32] J. Larmouth. Understanding OSI, chapter 8. Available on the Web, 1994. http://www.isi.<br />
salford.ac.uk//books/osi/chap8.html.<br />
150
Protocoles cryptographiques: la logique à la rescousse!<br />
[33] P. Lincoln, J. Mitchell, M. Mitchell, and A. Scedrov. A probabilistic poly-time framework for protocol<br />
analysis. In Proceedings of the 5th ACM Conference on Computer and Communications Security, 1998.<br />
[34] G. Lowe. An attack on the Needham-Schroeder public-key protocol. Information Processing L<strong>et</strong>ters,<br />
56(3) :131–133, 1995.<br />
[35] W. Mao and C. Boyd. Towards formal analysis of security protocols. In 6th IEEE Computer Security<br />
Foundations Workshop, pages 147–158, 1993.<br />
[36] W. McCune. Otter 3.0 reference manual and guide. Technical Report ANL-94-6, Argonne National<br />
Laboratory, Argonne, Illinois, USA, 1994.<br />
[37] C. A. Meadows. Applying formal m<strong>et</strong>hods to the analysis of a key management protocol. Journal of<br />
Computer Security, 1(1) :5–36, 1992.<br />
[38] J. Millen and G. Denker. CAPSL and muCAPSL. Journal of Telecommunications and Information<br />
Technology, 2002. To appear.<br />
[39] R. Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences,<br />
17(3) :348–375, 1978.<br />
[40] D. Monniaux. Abstracting cryptographic protocols with tree automata. In 6th International Static Analysis<br />
Symposium (SAS’99), pages 149–163. Springer-Verlag LNCS 1694, 1999.<br />
[41] M. Moser, O. Ibens, R. L<strong>et</strong>z, J. Steinbach, C. Goller, J. Schumann, and K. Mayr. SETHEO and E-<br />
SETHEO – The CADE-13 Systems. Journal of Automated Reasoning, 18 :237–246, 1997.<br />
[42] R. M. Needham and M. D. Schroeder. Using encryption for authentication in large n<strong>et</strong>works of computers.<br />
Communications of the ACM, 21(12) :993–999, 1978.<br />
[43] D. Otway and O. Rees. Efficient and timely mutual authentication. Operating Systems Review, 21(1) :8–<br />
10, 1987.<br />
[44] L. C. Paulson. Mechanized proofs for a recursive authentication protocol. In 10th IEEE Computer Security<br />
Foundations Workshop, pages 84–95, 1997.<br />
[45] L. C. Paulson. Proving properties of security protocols by induction. In 10th IEEE Computer Security<br />
Foundations Workshop, pages 70–83, 1997.<br />
[46] L. C. Paulson. The inductive approach to verifying cryptographic protocols. Journal of Computer<br />
Security, 6 :85–128, 1998.<br />
[47] A. Riazanov and A. Voronkov. Vampire 1.1 (system description). In Proceedings of the first International<br />
Joint Conference on Automated Reasoning (IJCAR’01). Springer-Verlag LNAI 2083, 2001.<br />
[48] J. A. Robinson and A. Voronkov, editors. Handbook of Automated Reasoning. North-Holland, 2001.<br />
[49] M. Rusinowitch and M. Turuani. Protocol insecurity with finite number of sessions is NP-compl<strong>et</strong>e. In<br />
Proceedings of the 14th IEEE Computer Security Foundations Workshop, pages 174–190, 2001.<br />
[50] B. Schneier. Applied Cryptography : Protocols, Algorithms, and Source Code in C. John Wiley and Sons,<br />
1994.<br />
[51] P. Selinger. Models for an adversary-centric protocol logic. Electronic Notes in Theor<strong>et</strong>ical Computer<br />
Science, 55(1) :73–87, July 2001. Proceedings of the 1st Workshop on Logical Aspects of Cryptographic<br />
Protocol Verification (LACPV’01), J. Goubault-Larrecq, ed.<br />
[52] M. Steiner, G. Tsudik, and M. Waidner. Key agreement in dynamic peer groups. IEEE Transactions on<br />
Parallel and Distributed Systems, 11(8) :769–780, 2000.<br />
[53] S. Stoller. A reduction for automated verification of authentication protocols. In Workshop on Formal<br />
M<strong>et</strong>hods and Security Protocols, 1999.<br />
[54] S. Stoller. A bound on attacks on payment protocols. In Proceedings of the 16th Annual IEEE Symposium<br />
on Logic in Computer Science (LICS’01), 2001.<br />
151
J. Goubault-Larrecq<br />
[55] C. Weidenbach. Towards an automatic analysis of security protocols. In H. Ganzinger, editor, Proceedings<br />
of the 16th International Conference on Automated Deduction (CADE-16), pages 378–382. Springer-<br />
Verlag LNAI 1632, 1999.<br />
[56] C. Weidenbach. Combining Superposition, Sorts and Splitting, chapter 27, pages 1965–2013. Volume II<br />
of Robinson and Voronkov [48], 2001.<br />
[57] C. Weidenbach, U. Brahm, T. Hillenbrand, E. Keen, C. Theobald, and D. Topić. SPASS version 2.0.<br />
In A. Voronkov, editor, Proceedings of the 18th International Conference on Automated Deduction.<br />
Springer-Verlag LNAI 2392, 2002.<br />
152
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
Correlation in an intrusion d<strong>et</strong>ection process<br />
Frédéric Cuppens� , Fabien Autrel� , Alexandre Miège� & Salem Benferhat�<br />
1: ONERA-CERT, 2 Av. E. Belin, 31055 Toulouse Cedex, France,<br />
2: <strong>ENS</strong>T Paris, 46 rue Barrault, 75014 Paris CEDEX, France,<br />
3: IRIT, 118 route de Narbonne, 31062 Toulouse CEDEX, France<br />
email: � cuppens,autrel,miege� @cert.fr, benferhat@irit.fr<br />
Abstract<br />
Generally, the intruder must perform several actions, organized in an intrusion scenario, to achieve his<br />
or her malicious objective. We argue that intrusion scenarios can be modelled as a planning process and we<br />
suggest modelling a malicious objective as an attempt to violate a given security requirement.<br />
Our <strong>propos</strong>al is then to extend the definition of attack correlation presented in [2] to correlate attacks<br />
with intrusion objectives and to introduce the notion of anti correlation. These notions are useful to decide<br />
if a sequence of correlated actions can lead to an intrusion objective. This approach provides the security<br />
administrator with a global view of what happens in the system. In particular, it controls unobserved actions<br />
through hypothesis generation, clusters repeated actions in a single scenario, recognizes intruders that are<br />
changing their intrusion objectives and is efficient to d<strong>et</strong>ect variations of an intrusion scenario. This approach<br />
can also be used to eliminate a category of false positives that correspond to false attacks, that is actions that<br />
are not further correlated to an intrusion objective.<br />
1. Introduction<br />
The main objective of computer security is to design and develop computer systems that conform to the<br />
specification of a security policy. A security policy is a s<strong>et</strong> of rules that specify the authorizations, prohibitions<br />
and obligations of agents (including both users and applications) that can access to the computer system. An<br />
intruder (also called hacker or cracker) might be viewed as a malicious agent that tries to violate the security<br />
policy. Thus, an intrusion is informally defined as a deliberate attempt to violate the security policy. This<br />
intrusion can be an attempt:<br />
To have an illegal access to some piece of information. In this case, the intrusion violates a confidentiality<br />
�<br />
constraint expressed in the security policy. For instance, sniffing or cracking a password violates a<br />
confidentiality constraint saying that the owner of a password must be the only user that knows this<br />
password.<br />
To perform some illegal creation, modification or del<strong>et</strong>ion of some piece of information. In this case, the<br />
�<br />
intrusion violates an integrity constraint expressed in the security policy. For instance, an IP spoofing<br />
consists in forging IP pack<strong>et</strong>s with illegal address. This is an intrusion that violates an integrity constraint<br />
saying that the address of an IP pack<strong>et</strong> must represent the sender of this pack<strong>et</strong>.<br />
To prevent other users to have legal access to some services or resources. In this case, the intrusion<br />
�<br />
violates an availability constraint expressed in the security policy. For instance, flooding a system with<br />
messages so that other users can no longer have an access to this system provides an example of an<br />
intrusion against availability.<br />
153
Frédéric Cuppens, Fabien Autrel, Alexandre Miège & Salem Benferhat<br />
Notice that som<strong>et</strong>imes the intruder might perform his intrusion by using a single action. For instance,<br />
performing a deny of service using the ping of death attack simply requires sending a too long IP pack<strong>et</strong>.<br />
However, more complex intrusions generally require several steps to be performed. For instance, l<strong>et</strong> us consider<br />
the Mitnick attack. There are two steps in this attack. In the first step, the intruder floods a given host � . Then<br />
the intruder sends spoofed SYN messages corresponding to � address to establish a TCP connection with a<br />
given server � . When � sends a SYN-ACK message, � would normally send a RESET message to close the<br />
connection. But this is not possible since � is flooded. This enables the intruder to send an ACK message<br />
to illegally open a connection with � . Notice also that opening a TCP connection with � is probably not the<br />
intruder’s final objective. It is likely that the intruder will then attempt to g<strong>et</strong> an access on � for instance<br />
by performing a rlogin. This means that the Mitnick attack will actually represent preliminary steps of a more<br />
global intrusion. In the following, we shall call intrusion scenario the compl<strong>et</strong>e sequence of actions that enables<br />
the intruder to achieve his intrusion objective.<br />
Another important point to be mentioned is that the intruder will generally first need to gain knowledge<br />
about the targ<strong>et</strong> system to be attacked. For instance, l<strong>et</strong> us consider an intruder whose objective is to perform a<br />
deny of service (DOS) over the Domain Name Server (DNS) of a given n<strong>et</strong>work. In this case, a “brute force”<br />
intrusion would be to launch a Winnuke attack over all the machines of this n<strong>et</strong>work, expecting that the DNS<br />
server will be denied at the same time as other machines. However, this is not a very efficient nor clever way to<br />
proceed. It is more likely that a careful intruder will first use the nslookup command to locate the DNS server<br />
and then send a ping to check wh<strong>et</strong>her this server is active. And if the intruder chooses Winnuke to perform<br />
the DOS attack, since Winnuke only succeeds on Windows machines, this careful intruder will probably check<br />
if the DNS server actually supports Windows. For this purpose, the intruder may scan port 139 (N<strong>et</strong>Bios)<br />
because N<strong>et</strong>Bios provides good evidence that Windows is active. We shall call knowledge gathering steps the<br />
s<strong>et</strong> of commands that enables the intruder to gain knowledge about the targ<strong>et</strong> system. In our previous example,<br />
the knowledge gathering steps correspond to nslookup, ping and scan of port 139. In the following, we shall<br />
consider that the knowledge gathering steps are part of the intrusion scenario.<br />
In this context, current intrusion d<strong>et</strong>ection technology only d<strong>et</strong>ects elementary attacks that correspond to the<br />
steps of a given intrusion scenario. They neither provide a global view of the intrusion scenarios in progress nor<br />
of the intrusion objectives the intruders attempt to achieve. Therefore, our goal in this paper is twofold. First, we<br />
suggest an approach to recognize various steps of an intrusion scenario. We shall call attack correlation this first<br />
functionality. It is actually an extension of the approach suggested in [2]. Second, when the attack correlation<br />
function succeeds in correlating several actions, we want to decide wh<strong>et</strong>her the current observations actually<br />
correspond to malicious activities or not. We call malicious intention recognition this second functionality.<br />
Combining these two functionalities would enable the security administrator to have a global understanding of<br />
what happens in the system in order to prepare an adequate reaction. Notice also that som<strong>et</strong>imes, this reaction<br />
might be launched before the intrusion scenario is compl<strong>et</strong>ed, that is before the intrusion objective is actually<br />
achieved.<br />
The remainder of this paper is organized as follow. Section 2 introduces preliminary definitions to fix<br />
the vocabulary. Section 3 presents our approach to modelling the intrusion process. This model includes a<br />
representation of both attacks and intrusion objectives. Our approach is actually derived from planning process<br />
models in Artificial Intelligence. These models are used to represent the activity of an agent that attempts<br />
to find a sequence of actions that achieve a given objective. We argue that the activity of an intruder who is<br />
performing an intrusion scenario is quite similar to a planning process. Section 4 then presents our approach for<br />
modelling the intrusion d<strong>et</strong>ection process. From a formal point of view, this approach uses the same materials<br />
as the ones presented in section 3, namely attack and intrusion objective modelling. Based on these materials<br />
and following [2], we define the notion of attack and alert correlation and also correlation b<strong>et</strong>ween an attack<br />
and an intrusion objective. We then introduce the notion of anti correlation that is useful to d<strong>et</strong>ect that an action<br />
disables a given intrusion scenario in progress. Section 5 further refines our approach by introducing abduction<br />
in the correlation process. Abduction is used to generate hypotheses. This is useful in two different situations:<br />
1. Abduction of unobserved attacks. This is used to compl<strong>et</strong>e d<strong>et</strong>ection of an intrusion scenario when some<br />
steps in this scenario are not d<strong>et</strong>ected (false negatives).<br />
154
Recognizing malicious intention in an intrusion d<strong>et</strong>ection process<br />
2. Abduction of intrusion objectives. This is useful to anticipate over the intruder intentions when several<br />
actions that match an intrusion scenario have been correlated.<br />
Section 6 presents an experimentation of our approach on several examples of intrusion scenarios. Section<br />
7 is a discussion of our approach, compared to other approaches suggested in the literature, in particular<br />
approaches based on expert system [7], explicit plan recognition (see for instance [6]) and chronicle recognition<br />
[9]. Finally section 9 concludes the paper.<br />
2. Preliminary definitions<br />
In order to avoid any confusion or misunderstanding, and because the intrusion d<strong>et</strong>ection vocabulary is not<br />
clearly established, we give in this section a brief overview of the terms we shall use in this paper.<br />
Intrusion objective (intrusion d<strong>et</strong>ection point of view) An intrusion objective is the final purpose of an<br />
intruder, which justifies all its actions. So, from its point of view, the intrusion objective is obvious. By<br />
contrast, from the intrusion d<strong>et</strong>ection point of view, it is more difficult to d<strong>et</strong>ermine the possible intrusion<br />
objectives and to differentiate them from non malicious activities.<br />
As an intruder aims at committing a forbidden action, we suggest deriving the possible intrusion objectives<br />
from the security policy: any security policy violation is a potential intrusion objective.<br />
We give three examples corresponding to integrity, confidentiality, and availability violation:<br />
� Objective 1: gaining a non authorized root access right<br />
� Objective 2: having a non authorised read access to a sensitive file<br />
� Objective 3: performing a denial of service attack on the DNS<br />
Malicious action A malicious action enables the intruder to directly achieve an intrusion objective. For<br />
instance, thanks to the Winnuke attack, an intruder can do a denial of service on a Windows server.<br />
Intrusion scenario As an intrusion objective will often needs several actions to be reached, the intruder needs<br />
to draw up an intrusion scenario. It is an organised s<strong>et</strong> of actions, which have to be executed following a certain<br />
order.<br />
L<strong>et</strong> us present three intrusion scenarios corresponding to the intrusion objectives described just before.<br />
1. Illegal NFS mount: the intruder, say badguy, wants to obtain a root access on a targ<strong>et</strong>. badguy can<br />
perform the following actions: 1<br />
rpcinfo to know if portmapper is running on the targ<strong>et</strong>.<br />
�<br />
With the showmount command, badguy sees the targ<strong>et</strong> exportable partitions.<br />
�<br />
mount enables badguy to mount one of this partition, say the root partition.<br />
�<br />
By modifying the .rhost file of this partition, badguy g<strong>et</strong>s a root access on the targ<strong>et</strong> system.<br />
�<br />
� rlogin is the final step to access the targ<strong>et</strong> system with root privileges.<br />
2. Illegal file access: we shall consider the following intrusion scenario example where an unauthorised<br />
user bad guy tries to read secr<strong>et</strong>-file: 2<br />
1 This scenario actually exploits a wrongly configured security policy: the intruder should not be able to mount the root partition.<br />
2 This is an old intrusion scenario that does no longer work on current UNIX versions but it provides a good example to illustrate various<br />
concepts of our approach.<br />
155
Frédéric Cuppens, Fabien Autrel, Alexandre Miège & Salem Benferhat<br />
bad guy creates a file (touch file),<br />
�<br />
bad guy blocks the printer, by opening the paper trays.<br />
�<br />
lpr -s enables bad guy to print file. With ”s” option, the file is not spooled, only its path is saved.<br />
�<br />
bad guy del<strong>et</strong>es file<br />
�<br />
bad guy creates a symbolic link from file to secr<strong>et</strong>-file: ln -s file secr<strong>et</strong>-file.<br />
�<br />
bad guy unblocks the printer and secr<strong>et</strong>-file will be printed.<br />
�<br />
3. DoS on the DNS: this intrusion scenario leads to a DoS attack on the DNS server. A possible scenario<br />
suggested in the introduction is: nslookup, ping, scan port 139 and winnuke.<br />
Action correlation (informal definition) ���¨��������� is correlated with ���¨��������� if ������������� may enable the<br />
intruder to then perform ������������� .<br />
Suspicious action A suspicious action is defined as an action that can be correlated to a malicious action.<br />
According to this definition, a suspicious action may be an inoffensive action, or may also be a way to<br />
execute a malicious action on a following step. For example, scanning port 139 (N<strong>et</strong>Bios) is not a dangerous<br />
action. But, if port 139 is open, the intruder knows that Windows is running and can perform the Winnuke<br />
attack.<br />
Attack An attack is a malicious action or a suspicious action.<br />
This is quite a weak definition of “attack” since it also includes suspicious actions. However, we guess it is<br />
close to the intrusion d<strong>et</strong>ection terminology since many alerts actually correspond to only suspicious actions.<br />
This leads to the following definition of alerts:<br />
Simple alert A simple alert is a message sent by an IDS. It results from the d<strong>et</strong>ection of a suspicious or a<br />
malicious action.<br />
Fusion process and fusion alert The simple alerts generated by different IDS d<strong>et</strong>ecting the same attack are<br />
merged into a single cluster. This is called fusion process. It d<strong>et</strong>ermines first which are the merging criteria for<br />
each type of attack, and then, during the intrusion d<strong>et</strong>ection process, uses those criteria to constitute clusters. At<br />
last, it generates a fusion alert to inform all the security devices of the creation and the content of a new cluster.<br />
It is not the purpose of this paper to further present the fusion process but see [1, 10] for different <strong>propos</strong>als for<br />
this process.<br />
Correlation process and scenario alert The correlation process receives the fusion alerts and tries to<br />
correlate them one by one using correlation rules. When a compl<strong>et</strong>e or a partial intrusion scenario is d<strong>et</strong>ected, a<br />
scenario alert is generated. [2] suggests an approach for the correlation process and correlation rules definition.<br />
The purpose of this paper is to extend this correlation process.<br />
False positive False positive and false negative are well documented notions in intrusion d<strong>et</strong>ection literature.<br />
However, regarding false positive we guess it is necessary to distinguish b<strong>et</strong>ween false d<strong>et</strong>ection and false<br />
attack.<br />
1. False d<strong>et</strong>ection corresponds to the occurrence of an alert whereas the corresponding attack did not occur.<br />
For instance, this can be due to an IDS weak signature.<br />
156
Recognizing malicious intention in an intrusion d<strong>et</strong>ection process<br />
2. False attack results from d<strong>et</strong>ecting a suspicious action that is not further correlated with a malicious<br />
action.<br />
We argue that the fusion process is useful to recognize false d<strong>et</strong>ection (see [1]). However, it is not sufficient<br />
to d<strong>et</strong>ect false attacks. For this purpose, the correlation process presented in this paper will be useful.<br />
3. Modelling the intrusion process<br />
The objective of this paper is to d<strong>et</strong>ect intrusion scenario and recognize malicious intention. For this purpose,<br />
it is first useful to analyse and model how intruders proceed to perform their intrusions.<br />
In our approach the intrusion process is modelled as a planning activity. We assume that the intruder wants<br />
to achieve intrusion objectives and, for this purpose, the intruder can use a s<strong>et</strong> of attacks (remember that attacks<br />
include both suspicious or malicious actions). In this context, the intruder’s problem is to find a sequence of<br />
attacks that transform a given initial state into a final state. The initial state corresponds to the system state when<br />
the intruder starts his intrusion. And the final state has the property that the intrusion objective is achieved in<br />
this state.<br />
We check this approach on several intrusion scenarios, including the three scenarios presented in section<br />
2 but also other scenarios such as the Mitnick attack. For every analysed scenario, it was possible to interpr<strong>et</strong><br />
it as a planning process. Due to space limitation, we shall only illustrate this claim on scenario 3 “illegal file<br />
access”. But before, we need to present our approach to model attacks and intrusion objectives.<br />
3.1. Attack modelling<br />
In the planning context, actions are generally represented by their pre and post conditions. Pre conditions<br />
of an action correspond to conditions the system’s state must satisfy to perform the action. Post conditions<br />
correspond to effects of executing the action on the system’s state.<br />
In our model, an attack is similarly represented using three fields: its name, pre condition and post condition.<br />
Attack name is a functional expression that represents the name of the attack and its different param<strong>et</strong>ers. Attack<br />
pre-condition specifies the logical conditions to be satisfied for the attack to succeed and attack post-condition<br />
is a logical condition that specifies the effect of the attack when this attack succeeds.<br />
The pre-condition and post-condition of an attack correspond to conditions over the system’s state. For<br />
this purpose, we use a language, denoted ��� , which is based on the logic of predicates. Predicates are used to<br />
describe properties of the system state relevant to the description of an attack. In this language, we assume that<br />
terms starting by an upper case l<strong>et</strong>ter correspond to variables and other terms are constants.<br />
The predicates are combined using the logical connectives “,” (conjunction denoted by a comma) and “not”<br />
(negation). Currently, we do not allow using disjunction in the pre and post conditions of an attack. Another<br />
restriction is that negation only applies to predicates, not to conjunctive expressions. The reason of these<br />
restrictions will be explained in section 4.<br />
In order to model knowledge gathering actions, we extend language ��� so that it also includes a m<strong>et</strong>apredicate<br />
(actually a logical modality) knows. If � is an agent and � is a formula of ��� , then �£�����������������<br />
means that � knows that � is true. We assume that modality �£������� satisfies the following axiom for each<br />
agent � and formula � : ����������������������� , that is if � knows that � then � is true.<br />
Figure 1 shows how various steps of scenario illegal file access are represented in this model. In<br />
this example, we use the following predicates: �������£���������§� (������� is a file), ���������������¥���������������§� (���¥�����<br />
is the owner of ������� ), �����¡������������������������� (������������� is a printer), ���������©��������������������� (�����¡������� is blocked),<br />
�£� ���������������������¥���������������������������§� (���¥����� has �������¥� access on ������� ), �������¥���������¡�������������§� (there is a logical<br />
link from ������� to ������� ), � � � � ���������������¨��������������� (������� is queued in ������������� ), ��� � � � ���������������¥���������������§�<br />
157
Frédéric Cuppens, Fabien Autrel, Alexandre Miège & Salem Benferhat<br />
Action ��� � ���������¥���������������§�<br />
Pre: ��� � �<br />
Post: �����������������§���¨���������������¥���������������§�<br />
����� -�������¥�������������������������������§�<br />
Action<br />
���������������������������������¨�������£���������§���<br />
Pre:<br />
���������������������¥����������� � �����������§�<br />
�£�<br />
� � � � �������������������������������<br />
Post:<br />
��� -�������¥�������¨���¡�������������§�<br />
Action<br />
Pre: �¡�����������������¥���<br />
not<br />
�������¥�����������������������§�<br />
Post:<br />
��������� -���������§�§���������¡�������������������<br />
Action<br />
� � � � ���������������������¡�����������<br />
Pre:<br />
�������©�����������������������§���<br />
�����������¥�����������������������<br />
not<br />
���������������������������������������§���<br />
Post:<br />
��� � � � ���������¡�����¨�����������������<br />
not<br />
���������������¥�������¨���������������<br />
Action<br />
���������������������¡�����������<br />
Pre:<br />
� � � �����§�§�������¥�����������������������<br />
�����������<br />
���������©���������������������<br />
Post:<br />
���������©�£�����¥���������������§�<br />
Action<br />
���������������¥���������������§�<br />
Pre:<br />
Post: �¡�����������������§���<br />
not<br />
Action � �����������������¥�������¨���������������<br />
���������������������¡���������������������©�����������������������<br />
Pre:<br />
� � � �����§�§�������¥�����������������������<br />
�����������<br />
Post: �����������¥�����������¡�����������<br />
not<br />
�¥��� -�������������¥�����������������<br />
Action<br />
���������������������������������������§���<br />
Pre:<br />
� � � �����§�§�������¥�����������������������<br />
�����������<br />
��� � � � �����§�§�������¥���������������§�<br />
Post:<br />
Figure 1: Modelling the illegal file access scenario<br />
has a read access on ������� ) and ���¥������� � � � �����§�§�������¥����������������������� (���¥����� has a physical access to<br />
(���¥�����<br />
). �����¡�������<br />
To model the illegal file access scenario, we actually specify 8 actions. The 6 first actions<br />
� ���������¥���������������§� , ���������������¥����������������������� , � ��� -�������¥�������������������������������§� , ���������©�£�����¥���������������§� , ��� -<br />
���<br />
and �������¥�������¨�����������������§� � correspond to the various actions performed by the<br />
�����������������¥�������������¡���������<br />
intruder in the illegal file access scenario as presented in section 2.<br />
Our model includes two additional actions ��������� -����������������������������������������� and �¥��� -�������£�����¥���������������§� .<br />
Action ��������� -���������§�§���������¡������������������� models what happens on ������������� when ������� is queued: a file is<br />
printed if ������������� is not blocked. This printed file will be ������� if there is a logical link b<strong>et</strong>ween ������� and<br />
������� . Action �¥��� -�������������¥���������������§� corresponds to the physical action performed by ���¥����� to g<strong>et</strong> ������� after<br />
it is printed. This last action actually enables ���¥����� to obtain a read access to ������� .<br />
We argue that these two last actions are necessary to fully represent this scenario. In particular, the intruder<br />
has not achieved his intrusion till he has not executed the action �¥��� ������� . Notice also that the attack will not<br />
succeed if ���¥����� has not a physical access to the printer on which the sensitive file is printed.<br />
3.2. Modelling intrusion objective<br />
In our approach intrusion objectives actually correspond to violation of a given security policy. For instance,<br />
the security policy may specify (1) that an agent should not gain a root access to a system whereas he is not<br />
authorized to do so, or (2) an agent should not obtain a read access to a file whereas he is not authorized to do<br />
so, or (3) a DNS system should remain available in any circumstance.<br />
Therefore, an intrusion objective is modelled by a system state condition that corresponds to a violation of<br />
the security policy. Figure 2 provides three examples of intrusion objectives that respectively correspond to<br />
violation of the three requirements specified in the previous security policy example. For instance, intrusion<br />
objective ����� ��� ����������������� is achieved if ������� is a DNS server and there is a DOS attack on this server.<br />
158
3.3. Domain rules<br />
Recognizing malicious intention in an intrusion d<strong>et</strong>ection process<br />
Intrusion ��������� � � ������� � �����§�§�������������<br />
Objective<br />
State ������� � �����§�§�������¥�������¨�����������<br />
Condition:<br />
� �£� ���������������������¥�����������������¨�����������<br />
not<br />
Intrusion ��������� � � ������� � �����§�§�����������§�<br />
Objective<br />
State ��� � � � �����§�§�������¥���������������§���<br />
Condition:<br />
� �£� ���������������������¥����������� � �����������§���<br />
not<br />
Intrusion ����� ��� �����������������<br />
Objective<br />
State ����� �������¥�������������������©���������������<br />
Condition:<br />
Figure 2: Examples of intrusion objectives<br />
Domain ��������� �������¥�����������§�<br />
rule<br />
���������������¥���������������§�<br />
Pre:<br />
��� ���������������������¥����������� � �����������§��� ��� ���������������������¥���������������������������§�<br />
Post:<br />
Domain rule ���������¥� �������¥�������������<br />
Pre: not �������£���������§�<br />
Post: not �����������������¥���������������§�����<br />
not � ��� ���������������������¥����������� � �����������§�����<br />
not � ��� ���������������������¥���������������������������§���<br />
Figure 3: Examples of domain rules<br />
In our model, we also include the possibility to specify domain rules. Domain rules are used to represent<br />
general properties of system’s state through possible relations b<strong>et</strong>ween predicates. These domain rules are also<br />
represented using a pre and post condition but there is a major difference with the pre and post condition of<br />
actions. Indeed, an action corresponds to a transition from an initial state to a final state: the pre condition of<br />
an action is true in the initial state and the post condition is true in the final state. By contrast, the pre and post<br />
conditions of an domain rule are evaluated on the same system state: if the pre condition of an domain rule is<br />
true in a given state, then the post condition is also true in the same state.<br />
Figure 3 provides two examples of domain rule. Rule ��������� �������������������§� says that the ���¥����� owner of<br />
a given ������� is automatically authorized to have read and write access to this file. Rule ���������¥� �������������������§�<br />
says that if ������� does no longer exist, then there is no longer an owner for this file and read and write access to<br />
������� are also removed to every ���¥����� .<br />
3.4. Planning intrusion scenario<br />
Using the three previous sections, we can now show how the intrusion scenario illegal file access is modelled<br />
as a planning process. For this purpose, l<strong>et</strong> us consider an intruder, say � � � � � � , and a file containing<br />
sensitive data, say �����¨����� ������� . L<strong>et</strong> us assume that � � � � � � wants to achieve the intrusion objective<br />
��������� � � ������� � �����§�§���¡���§�¨����� �������§� . This means that � � � � � � wants to achieve a final system state such that<br />
the following condition is satisfied:<br />
��� � � � �����§�§����� � � � � ���¨�����¨����� �������§��� not � �£� ������������������� � � � � ������� � ���������¨����� �������§���<br />
�<br />
L<strong>et</strong> us also assume � � � � � � that starts in the following initial state:<br />
159
Frédéric Cuppens, Fabien Autrel, Alexandre Miège & Salem Benferhat<br />
Step ��� � ������� � � � � ����� � � ���������<br />
1:<br />
Step ������������� � � � � �����������<br />
2:<br />
Step ����� -����� � � � � ������������� � � �������§�<br />
3:<br />
Step ���������¥����� � � � � ����� � � �������§�<br />
4:<br />
Step ��� -����� � � � � ����� � � ���������¨�����¨����� �������§�<br />
5:<br />
Step � ��������������� � � � � �����������<br />
6:<br />
Step ��������� -���������§�§������������� � � �������§�<br />
7:<br />
Step �¥��� -����������� � � � � ���������¨����� �������§�<br />
8:<br />
Figure 4: Planning the illegal file access scenario<br />
���������¡�����¨����� �������§��� not ����� � � � �����§�§����� � � � � ���¨����������� �������§�����<br />
�<br />
� � � �����§�§����� � � � � �����������<br />
�����������������������������¥�������<br />
That is, in the initial state, ����������� ������� exists but � � � � � � has not a read access to this file and there is a<br />
printer ����� and � � � � � � has a physical access to this printer.<br />
Now, the planning problem consists in finding a sequence of actions that transforms the initial state into<br />
the final state. Figure 4 presents a possible solution to this problem. It is easy to check that objective<br />
��������� � � ������� � �����§�§���¡���§�¨����� �������§� is achieved in the state resulting from these 8 steps. Notice that there is<br />
another solution that corresponds to starting by blocking the printer and then creating � � � ������� using the<br />
��� � ��� command, the other steps being identical to the other solution.<br />
According to our definitions presented in section 2, only �¥��� -����������� � � � � ���¨�����¨����� �������§� corresponding to<br />
step 8 is a malicious action since it enables the intruder to achieve the intrusion objective. Steps 1 to 7 are only<br />
suspicious actions in the sense that they enable the intruder to then perform step 8.<br />
This might seem surprising since steps 1 to 6 are generally presented as an attack scenario. However, notice<br />
that independently each of this step might well correspond to a non malicious action. It is really the combination<br />
of these 6 steps that enables the intruder to achieve his objective. However, after step 6, the intruder did not<br />
achieve his objective y<strong>et</strong>. This is why, according to our definition, steps 1 to 6 are only suspicious actions and<br />
step 8 is the malicious action. But, of course, if the 6 first steps are observed, we can conclude on the malicious<br />
intention of the intruder and it is relevant to react. Actually, it is especially time to react since the intruder<br />
perhaps did not g<strong>et</strong> the paper on the printer y<strong>et</strong> whereas we are quite sure of his malicious intention.<br />
4. Attack and alert correlation<br />
Our approach for intrusion scenario d<strong>et</strong>ection uses the same materials as the ones introduced in section 3,<br />
namely attack specification through pre and post conditions, intrusion objective corresponding to security<br />
policy violation and domain rules. Based on these materials, we shall extend the definition of attack correlation<br />
suggested in [2] by defining the notions of objective correlation and anti attack and objective correlations.<br />
4.1. Correlation definitions<br />
L<strong>et</strong> � and � be two logical expressions having the following form: 3<br />
� �����������§�����¨�������§���§�����������������§���<br />
� ������������� � �¨��������� � ���������¨�����������<br />
3 Notice that we assume that these two expressions do not include disjunction. This is a restriction which is used to simplify definition<br />
of correlation below. Generalising correlation definitions to take into account disjunctions represents further work that remains to be done.<br />
160
where each ��������� must have one of the following forms:<br />
� �������������������<br />
� ����������� not ���������©�<br />
� �������������£���������������������������¥�<br />
� �������������£������������������� not ���������¥���<br />
where ������� is a predicate.<br />
Recognizing malicious intention in an intrusion d<strong>et</strong>ection process<br />
Definition 1: Headway correlation We say that logical expressions � and � are headway correlated if the<br />
following condition is satisfied:<br />
there exist � in ��������� and � in ��������� such that ����������� and ���������§� are unifiable through a most general<br />
�<br />
unifier � (mgu) .<br />
For instance, the post condition of action ��� � ���������¥���������������§� is headway correlated with the pre condition<br />
of action ���������©�������¥���������������§� . This is because these two logical expressions have in common predicate<br />
���������������¥���������������§� . After renaming the variables of ���������������¥���������������§� that respectively appear in the<br />
post condition of action ��� � ��� and the pre condition of action ���������©� into ���������������¥��������������������� and<br />
���������������¥�����������������§��� , we can conclude that these expressions are unifiable through mgu � such that<br />
���¥�����¨�������¥������� and �������������������§� .<br />
Definition 2: Knowledge gathering correlation We say that logical expressions � and � are knowledge<br />
gathering correlated if the following condition is satisfied:<br />
there exist � in ��������� and � in ��������� such that ����������� and �£�������������������������������§� are unifiable through a<br />
�<br />
� mgu .<br />
For instance, in the illegal root access scenario, knowledge gathering correlation applies to correlate<br />
the post condition of action �§��������� � ���������¥��������� � �§�¥����� with the pre condition of action<br />
� ���������¥��������� � �§�¥������� � ��������������� . Indeed, a possible post condition of action �§��������� � ��� is �£�������������¥�������<br />
���<br />
� ������� � � ����������������� � �§�¥������� � ����������������� , that is the ���¥����� performing �§��������� � ��� knows what partitions<br />
���<br />
are mounted � � �§�¥��� on . On the other ��� � ������� � � ����������������� � �§�¥������� � ��������������� hand, appears in the pre<br />
condition of ��� � ��� action and so definition 2 applies.<br />
Definition 3: Correlation We say that logical expressions � and � are correlated if � and � are headway<br />
correlated or knowledge gathering correlated.<br />
Definition 4: Direct attack correlation We say that attacks � and � are directly correlated if expressions<br />
������������� and ����������� are correlated.<br />
Intuitively, correlation b<strong>et</strong>ween attacks � and � means that � enables the intruder to then perform attack � .<br />
Figure 5 shows attacks that are directly correlated in the illegal file access scenario. In this figure, all variables<br />
were renamed to obtain distinct variables in the pre and post conditions of correlated attacks.<br />
161
Frédéric Cuppens, Fabien Autrel, Alexandre Miège & Salem Benferhat<br />
Attack � Attack � Unifier<br />
� ���������¥�����¨��������������� ���������¥�������¥��������������������� ���¥�����¨�������¥�������������������������������<br />
���<br />
��� -�������¥�����������������������������§��� ���������������������<br />
���������¥�������¥�����¨���������������<br />
� �����������������¥�����������������������§��� ���¥�����¨�������¥���������������¡�������������������������§�<br />
���������������¥�����¨���¨�����������������<br />
-�������¥�����¨���¨����������������������������� ��������� -�����������������������������§�§������������� �����������������������������¡�������������������������§�<br />
�����<br />
-�������¥�����¨�����������¥��������������� ��������� -�����������������������������§�§������������� �������¥���������������������¡�������������������������§�<br />
���<br />
�����������������¥�����¨���¨����������������� ��������� -�����������������������������§�§������������� �����������������������¡�������§�<br />
�<br />
��������� -���������§�§���������������������¨�������©��� �¥��� -�������������¥��������������������� �������������������§���������������������������¡�������§�<br />
Figure 5: Direct attack correlation in the illegal file access scenario<br />
Definition 5: Indirect attack correlation We say that attacks � and � are indirectly correlated through<br />
domain rules ����������������� if the following conditions are satisfied:<br />
� ������������� is correlated with �����£������� through a mgu ��� ,<br />
� For each � in ������������� , �������������§� is correlated with ����������������� through a mgu ��� ,<br />
� ��������������� is correlated with attack ����������� through a mgu ��� .<br />
For instance, it is easy to verify that attack ��� � ���������¥���������������§� is indirectly correlated with attack ����� -<br />
�������¥�������¨�����������������������§� through the domain rule ��������� �������������������§� .<br />
Definition 6: Direct objective correlation We say that attack � is directly correlated to intrusion objective<br />
� if expressions ������������� and ��� � ��� ����������������������� are correlated.<br />
Definition 7: Indirect objective correlation Same definition as definition 5 by replacing ��� � ��� �����������������������<br />
for ����������� .<br />
Intuitively, correlation b<strong>et</strong>ween attack � and intrusion objective � means that attack � enables the intruder<br />
to achieve objective � . For instance, attack �¥��� -�������������¥����������������� is directly correlated with intrusion<br />
objective ��������� � � ������� � �����§�§�����������§� .<br />
4.2. Anti correlation<br />
In this section, we use the same notation as in section 4.1 and define anti correlation as follows:<br />
Definition 8: Anti correlation We say that logical expressions � and � are anti correlated if one of the<br />
following conditions is satisfied:<br />
� there exists � in ��������� and � in ��������� such that ��������� � and not ����������� � � are unifiable through a mgu � .<br />
� there exists � in ��������� and � in ��������� such that not ��������������� and ����������� are unifiable through a mgu � .<br />
For instance, the post condition of ��� � ���������¥��������������������� is anti correlated with the pre condition of ��� -<br />
�������¥��������������������������������� through the unifier ��������������������� .<br />
162
Recognizing malicious intention in an intrusion d<strong>et</strong>ection process<br />
Definition 9: Direct anti attack correlation We say that attacks � and � are directly anti correlated if<br />
expressions ������������� and �����£����� are anti correlated.<br />
In the illegal access file scenario, we have the following direct anti attack correlations:<br />
� ��� � ���������¥�����¨��������������� and ��� -�������¥���������¨���¡������������������� through the unifier ���������������������<br />
���������������¥�����¨��������������������� and ��������� ���������§�§�������������������§�¨����������� through the unifier �����������������<br />
�<br />
�����¡�������§�<br />
Definition 10: Indirect anti attack correlation We say that attacks � and � are indirectly anti correlated<br />
through domain rules ����������������� if the following conditions are satisfied:<br />
� ������������� is correlated with �����£������� through a mgu ��� ,<br />
� For each � in ������������� , �������������§� is correlated with ����������������� through a mgu ��� ,<br />
� ��������������� is anti correlated with attack ����������� through a mgu ��� .<br />
For instance, attacks ���������©�£�����¥���������������§� and ����� -�������¥�������������¡�����������������§� are indirectly anti correlated<br />
through domain rule ���������¥� �������������������§� .<br />
The notion of anti attack correlation is very useful. It enables the correlation process to conclude that some<br />
sequences of actions will not succeed and do not correspond to intrusion scenarios. For instance, the sequence:<br />
� ��� � ������� � � � � ����� � � �������§�������������¥����� � � � � ����� � � �������§���¨� ��� -����� � � � � ������������� � � �������§�<br />
can be discarded because of the anti correlation b<strong>et</strong>ween ���������¥� and ����� -� . One can also conclude that illegal<br />
access file scenario will not succeed until the printer is blocked because of the anti correlation b<strong>et</strong>ween ���������<br />
and ��������� -���������§�§� .<br />
Similarly, one can define the notions of direct and indirect anti objective correlation of an attack � with<br />
an intrusion objective � by simply replacing ��� � ��� ����������������������� for �����£����� in definition 9 and 10. This is<br />
useful to analyse actions that would prevent the intruder to achieve a given intrusion objective. We plan to use<br />
this approach to combine the reaction process with the intrusion d<strong>et</strong>ection process in order to take into account<br />
the effect of reaction on the intrusion.<br />
4.3. Generating correlation rules<br />
In [2], we show how to automatically generate correlation rules. 4 Due to space limitation, we shall simply give<br />
the intuition here.<br />
An attack correlation rule enables the correlation process to correlate two alerts corresponding to correlated<br />
attacks. For instance, attack ���������¥�������¥��������������������� is correlated to attack ��� -�������¥��������������������������������� when<br />
��������������������� . In this case, the associated correlation rule will say that an alert ����������� corresponding to<br />
d<strong>et</strong>ection of attack ���������©� can be correlated with an alert ����������� corresponding to d<strong>et</strong>ection of attack ��� -� if<br />
the targ<strong>et</strong> file associated with ����������� is equal to the targ<strong>et</strong> link associated with ����������� . Of course, an implicit<br />
condition to correlate ����������� with ����������� is that the attack associated with ����������� occurred before the attack<br />
associated with ����������� .<br />
We similarly generate objective correlation rules to correlate an alert with an intrusion objective. When<br />
the correlation process receives an alert and there is a correlation rule that applies to correlate this alert to an<br />
4 These correlation rules may be also specified manually but we argue in [2] that it would be quite tedious for an expert to define accurate<br />
correlation rules. Actually, we guess it is one of the main advantages of our approach to automatically derive correlation rules from the<br />
specification of elementary attacks.<br />
163
Frédéric Cuppens, Fabien Autrel, Alexandre Miège & Salem Benferhat<br />
intrusion objective, the correlation process will check if this objective is achieved or not. For instance, attack<br />
������� � �¥� is correlated with objective ����� ��� ����� . If an alert corresponding to attack ������� � �¥� on a given<br />
������� is received, then the correlation process will check if ������� corresponds to a DNS server. Notice that this<br />
data is generally not provided in the alert. Therefore, we need to combine “classical” IDS with other tools that<br />
collect additional information about the monitored system such as its topology and configuration. This problem<br />
is outside the scope of this paper but is further discussed in the conclusion.<br />
5. Abduction in the correlation process<br />
Abductive reasoning consists in inferring plausible explanations from a s<strong>et</strong> of observable facts. It can also be<br />
presented as the generation of hypotheses that are missing in a deductive process. In the correlation process,<br />
abduction is used in two different situations:<br />
1. When all the steps of a given intrusion scenario are d<strong>et</strong>ected, the correlation process will succeed in<br />
tracking the intruder by reconstituting his intrusion scenario. However, it may happen that some steps<br />
in an intrusion scenario are not d<strong>et</strong>ected by any of the IDS. In this case, abduction will try to generate<br />
minimal hypotheses corresponding to und<strong>et</strong>ected attacks in order to compl<strong>et</strong>e the intrusion scenario<br />
d<strong>et</strong>ection. In [2], we suggest raising a virtual alert for each hypothesis successfully generated.<br />
2. When the correlation process succeeds in correlating several attacks but no intrusion objective is achieved<br />
y<strong>et</strong>, abduction is used to generate an intrusion objective consistent with these attacks. This is used by<br />
the correlation process to anticipate over the intruder’s intention in order to prepare the most adequate<br />
reaction.<br />
5.1. Virtual alerts<br />
The correlation process will attempt to create virtual alerts when it is plausible that some attacks are not<br />
d<strong>et</strong>ected. That is, when two alerts cannot be correlated, we try to insert one or several virtual alerts b<strong>et</strong>ween<br />
them.<br />
L<strong>et</strong> us describe the two main steps of the virtual alert creation function. L<strong>et</strong> us assume that ����������� and<br />
����������� are not correlated.<br />
L<strong>et</strong> ����� � ���¥� and ����� � ����� be the attacks respectively associated with ����������� and ����������� . The correlation<br />
�<br />
process will then attempt to find a path of attacks to ����� � ����� connect ����� � ����� with . Currently, the<br />
maximal acceptable length of this path is s<strong>et</strong> as a param<strong>et</strong>er by the security administrator. Of course and<br />
this is very important to notice, this path must be formed by attacks that might be not d<strong>et</strong>ected by any<br />
IDS that provides alerts to the correlation process.<br />
For example, l<strong>et</strong> us assume that, in the illegal root access scenario (see figure 6), the modification of the<br />
.rhost file is not d<strong>et</strong>ected. In this case, the correlation process receive the rlogin alert without being able to<br />
correlate it with the mount alert. However, the correlation process knows that attack mount can be correlated<br />
with attack rlogin through attack .rhost.<br />
The second step of the function replaces the path of attacks by a path of virtual alerts by instantiating<br />
�<br />
each attack. From the first attack we create a first virtual alert. This virtual alert is correlated ����������� with .<br />
We do the same for the next attacks of the path ����������� until is achieved. At this point, the correlation<br />
process verifies wh<strong>et</strong>her it is possible to correlate the last virtual alert ���������¨� with .<br />
In the last example, we had a single attack in our path corresponding to the � ��������� modification. We create<br />
a virtual alert associated with this attack. According to the correlation rules b<strong>et</strong>ween mount alert and .rhost<br />
164
pcinfo showmount mount<br />
Recognizing malicious intention in an intrusion d<strong>et</strong>ection process<br />
.rhost<br />
modification<br />
Figure 6: Illegal root access scenario<br />
modification alert, the targ<strong>et</strong> IP addresses must be the same. Consequently, the virtual alert is initialised with<br />
the targ<strong>et</strong> IP address of the mount alert. We then check correlation b<strong>et</strong>ween the virtual alert .rhost and the rlogin<br />
alert. This test could fail if the targ<strong>et</strong> IP addresses of these two alerts are not equal.<br />
5.2. Abduction of intrusion objective<br />
When the correlation process has d<strong>et</strong>ected the beginning of a scenario, it tries to find out what will be the next<br />
steps that might enable the intruder to achieve an intrusion objective.<br />
For this purpose, the correlation process applies an approach similar to the first step used to raise virtual<br />
alerts. It analyses the possible correlations b<strong>et</strong>ween attacks and b<strong>et</strong>ween an attack and an intrusion objective to<br />
find a path of attacks b<strong>et</strong>ween the last d<strong>et</strong>ected alert of the scenario and an intrusion objective.<br />
Of course, it som<strong>et</strong>imes happens that this alert can be connected to different intrusion objectives through<br />
different paths. In this case, our strategy is simply to select an intrusion objective that corresponds to the<br />
shortest path. Of course, it would be possible to significantly enhance this simple strategy. This point is further<br />
discussed in the conclusion.<br />
6. Examples of scenario d<strong>et</strong>ection<br />
In the intrusion d<strong>et</strong>ection context, the intruder whose plans are being inferred is not cooperative and<br />
observations are gleaned through IDS alerts. This point and the computer security context bring to light several<br />
issues to take in consideration. The objective of this section is to show, through the three intrusion scenarios<br />
introduced in section 2, how our approach addresses these issues:<br />
Unobserved actions: There are multiple reasons that can make an attack unobservable. Signature<br />
�<br />
based IDS are not able to recognize unknown exploits and even variations of known exploits can make<br />
them und<strong>et</strong>ectable. Furthermore there can be holes in the IDS n<strong>et</strong>work coverage that make impossible<br />
d<strong>et</strong>ection of some malicious attacks.<br />
Our approach to solve the problem that some steps in an intrusion scenario are not d<strong>et</strong>ected is based on<br />
abductive reasoning as we show in section 5.<br />
Repeated observations: it may happen that the intruder will repeat several times the same action, because<br />
�<br />
this is necessary to perform the intrusion scenario or simply because this might be a technique to disrupt<br />
the intrusion d<strong>et</strong>ection process. In any case, our approach will generate a single alert corresponding to<br />
the d<strong>et</strong>ection of a single intrusion scenario. For instance, figure 7 shows what will happen if the intruder<br />
performs �����¨������� two and then �§��������� � ��� two commands in the illegal root access scenario. We see<br />
that the result we obtain is more complex than figure 6 but it still corresponds to a single scenario.<br />
Optional actions: figure 8 shows d<strong>et</strong>ection of intrusion scenario ����� ��� ����� when the intruder<br />
�<br />
performs the ����������� � �������������¨��� � ����������� � �¥� sequence . Actually, ������� actions ��� � � and are optional<br />
since the intruder may directly attempt ������� � �©� the attack without checking that the server is active<br />
(with ������� the command) and Windows is installed (with ��� � � a of port 139).<br />
165<br />
rlogin<br />
illegal<br />
root<br />
access
Frédéric Cuppens, Fabien Autrel, Alexandre Miège & Salem Benferhat<br />
rpcinfo showmount<br />
rpcinfo<br />
showmount<br />
mount<br />
.rhost<br />
modification<br />
Figure 7: Illegal root access scenario with repeated �����¨������� and �§��������� � ��� commands<br />
Representing intrusion scenario that includes optional actions is immediate in our approach. We have<br />
actually nothing to do. If the intruder does not execute ������� or ��� � � , we shall simply d<strong>et</strong>ect a simpler<br />
scenario that does not include these actions.<br />
Representation of intrusion scenario variations: As an intruder executes his plan, his actions may lead<br />
�<br />
him to draw some conclusions i.e. gain some knowledge about the n<strong>et</strong>work or some host for example.<br />
This may lead in small variations in the execution of the intruder’s plan. We have to be able to represent<br />
these variations to take them in consideration. For instance, in ����� ��� ����� the scenario, the intruder<br />
may prefer ��� � ������� � ��� using instead of ���¡��� a to know which machines are active in the n<strong>et</strong>work he<br />
wants to attack.<br />
Representing intrusion scenario variations is straightforward in our approach. We have simply to specify<br />
the pre and post conditions of attack ��� � ������� � ��� and the correlation process will automatically derive<br />
that replacing ��� � ������� � ��� by ������� also enables the intruder to achieve the ����� ��� ����� objective.<br />
Partially ordered plans: By partially plans we point out plans in which the ordering constraint in the<br />
�<br />
actions creates a partial order over the actions. For example in the problem of system scanning, an<br />
intruder can collect a large amount of IP addresses and then port sweep each of them or can port sweep<br />
each IP as he finds them. This kind of flexible plans is easily d<strong>et</strong>ectable in our approach.<br />
Deactivation actions: there are actions that will disable the possibility to achieve the intrusion objective.<br />
�<br />
In our model, these deactivation actions are d<strong>et</strong>ected using anti correlation. For instance, figure 9 shows<br />
the result we obtain in the case of illegal access file scenario. In this figure, dash lines represent anti<br />
correlation. As mentioned before, using anti correlation, we can for instance conclude that the sequence<br />
� ���������������¥���¨� ��� -� does not match an intrusion scenario.<br />
���<br />
Inferring unobserved actions from state changes: As noticed in [5], the way IDSs work to d<strong>et</strong>ect<br />
�<br />
malicious actions conditions the way these actions are reported. L<strong>et</strong> us take the example of a service<br />
running on a computer. A host based IDS may report that the service has been started but a n<strong>et</strong>work<br />
based IDS may report only the effects of starting this service. In the first case we observe the action and<br />
in the second the state change caused by the action. From the state change we should be able to infer that<br />
the service has been started and consider it in our plan recognition task.<br />
We did not include this point in our approach, but since each attack specification includes a description<br />
of its effects (through its post condition), it will be quite straightforward to derive that an action was<br />
executed from the observation of a state change. This point is further discussed in the conclusion.<br />
166<br />
rlogin<br />
illegal<br />
root<br />
access
nslookup<br />
touch lpr -s<br />
Recognizing malicious intention in an intrusion d<strong>et</strong>ection process<br />
ping winnuke<br />
scan<br />
port 139<br />
Figure 8: DOS on DNS scenario<br />
DOS<br />
on<br />
DNS<br />
remove ln -s print-process g<strong>et</strong>-file<br />
block unblock<br />
Figure 9: Illegal file access scenario<br />
167<br />
Illegal<br />
file<br />
access
Frédéric Cuppens, Fabien Autrel, Alexandre Miège & Salem Benferhat<br />
7. Related works<br />
Several approaches exist in the literature in order to capture an agent’s plan, in particular:<br />
� Explicit Plan recognition [5, 6]<br />
� Chronicle recognition [9]<br />
� Expert system approach [8, 7]<br />
7.1. Explicit plan recognition<br />
In the approach suggested by Geib and Goldman in [5], the intrusion scenario d<strong>et</strong>ection system must be<br />
provided with a plan library based on the s<strong>et</strong> of actions the intruder may execute in order to build intrusion<br />
scenarios. This represents the major difference with our approach: in our approach, it is neither necessary to<br />
explicitly specify such a plan library.<br />
These plans are represented through task decomposition (hierarchical plans). A plan is a graph with goal or<br />
top level action as root node and leaves are actions implying this goal. In this approach we can see the problem<br />
of plan recognition as finding a minimal s<strong>et</strong> of goals explaining the observed actions. This formalism works as<br />
follow: at the beginning the intruder has a s<strong>et</strong> of goals and chooses plans he will execute in order to reach those<br />
goals. This s<strong>et</strong> of chosen plans d<strong>et</strong>ermines all the primitive actions the intruder can execute. The s<strong>et</strong> of pending<br />
actions, i.e. the s<strong>et</strong> of actions that can be executed according to the plan hierarchy, is generated as the intruder<br />
executes his chosen plans. The pending actions are enabled by the previous actions, more precisely executed<br />
actions are removed from the pending s<strong>et</strong> and newly enabled actions are added.<br />
This approach has some advantages:<br />
Management of unobserved actions: to handle the fact that the attacker’s actions are not always<br />
�<br />
d<strong>et</strong>ectable, Geib and Goldman construct a s<strong>et</strong> of possible execution traces. This s<strong>et</strong> is built from the<br />
execution trace represented by all the observed intruder’s actions. After finding all the plans that partially<br />
match the observations, the s<strong>et</strong> of possible execution traces is created by adding hypothesized unobserved<br />
actions to the execution trace in order to compl<strong>et</strong>e it according to the selected plans.<br />
Abductive reasoning: Geib and Goldman have addressed two problems: inferring unobserved action<br />
�<br />
from observed actions and inferring unobserved actions from state change.<br />
However it has also several drawbacks:<br />
Exhaustivity of the plan library: since this expert knowledge must be provided by some specialist, it is<br />
�<br />
difficult to assume that the plan library covers all the possible scenarios.<br />
Risk of explosion of the search space: The fact that hypothesized unobserved actions are inserted in the<br />
�<br />
s<strong>et</strong> of possible execution traces in order to match plans can lead to an explosion of the search space,<br />
especially in the case of multiple concurrent intrusion objectives.<br />
Management of repeated observations: an intruder that will repeat several times the steps of an intrusion<br />
�<br />
scenario will potentially activate the plan recognition several times. This may lead to an explosion<br />
of the number of alerts. For instance, if one specifies an intrusion ������� � �¥� ����� � ��� scenario by the<br />
������� sequence ��� � � , port ������� � �¥� 139, and if the intruder executes ��������� 100 and ��� � ��� 100 and then<br />
������� � �¥� 1 , this may lead ������������������������� to d<strong>et</strong>ections of ������� � �©� � ��� � ��� the .<br />
168
7.2. Chronicle recognition<br />
Recognizing malicious intention in an intrusion d<strong>et</strong>ection process<br />
The system of chronicle recognition aims at giving an interpr<strong>et</strong>ation of the world’s evolution giving dated<br />
events. It takes in entry a stream of dated events and recognises instances of chronicles as they are developing.<br />
It is mainly a temporal reasoning system. It is predictive in the sense that it predicts forthcoming events<br />
relevant to its task, it focuses its attention on them and it maintains their temporal windows of relevance. Its<br />
main function is to efficiently recognise complex temporal patterns on the fly, as they occur.<br />
Each chronicle can be viewed as a s<strong>et</strong> of events pattern and a s<strong>et</strong> of temporal and contextual constraint over<br />
them. If the observed events match the chronicle’s patterns and if they occur as the contextual and temporal<br />
constraints allow them to, then an instance of the modelled chronicle is recognised. Some hypotheses are done<br />
on the events. First, all events specified in a chronicle must be observable, i.e. unobservable activities are not<br />
included in the chronicle expression. It is also assumed that the events are reported to the system as they occur<br />
and they must be collected in the same order as they occur (synchronization hypothesis).<br />
This approach has several advantages:<br />
� Chronicle based system gives an efficient recognition process.<br />
The hypothesis stating that all the actions are observable makes unnecessary the abduction of unobserved<br />
�<br />
events.<br />
The system maintains the s<strong>et</strong> of possible occurring chronicles as the new observations are sequentially<br />
�<br />
collected and treated.<br />
� It is possible to define deactivation events that invalidates a partially recognised chronicle.<br />
� The explosion of the search space is more limited than in the plan recognition approach.<br />
The chronicle main advantages are the consequences of the strong hypotheses made. But the<br />
synchronisation hypothesis and the hypothesis made that all the intruder’s actions specified in a chronicle<br />
can be d<strong>et</strong>ected are very hard to fulfil in computer security domain. These hypotheses and the fact that this<br />
system is based on a chronicle library point out some drawbacks:<br />
� As for plan recognition systems, the exhaustivity of the plan library is a main concern.<br />
� In computer security domain it is difficult to predict which events will be observable or not.<br />
Since chronicle recognition assumes that all actions are observable, not including an event because it is<br />
�<br />
som<strong>et</strong>imes not d<strong>et</strong>ected may lead to false positives.<br />
� Including an unobservable event in a chronicle may lead to false negatives.<br />
Actually, we argue that a chronicle system is especially efficient to recognize stereotyped attack scenarios,<br />
such as the ones launched by automatic intrusion tools. In this case, it is quite straightforward to represent<br />
each attack scenario by a chronicle. We are currently investigating this approach and it will be presented in a<br />
forthcoming paper.<br />
7.3. Expert system approach<br />
[7] suggests representing an intrusion scenario as a s<strong>et</strong> of production rules. These rules are fired as the intrusion<br />
progresses. This approach is based on the P-Best expert system.<br />
Notice that there is generally not a one to one correspondence b<strong>et</strong>ween the production rules and various<br />
intrusion steps performed by the intruder. Additional production rules are necessary to “control” the intrusion<br />
169
Frédéric Cuppens, Fabien Autrel, Alexandre Miège & Salem Benferhat<br />
d<strong>et</strong>ection process. Actually, starting from the exploit description of an intrusion, the approach requires some<br />
adaptations to specify how to d<strong>et</strong>ect this intrusion scenario.<br />
This approach has some advantages. In particular, Lindquist and Porras claim that their approach is quite<br />
efficient from a performance point of view. The drawbacks of this approach are quite similar to chronicle<br />
recognition. The exhaustivity of the production rules is not an easy to solve problem. It also seems that<br />
specifying an intrusion scenario must take into account which steps are d<strong>et</strong>ected. There is no easy way to<br />
abduce unobservable events. Finally, repeated observations will potentially activate d<strong>et</strong>ection of the intrusion<br />
scenario several times (as in plan or chronicle recognition).<br />
8. Conclusion<br />
Based on the observation that an intrusion scenario might be represented as a planning activity, we suggest a<br />
model to recognize intrusion scenarios and malicious intentions. This model does not follow previous <strong>propos</strong>als<br />
that require to explicitly specify a library of intrusion scenarios. Instead, our approach is based on specification<br />
of elementary attacks and intrusion objectives. We then show how to derive correlation relations b<strong>et</strong>ween two<br />
attacks or b<strong>et</strong>ween an attack and an intrusion objective. D<strong>et</strong>ection of complex intrusion scenario is obtained by<br />
combining these binary correlation relations.<br />
Our approach is efficient to cluster repeated actions in a single scenario. We also suggest using abduction<br />
to recognize intrusion scenarios when some steps in these scenarios are not d<strong>et</strong>ected. We then define the notion<br />
of anti correlation that is useful to recognize a sequence of correlated attacks that does no longer enable the<br />
intruder to achieve an intrusion objective. This may be used to eliminate a category of false positives that<br />
correspond to false attacks, that is actions that are not further correlated to an intrusion objective.<br />
We have implemented in Prolog the functions that perform attack and objective correlations in the CRIM<br />
prototype [1, 2]. Attacks are actually specified in Lambda [3], which is fully compatible with the attack model<br />
suggested in this paper and alerts are represented in the IDMEF format [4]. We are currently extending this<br />
implementation to include the anti correlation functionality.<br />
There are several issues to this work. When the intruder did not achieved his intrusion objective y<strong>et</strong> but<br />
there are several possible intrusion objectives consistent with a given sequence of correlated attacks, our current<br />
strategy is simply to select the objective that requires the shortest path of attacks to be achieved. Our course, it<br />
would be useful to significantly enhance this strategy. We are currently studying approaches based on Bayesian<br />
N<strong>et</strong>work to decide what are the best intrusion objectives that explain all the observations. As suggested in [6],<br />
our solution should also able to consider situations where the intruder has multiple goals.<br />
Another point is that to decide if a given intrusion scenario is achieved or not, it is often necessary to<br />
combine information provided by “classical” IDS with other information about the system monitored by<br />
the IDS: its topology, configuration and other data about the type and version of the operating systems and<br />
applications installed in this system. For instance, to decide if the objective ����� ��� ����� is achieved it is<br />
necessary to know on which system is installed the DNS server. This kind of data is not provided by classical<br />
IDS but other tools exist that may be used to collect it. Since current IDS also provide alerts that do not allow us<br />
to distinguish b<strong>et</strong>ween successful or failing attacks, these additional data would be also useful for that purpose.<br />
This problem is currently investigated in the ongoing project DICO.<br />
9. Acknowledgements<br />
This work was partially funded by the DGA/CELAR/CASSI as a part of the Mirador project and then by the<br />
French Ministry of Research as part of the DICO project. The authors would like to thank all the members<br />
of these projects, especially the members of the sub-project “Correlation”: Hervé Debar, Ludovic Mé and<br />
Benjamin Morin.<br />
170
References<br />
Recognizing malicious intention in an intrusion d<strong>et</strong>ection process<br />
[1] F. Cuppens. Managing Alerts in a Multi-Intrusion D<strong>et</strong>ection Environment. In 17th Annual Computer<br />
Security Applications Conference New-Orleans, New-Orleans, USA, December 2001.<br />
[2] F. Cuppens and A. Miège. Alert Correlation in a Cooperative Intrusion D<strong>et</strong>ection Framework. In IEEE<br />
Symposium on Security and Privacy, Oakland, USA, 2002.<br />
[3] F. Cuppens and R. Ortalo. Lambda: A language to model a database for d<strong>et</strong>ection of attacks. In Third<br />
International Workshop on the Recent Advances in Intrusion D<strong>et</strong>ection (RAID’2000), Toulouse, France,<br />
October 2000.<br />
[4] D. Curry and H. Debar. Intrusion d<strong>et</strong>ection message exchange format data model and extensible markup<br />
language (xml) document type definition. draft-it<strong>et</strong>f-idwg-idmef-xml-06.txt, December 2001.<br />
[5] C. Geib and R. Goldman. Plan Recognition in Intrusion D<strong>et</strong>ection Systems. In DARPA Information<br />
Survivability Conference and Exposition (DISCEX), June 2001.<br />
[6] C. Geib and R. Goldman. Probabilistic Plan Recognition for Hostile Agents. In Florida AI Research<br />
Symposium (FLAIR), Key-West, USA, 2001.<br />
[7] Ulf Lindquist and Philip Porras. D<strong>et</strong>ecting Computer and N<strong>et</strong>work Misuse Through the Production-Based<br />
Expert System Tools<strong>et</strong> (P-Best). In IEEE Symposium on Security and Privacy, Oakland, USA, 1999.<br />
[8] A. Mounji and B. Le Charlier. Continuous Assessment of a Unix Configuration: Integrating Intrusion<br />
D<strong>et</strong>ection and Configuration Analysis. In ISOC’97 Symposium on N<strong>et</strong>work and Distributed System<br />
Security, San Diego, USA, February 1997.<br />
[9] M. Ornato and P. Carle. Reconnaissance d’intention sans reconnaissance de plan. In Journées<br />
Francophones d’Intelligence Artificielle Distribuée <strong>et</strong> Systèmes Multi-Agents, 1994.<br />
[10] A. Valdes and K. Skinner. Probabilistic Alert Correlation. In Fourth International Workshop on the Recent<br />
Advances in Intrusion D<strong>et</strong>ection (RAID’2001), Davis, USA, October 2001.<br />
171
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
172
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
Cryptanalyse par side channel<br />
Résumé<br />
J-J. Quisquater & D. Samyde<br />
Université catholique de Louvain<br />
Groupe Crypto<br />
3 Place du Levant<br />
B-1348 Louvain la Neuve, Belgium<br />
jjq@dice.ucl.ac.be<br />
samyde@dice.ucl.ac.be<br />
La cryptologie rassemble l’ensemble des techniques de cryptographie <strong>et</strong> de cryptanalyse. La<br />
cryptographie respecte les principes de Kerckhoffs, qui justifient que toute information liée à un<br />
cryptosystème peut être publique à l’exception des clés de chiffrement. La cryptanalyse inclut donc des<br />
techniques très avancées afin de r<strong>et</strong>rouver ces clefs. La controverse sur la sécurité de l’algorithme de<br />
chiffrement DES aura grandement contribué au développement <strong>et</strong> à l’avènement de nouvelles méthodes<br />
mathématiques de cryptanalyse. Les attaques linéaires <strong>et</strong> différentielles en sont les exemples les plus probants.<br />
Toutefois bien que ces techniques nécessitent encore souvent de grandes quantités de paires de textes en<br />
clairs <strong>et</strong> de textes chiffrés, il existe d’autres méthodes très puissantes basées sur les "fuites d’information"<br />
involontaires. En eff<strong>et</strong> un cryptosystème peut laisser fuir de l’information de différentes manières, c’est ainsi<br />
que des données sensibles peuvent parfois être extraites de signaux physiques émis par une machine de<br />
chiffrement. La température, les ondes acoustiques, le rayonnement électromagnétique, le temps de calcul<br />
ou la lumière (infra rouge, rayonnée, interaction avec un laser) sont autant d’indices qui peuvent s’avérer<br />
extrêmement dangereux. On parle alors de side channel. La cryptanalyse par les side channel a longtemps<br />
été le terrain de compétence réservé des services secr<strong>et</strong>s, mais depuis une dizaine d’années, les mondes<br />
scientifique <strong>et</strong> universitaire contribuent à développer des nouvelles techniques de side channel très efficaces.<br />
Keywords Side channel cryptanalysis, Tempest, Timing attack, Power & ElectroMagn<strong>et</strong>ic Analysis, Fault<br />
Analysis<br />
Introduction<br />
L’histoire de la cryptanalyse conventionnelle <strong>et</strong> celle du développement des ordinateurs les plus puissants<br />
sont intimement liées. Il existe toutefois bien des anecdotes très impressionnantes quant à la puissance des<br />
techniques mises en oeuvre pour une époque donnée. La preuve incontestable en est la brillante cryptanalyse<br />
de l’Enigma marine par A. Turing <strong>et</strong> les deux Colossus du GHCQ à Bl<strong>et</strong>chley Park pendant la deuxième guerre<br />
mondiale. Comme pour les techniques de cryptanalyse conventionnelles, la puissance des side channels étant<br />
redoutable, leurs réussites sont longtemps demeurées dans l’ombre.<br />
Il y a quelques siècles, les automates les plus avancés reposaient sur des principes mécaniques aujourd’hui<br />
bien maîtrisés. Avec l’évolution de la science, l’électricité à pris le pas sur la mécanique <strong>et</strong> ce fut l’avènement<br />
de l’électromécanique puis de l’électronique. Toutefois bien que les eff<strong>et</strong>s physiques désirés soient utilisés à<br />
bon escient, <strong>et</strong> constituent la composante principale du fonctionnement d’une machine donnée, d’autres eff<strong>et</strong>s<br />
parasites ont parfois été négligés. Dans ce cas, il devient alors parfois possible de les utiliser pour extraire les<br />
informations sensibles manipulées par un appareil [1].<br />
Lorsqu’un courant parcourt un conducteur, il crée un champ électrique, un champ magnétique ainsi qu’un<br />
échauffement. Ces eff<strong>et</strong>s sont connus <strong>et</strong> décrits par les équations de Maxwell <strong>et</strong> la loi de Joules. Mais lorsque<br />
certains de ces eff<strong>et</strong>s physiques existants ne sont pas parmi les volontés premières du concepteur d’un automate,<br />
173
J-J. Quisquater & D. Samyde<br />
ils peuvent trahir son fonctionnement. Il est possible par exemple de capter le champ électromagnétique à<br />
distance avec une antenne appropriée, de le réamplifier, de démoduler pour obtenir des informations. Dans<br />
le cas d’un tube cathodique de télévision ou d’un écran d’ordinateur, le pixel à l’écran est obtenu grâce à la<br />
projection d’un faisceau d’électrons sur des molécules sensibles. Mais la position du faisceau d’électrons est<br />
contrôlée par des bobines de déplacement. Le champ qu’elles rayonnent si il est capté, amplifié puis représenté<br />
à l’entrée de d’autres bobines perm<strong>et</strong> de copier l’image de l’écran à distance.<br />
Pour ce qui concerne la chaleur, certaines caméras thermiques autorisent une assez bonne résolution,<br />
perm<strong>et</strong>tant la construction de modèles de signatures. Ces modèles caractérisent alors la machine. Ces techniques<br />
sont très utilisées par certains systèmes d’armes récents, mais les fabricants de cryptoprocesseurs s’ingénuent<br />
également à essayer de limiter les échauffements caractéristiques révélant trop d’informations sur le calcul en<br />
cours dans leur puce. La liste exhaustive des eff<strong>et</strong>s de bord indésirables lors du fonctionnement d’un appareil<br />
ne saurait être donnée ici, toutefois c<strong>et</strong> article s’emploie à rappeler l’importance de la cryptanalyse par les<br />
side channel <strong>et</strong> à dresser une liste des attaques les plus utilisées actuellement contre les implémentations<br />
cryptographiques.<br />
Souvent on oublie de souligner l’important rôle joué par les side channel dans des cas de cryptanalyses<br />
réussies. Il existe plusieurs manières de concevoir la cryptanalyse. La première <strong>et</strong> la plus conventionnelle<br />
consiste à regarder les primitives cryptographiques comme des obj<strong>et</strong>s mathématiques ou des algorithmes.<br />
L’autre conception s’intéresse plutôt à l’implémentation de la primitive dans une machine de chiffrement. Il<br />
est alors intéressant d’analyser les eff<strong>et</strong>s de bord obtenus. Un source de side channel est donc inhérente à<br />
la structure même de l’implémentation physique <strong>et</strong> elle peut grandement faciliter le travail d’un assaillant<br />
éventuel.<br />
Historique<br />
Il est bien difficile de fixer avec précision la naissance de la cryptanalyse par side channel. Mais il serait<br />
faux de fixer c<strong>et</strong>te date à la fin du XXème siècle. Il semble même que l’on puisse fixer c<strong>et</strong>te date à la fin du<br />
XIXème siècle ou au tout début du XXème. Les premières prises de conscience de l’existence de side channel<br />
n’ont visiblement pas donné lieu à des publications <strong>et</strong> à des communications internationales.<br />
J.Maxwell établit sa théorie sur les ondes électromagnétiques en ������� . Mais dès la fin du 19ème siècle,<br />
des problèmes de crosstalk apparaissent dans les liaisons téléphoniques. Pendant la première guerre mondiale<br />
ces problèmes de couplage électriques furent utilisés pour espionner des communications. Les informations<br />
obtenues étaient uniquement recopiées sur un autre média <strong>et</strong> écoutées. Le traitement du signal étaient inexistant<br />
dans de telles interceptions.<br />
Mais en ���¥��� H. Yardley <strong>et</strong> son équipe découvrirent que des informations classifiées pouvaient s’échapper<br />
de matériels électriques, <strong>et</strong> que ces fuites perm<strong>et</strong>taient de r<strong>et</strong>rouver les secr<strong>et</strong>s manipulés. Les données<br />
contenues dans les appareils de chiffrement modulaient un signal sur la bande d’une source d’enregistrement<br />
proche. Au milieu des années trente, les études sur la machine à écrire d’IBM indiquèrent que les fuites<br />
d’informations étaient importantes <strong>et</strong> devaient être prises en considération.<br />
Les militaires prirent alors au sérieux ce genre de fuites <strong>et</strong> les différentes armées occidentales se mirent à<br />
faire très attention à limiter les rayonnements sur leurs appareils sensibles lors de la deuxième guerre mondiale,<br />
particulièrement pour les oscillateurs embarqués. Par la suite cela n’empêcha pas les télétypes communistes<br />
d’être "interceptés" à Berlin. Les antennes de réception étaient placées dans des tunnels proches. Durant les<br />
années cinquante, les autorités chinoises utilisèrent également des techniques acoustiques pour espionner des<br />
ambassades, alors que les russes envoyaient des j<strong>et</strong>s de micro-ondes sur des barres de métal contenues dans des<br />
statues, afin d’écouter les ondes acoustiques d’une ambassade américaine. La création de la NSA en ������� donna<br />
immédiatement une importance cruciale à la récupération des signaux comprom<strong>et</strong>tants. Le mot SIGINT qui est<br />
l’acronyme de SIGnal INTelligence prit alors tout son sens. Une des premières interception de rayonnement<br />
électromagnétique connue fut réalisée en utilisant les fils téléphoniques comme antenne. Par le futur, ce genre<br />
de technique continuera d’être appliquée avec succès pour des interceptions d’écrans informatiques à plusieurs<br />
centaines de kilomètres de distance. Ces premières expériences furent réalisées au M.I.T.<br />
Les années cinquante fut le début de la grande série des normes militaires américaines & OTAN, en ce<br />
174
Cryptanalyse par side channel<br />
qui concerne la limitation des rayonnements électromagnétiques comprom<strong>et</strong>tants <strong>et</strong> l’utilisation de blindage<br />
électromagnétiques. Les militaires américains s’inquiétèrent de c<strong>et</strong>te nouvelle menace de compromission <strong>et</strong><br />
initièrent alors le programme TEMPEST. Au début des années soixante, l’ambassade russe <strong>et</strong> certains appareils<br />
francais à Londres furent espionnés grâce à la récupération de leurs rayonnement électromagnétiques. En<br />
démodulant correctement les signaux récupérés, les anglais arrivaient à r<strong>et</strong>rouver des informations classifiées.<br />
C<strong>et</strong>te fois, le traitement du signal devint indispensable <strong>et</strong> prit un rôle de plus en plus grand dans le futur [Figure<br />
1].<br />
Figure 1 : Les sources de fuites par un des concepteurs d’Arpan<strong>et</strong><br />
Un des exemples les plus frappants concerne la cryptanalyse d’un chiffrement russe lors de la crise de Cuba.<br />
Le navire américain intercepteur Oxford réussit alors à capter les radiations électromagnétiques émises par une<br />
machine de chiffrement soviétique située sur l’île. De plus la marine américaine réalisa alors que la mesure du<br />
bruit rayonné perm<strong>et</strong>tait de connaître la position des rotors à l’intérieur de certaines machines de chiffrement.<br />
Les civils n’étaient alors pas très au courant des possibilités d’interception, car ce genre de méthodes étaient<br />
classifié. Mais rapidement, dès les années soixante dix, des particuliers mentionnèrent des cas d’interférences<br />
entre différents matériels électroniques. Et les cas de jeunes chercheurs faisant jouer un air de musique sur un<br />
poste de radio ou un récepteur munit d’une démodulation, en utilisant les commutations d’un écran ou d’une<br />
imprimante ne sont pas isolés.<br />
Toutefois l’utilisation des analyses par side channel continuèrent d’exister <strong>et</strong> l’opération Kilderkin, qui<br />
consistait dans la récupération des émanations électromagnétiques de l’ambassade russe au Canada, prit place<br />
au milieu des années soixante dix. A peu près à la même époque les services de renseignements polonais furent<br />
pris en flagrant délit d’espionnage sur du matériel militaire soviétique ; une fois de plus les rayonnements<br />
électromagnétiques furent mis en cause. Toutefois c<strong>et</strong>te fois-ci, c”<strong>et</strong>aient les fils d’alimentation électrique qui<br />
étaient écoutés. En ������� la NSA introduit de manière non classifiée le concept de zone de sécurité autour<br />
d’un point de mesure <strong>et</strong> c’est l’année suivante que IBM, bien après Zenith, construit son premier PC blindé<br />
175
J-J. Quisquater & D. Samyde<br />
contre les fuites électromagnétiques [2]. A la fin des années quatre vingt I. Murphy, aussi connu sous le nom<br />
de Captain Zap, publia les premiers plans de récepteurs TEMPEST, après que la télévision anglaise ait montré<br />
des démonstrations à l’antenne. Dans les années quatre vingt, l’armée francaise s’intéressa spécifiquement au<br />
développement d’une chaîne de mesure TEMPEST. Les services de renseignement bulgares utilisèrent des<br />
camions espions équipés d’antennes <strong>et</strong> maquillés pour intercepter des communications militaires dans les pays<br />
occidentaux. Dans les années quatre vingt dix, R. Anderson <strong>et</strong> M. Kuhn travaill´rent sur les interceptions de<br />
rayonnements <strong>et</strong> publi´rent des polices perm<strong>et</strong>tant de réduire les fuites. De toute manière, les normes de santé<br />
liées à la puissance des émissions <strong>et</strong> la prise de conscience des constructeurs firent que les niveaux de fuites<br />
se firent de plus en plus faibles. En ������� P. Kocher publia ses travaux basés sur la mesure du temps de calcul<br />
d’un cryptosystème. La timing attack exploitée par F. Koeune permit de récupérer une clé privée RSA de �¥���<br />
bits avec quelques centaines de milliers d’échantillons en quelques minutes alors que la factorisation d’un<br />
nombre équivalent requiérait plusieurs mois de calculs intensifs. P. Kocher <strong>et</strong> de son équipe se concentrèrent<br />
alors sur l’analyse de consommation, <strong>et</strong> ils mirent en évidence la puissance des mesures différentielles. C’est<br />
ainsi que les fondeurs de silicium se vient demander par leurs gros clients bancaires de trouver des solutions<br />
rapides <strong>et</strong> efficaces à ce problème. Les années quatre vingt dix viren apparaître un autre type de cryptanalyse,<br />
basé sur l ’injection de fautes. Actuellement la mesure des rayonnements électromagnétiques des processeurs<br />
cryptographiques en champ proche, couplée à une mesure différentielle perm<strong>et</strong> de m<strong>et</strong>tre à mal bien des<br />
implémentations. Les progrès des contre mesures réalisés dans le domaine de la maîtrise des eff<strong>et</strong>s de l’insertion<br />
de faute sont eux quasiment décisifs.<br />
L’histoire relate même des cas ou les side channel furent introduits volontairement afin de pouvoir faciliter<br />
la compromission des données sensibles par la suite. Au final l’utilisation des side channel s’est développée de<br />
plus en plus pour devenir aujourd’hui une des composantes essentielles de la collecte de renseignement.<br />
Les fuites par rayonnements électromagnétiques<br />
Les fuites par rayonnements électromagnétiques sont encore exploitables de nos jours contre des systèmes<br />
récents. Elles peuvent être utilisées pour comprom<strong>et</strong>tre tous types d’appareils.<br />
La qualité des antennes de réception est très importante, <strong>et</strong> il en existe de plusieurs types (logarithmique,<br />
fou<strong>et</strong>, planaires...). De même, une excellente stabilité en fréquence des oscillateurs locaux assure un bon<br />
résultat ; les meilleurs récepteurs autorisent une précision de ������� Hz en utilisant des boucles à verrouillage de<br />
phase imbriquées.<br />
Les contre mesures s’étant développées avec le temps, dans le cas d’un tube cathodique, il est difficile<br />
d’obtenir une interception valide à plus d’une dizaine de mètres, avec du matériel ancien. C<strong>et</strong>te distance <strong>et</strong> ce<br />
niveau de rayonnement sont à comparer avec les distances obtenues par les satellites espions qui, de par leur<br />
position alignée avec une ligne d’antennes terrestre, écoutent certaines transmissions depuis l’espace.<br />
De nos jours, beaucoup d’informations sont accessibles parce qu’elles ont été déclassifiées ou ont percolé<br />
dans le public. Mais la simple présence ou non de rayonnement électromagnétique perm<strong>et</strong> bien souvent de<br />
fournir une information utile à un assaillant. Quelques systèmes vont jusqu’à recréer un faux champ magnétique<br />
autour d’eux de manière à masquer leur présence ou leurs rayonnements. Toutefois, le théorème de C. Shannon<br />
indique qu’en réitérant la mesure, il devient alors possible de supprimer le bruit <strong>et</strong> d’obtenir un rapport signal<br />
sur bruit aussi élevé que souhaité.<br />
Des appareils comme les cartes à puces utilisent des contremesures opératives pour détecter la répétition<br />
d’une exécution particulière un grand nombre de fois. Dans la grande majorité des cas, les concepteurs<br />
se contentent d’essayer de limiter le niveau de rayonnement ou alors de définir une zone de protection ne<br />
perm<strong>et</strong>tant pas d’obtenir un signal intelligible. Mais des applications nécessitent bien souvent d’être protégées<br />
par une cage de Faraday, <strong>et</strong> il n’est pas toujours simple <strong>et</strong> possible d’en utiliser une.<br />
Certaines recommendations liées au niveau d’atténuation des cages de Faraday semblaient inexplicables par<br />
le passé ; les récents travaux de M. Kuhn <strong>et</strong> d’autres universitaires semblent pouvoir expliquer les différences<br />
entre les atténuations requises par les militaires <strong>et</strong> les civils. En eff<strong>et</strong> les atténuations militaires ne semblent<br />
laisser aucune chance d’interception même avec du matériel récent, alors que les niveaux civils n’assuraient<br />
pas c<strong>et</strong>te qualité de blindage.<br />
176
Cryptanalyse par side channel<br />
Il est également important de noter que la lumière issue d’un écran contient une information utile qui n’est<br />
autre que le signal vidéo. Comme l’a récemment publié M. Kuhn, il est possible de reconstruire une image<br />
vidéo à partir de la luminosité d’un écran distant.<br />
Les fuites par mesure du temps<br />
Une des premières attaques, par mesure du temps de réponse d’un système, perm<strong>et</strong>tait de réduire le nombre<br />
d’essais pour r<strong>et</strong>rouver un mot de passe. C<strong>et</strong>te attaque était particulièrement efficace contre les implémentations<br />
d’Unix. En eff<strong>et</strong>, si la comparaison entre le mot de passe enregistré <strong>et</strong> le mot de passe saisi était effectuée oct<strong>et</strong><br />
par oct<strong>et</strong> en partant du premier bit, <strong>et</strong> que la réponse de la machine était disponible dès la première erreur, il<br />
était alors simple de tester tous les oct<strong>et</strong>s possibles en première position <strong>et</strong> de choisir celui qui avait le temps<br />
de réponse le plus long. En eff<strong>et</strong>, ce dernier était forcément identique à l’oct<strong>et</strong> recherché. L’augmentation du<br />
temps de réponse correspondait à la somme du temps de la comparaison valide du premier octect <strong>et</strong> du temps<br />
de réponse erronée du deuxième. Selon R. Moreno, ce genre d’analyse a également fonctionné lors du portage<br />
d’une application bancaire depuis un processeur Motorola sur une carte à puce incluant un processeur Thomson.<br />
L’application de c<strong>et</strong>te attaque a été réalisé par F. Grieu. Il est également possible d’utiliser la mesure du temps<br />
de réponse pour connaître le contenu du cache d’un serveur informatique distant. En eff<strong>et</strong>, une information déjà<br />
présente dans le cache de la machine ne nécessitera pas le même temps de réponse que si l’information doit<br />
être chargée.<br />
En ������� P. Kocher publia un article assez théorique sur l’utilisation de la mesure de temps, pour essayer de<br />
r<strong>et</strong>rouver des clés cryptographiques. Deux ans plus tard, F. Koeune mis en application c<strong>et</strong>te analyse <strong>et</strong> démontra<br />
dans une publication comment il était possible de m<strong>et</strong>tre à mal une implémentation naive de l’algorithme<br />
Square & Multiply servant à l’exponentiation modulaire. Selon la valeur du bit de clé traité, il n’y a que deux<br />
possibilités de branchement à l’intérieur du code exécuté pour sa démonstration. Mais ces deux branchements<br />
ne prenant pas le même temps d’exécution, il est alors possible de connaître les clés cryptographiques assez<br />
rapidement [3], avec quelques centaines de milliers d’échantillons.<br />
Les contre mesures à ce genre d’analyse peuvent paraître triviales, mais une réponse à temps constant n’est<br />
pas toujours la mieux appropriée : il faut quelques fois considérer le pire cas d’un algorithme, ou insérer des<br />
contre mesures plus subtiles, modifiant les propriétés temporelles.<br />
Les fuites par mesure de la température<br />
Les analyses en température sont peu utilisées contre les implémentations cryptographiques ; elles sont plus<br />
courantes dans l’analyse d’images aériennes ou spatiales. Dans bien des cas, des matériels stationnés à un<br />
endroit donné ont modifié la température ou l’illumination de leur lieu de stockage. Même longtemps après<br />
leur départ il est toujours possible de procéder à une mesure révélant leur présence passée.<br />
Dans le cas des processeurs, le facteur limitant est la diffusion de la chaleur. En eff<strong>et</strong>, l’équation de<br />
propagation est bien connue, mais les temps de propagation sont rédhibitoires. Toutefois, il est important de<br />
ne pas obtenir de points chauds sur la puce, afin de ne pas révéler une activité spécifique [4]. Par le passé, les<br />
testeurs de composants utilisaient des cristaux liquides pour révéler les zones d’activité du composant. C<strong>et</strong>te<br />
méthode ne possède pas une dynamique suffisante <strong>et</strong> se révèle trop lente pour être réellement puissante.<br />
Les fuites par mesure de la consommation<br />
Une p<strong>et</strong>ite antenne insérée dans un condensateur volontairement troué, peut fournir beaucoup<br />
d’informations sur l’activité d’une carte électronique. C<strong>et</strong>te ancienne technique est bien connue <strong>et</strong> utilisée<br />
depuis longtemps. Une carte électronique ne contient souvent que peu d’éléments très intéressants à analyser.<br />
Il suffit alors d’essayer de mesurer leur consommation. En insérant une résistance de faible valeur entre la<br />
broche de masse <strong>et</strong> la masse générale de la carte, il est alors possible de traquer la consommation spécifique<br />
d’une puce. Par le passé, quelques personnes avaient déjà remarqué que l’analyse de la consommation d’un<br />
cryptoprocesseur pouvait fournir de l’information sur les clés manipulées. P. Kocher [5], en ������� , a introduit<br />
la notion de mesure différentielle ; il s’agit de l’intercorrélation de deux variables aléatoires. C<strong>et</strong>te technique<br />
appelée DPA s’avère être très dangeureuse contre les cartes à puces <strong>et</strong> les puces les plus récentes. De plus, il<br />
est possible d’améliorer encore les résultats, en remplacant la résistance de mesure par une bobine située dans<br />
177
J-J. Quisquater & D. Samyde<br />
le champ proche du processeur. L’amélioration du rapport signal sur bruit est alors comprise entre ��� <strong>et</strong> �����©� ;<br />
on parle alors d’analyse électromagnétique [6,7]. Bien que c<strong>et</strong>te technique date du début de l’an ������� , les<br />
fabricants de composants commencent à la prendre au sérieux car elle semble menacante. L’algorithme utilisé<br />
est simple dans les deux cas : il suffit de quantifier l’influence d’un bit de la clé <strong>et</strong> de séparer les traces obtenues<br />
en deux ensembles. En vérifiant ensuite l’hypothèse sur la valeur du bit de travail, il est possible de connaître<br />
la valeur du bit de clé recherchée.<br />
Conclusion<br />
En conclusion, la cryptanalyse utilisant les side channel est puissante <strong>et</strong> peut rendre inefficace des<br />
implémentations d’algorithmes très robustes <strong>et</strong> bien construits. Dans le futur, d’autres side channels feront<br />
peut-être leur apparition, mais il semble toutefois que le coût réel des ces attaques soit de plus en plus élevé.<br />
Afin de se préserver d’un bon nombre de cryptanalyses, les implémentations doivent maintenant intégrer un<br />
niveau d’expertise non négligeable. Les contremesures sont toujours possibles <strong>et</strong> disponibles, mais elles doivent<br />
être bien pensées. Il est facile d’espérer éviter un side channel <strong>et</strong> en fait de se fragiliser vis à vis d’un autre [8,9].<br />
Dans c<strong>et</strong> éternel jeu du gendarme <strong>et</strong> du voleur, les cryptanalystes semblent pour le moment avoir la part<br />
belle [10] ; le futur fera sans doute évoluer les choses rapidement.<br />
Références<br />
[1] NACSIM 5000 : Tempest Fundamentals, National Security Agency, Fort George G.Meade, Maryland.<br />
Feb 1982. Partially declassified also available at http://cryptome.org/nacsim-5000.htm.<br />
[2] M. Kuhn and R. Anderson, Soft tempest : Hidden data transmission using electromagn<strong>et</strong>ic emanations,<br />
In D. Aucsmith, editor, Information Hiding, vol 1525 of Lecture Notes in Computer Science, pp 124-142.<br />
Springer-Verlag, 1998.<br />
[3] J. Kelsey, B. Schneier, D. Wagner, and C. Hall, Side Channel Cryptanalysis of Product Ciphers, in Proc.<br />
of ESORICS’98, Springer-Verlag, September 1998, pp. 97-110.<br />
[4] J-S. Coron, P. Kocher, and D. Naccache, Statistics and Secr<strong>et</strong> Leakage, Financial Cryptography 2000<br />
(FC’00), Lecture Notes in Computer Science, Springer-Verlag.<br />
[5] P. Kocher, J. Jaffe and B. Jun, Differential Power Analysis, In M. Wiener, editor, Advances in Cryptology -<br />
CRYPTO’99, vol. 1666 of Lecture Notes in Computer Science, pp. 388-397, Springer-Verlag, 1999. Also<br />
available at http://www.cryptography.com/dpa/Dpa.pdf.<br />
[6] K. Gandolfi, C. Mourtel and F. Olivier, Electromagn<strong>et</strong>ic analysis : concr<strong>et</strong>e results, In Koç, Naccache,<br />
Paar editors, Cryptographic Hardware and Embedded Systems, vol. 2162 of Lecture Notes in Computer<br />
Science, pp. 251-261, Springer-Verlag, 2001.<br />
[7] J.-J. Quisquater and D. Samyde, ElectroMagn<strong>et</strong>ic Analysis (EMA) Measures and Counter-Measures for<br />
Smart Cards, in I. Attali and T. Jensen, editors, E-Smart Smartcard Programming and Security, vol. 2140<br />
of Lecture Notes in Computer Science, pp. 200-210, Springer-Verlag 2001.<br />
[8] R. Anderson, M.Kuhn, Tamper Resistance - A Cautionary Note, Proc. of the Second USENIX Workshop<br />
on Electronic Commerce, USENIX Association, 1996.<br />
[9] O. Kommerling and M. Kuhn, Design principles for tamper-resistant smartcard processors, In Proc. of<br />
the USENIX Workshop on Smartcard Technology (Smartcard’99), pp. 9–20. USENIX Association, 1999.<br />
[10] E. Biham and A. Shamir, Power Analysis of the Key Scheduling of the AES Canditates, in Second<br />
Advanced Encryption Standard Candidate Conference, Rome, March 1999.<br />
178
septembre 2002 – SÉcurité des Communications sur Intern<strong>et</strong>– SECI02<br />
Side channel cryptanalysis<br />
J-J. Quisquater & D. Samyde<br />
Université catholique de Louvain<br />
Groupe Crypto<br />
3 Place du Levant<br />
B-1348 Louvain la Neuve, Belgium<br />
jjq@dice.ucl.ac.be<br />
samyde@dice.ucl.ac.be<br />
Abstract<br />
Cryptology includes cryptography and cryptanalysis technics. Cryptography is managed by Kerckhoffs<br />
principles, so any information related to a cryptosystem can be public except the keys. The cryptanalysis<br />
is the sum of a lot of very advanced technics in order to find these keys. The controversy about the Data<br />
Encryption Standard security has highly contributed to the development of new cryptanalysis m<strong>et</strong>hods based<br />
on mathematics. The linear and differentials analysis are the most convincing examples. Although these<br />
techniques often require great quantities of plain texts and ciphered texts, there are other very powerful<br />
m<strong>et</strong>hods based on the involuntary "information leakage". Indeed a cryptosystem can leak information in<br />
various manners, thus significant data can be extracted from physical signals emitted by the ciphering device.<br />
Temperature, acoustic waves, electromagn<strong>et</strong>ic radiations, time or light (radiated, laser, infrared, . . . ) signs<br />
which can be extremely dangerous. It is then possible to define side channel. The side channel cryptanalysis<br />
has been the speciality of secr<strong>et</strong> services for a long time, but ten years ago, the scientific world started<br />
contributing to develop new side channel very effective technics.<br />
Keywords Side channel cryptanalysis, Tempest, Timing attack, Power & ElectroMagn<strong>et</strong>ic Analysis, Fault<br />
Analysis<br />
Introduction<br />
The history of the conventional cryptanalysis and the development of the most powerful computers are<br />
closely dependent. The undeniable proof is the brilliant cryptanalysis of the naval Enigma by A. Turing and<br />
both GHCQ’s Colossus at Bl<strong>et</strong>chley Park during the World War II. As conventional cryptanalysis side channel’s<br />
power can really be frightening, their successes remained in the shadow for a long time.<br />
In the past, the most advanced automats were based on mechanical principles that are well known today. But<br />
with the evolution of sciences, electricity become stronger and stronger, so electromechanic appeared and then<br />
electronic. Although the desired physical effects were advisely used as the principal component of a device,<br />
other parasitic effects can som<strong>et</strong>imes be neglected. In this case it is som<strong>et</strong>imes possible to extract significant<br />
information from the handled data [1].<br />
As a current runs through a wire, it creates an electric field, a magn<strong>et</strong>ic field as well as a heating. These<br />
effects are known and described by the Maxwell’s equations and the Joules’s law. But when some of these<br />
existing physical effects are not desired by the designer of the automata, they can create leakages. It is possible<br />
to remotely collect the electromagn<strong>et</strong>ic field with an adapted antenna, to reamplify it, and to do a demodulation<br />
in order to obtain information. In the case of a cathode ray tube or a computer screen, the pixel of the screen is<br />
obtained thanks to the projection of an electron beam on sensitive molecules. But the position of the electron<br />
beam is controlled by coils. If the radiated field is collected, amplified and then introduced at the input of other<br />
coils, it makes possible to copy the image of the remote screen.<br />
Concerning heat, some thermal cameras have a good resolution, they permit to construct a signature. These<br />
signature characterizes the device. The manufacturers of cryptoprocessors also try to limit the heat to reveal<br />
179
J-J. Quisquater & D. Samyde<br />
information on calculation in progress into their chip. The exhaustive list of the undesirable edge effects during<br />
the processing of a device can not be given here, however this article tries to point out the importance of<br />
side channel cryptanalysis and to draw up a list of the attacks most currently used against the cryptographic<br />
implementations.<br />
People often forg<strong>et</strong> to underline the important part played by the side channel in successful cryptanalyses.<br />
There are several manners to conceive cryptanalysis. The most conventional one consists in looking at<br />
the cryptographic primitives as a mathematical objects or an algorithm. Another one is interested in the<br />
implementation of the primitive in a ciphering device. It is then interesting to analyze the side channel obtained.<br />
A good side channel source is then inherent to the structure of the physical implementation. It is important to<br />
notice that it can considerably facilitate the work of a possible attacker.<br />
History<br />
Figure 1 : Information leakage by one of the designers of Arpan<strong>et</strong><br />
It is quite difficult to fix with precision the birth of the side channel cryptanalysis. But it would be false<br />
to think it was at the end of XXth century. It even seems this date is rather at the end of XIXth century or<br />
the whole beginning of XXth. The discovery of the existence of side channel obviously did not give place to<br />
publications and international communications.<br />
J. Maxwell establishes its theory on electromagn<strong>et</strong>ic waves in ������� . But at the end of the 19th century some<br />
cross talk problems in telephone links were mentioned. During the First World War, these coupling problems<br />
were used to spy communications. Information obtained was only copied on another media and then listened.<br />
The signal processing was non-existent in such interceptions.<br />
But in ���¥��� , H. Yardley and its team discovered that classified information could leak from electric<br />
materials. But this knowledge make it possible to find the handled secr<strong>et</strong>s. The data contained in a<br />
180
Side channel cryptanalysis<br />
cryptographic device modulated a signal on the tape of a close recording source. In the middle of the thirties, the<br />
study of the IBM typewriter indicated that the leakage of information was important and must be considered.<br />
Military people started to seriously consider this kind of leakage; and the various western armies paid great<br />
attention to limit the radiations on their sensitive devices at the time of the Second World War, particularly for<br />
the embedded oscillators. That did not prevent the communist’s Tel<strong>et</strong>ype from "being intercepted" in Berlin.<br />
Reception antennas were placed in close tunnels. During the fifties, the Chinese authorities also used acoustic<br />
techniques to spy embassies, whereas Russian sent microwaves on m<strong>et</strong>al bars contained in statues, in order<br />
to recover the acoustic waves of an American embassy. The creation of the NSA in ���¡ �� immediately gave<br />
a crucial importance to the recovery of the compromising signals. The word SIGINT which is the acronym<br />
of SIGnal INTelligence took all its meaning then. Using telephone wire as an antenna carried one of the first<br />
interceptions of electromagn<strong>et</strong>ic radiations out. In the future, this kind of technique continued to be applied<br />
successfully for data interceptions of some computer screens. It worked for at least a distance of several<br />
hundreds of kilom<strong>et</strong>ers. These first experiments were carried out with the M.I.T.<br />
The beginning of the great series of the American & NATO military standards for the limitation of the<br />
compromising electromagn<strong>et</strong>ic radiations and the use of shield appeared in the middle of the fifties. The<br />
American armies worried about this new threat and initiated the tempest program. At the beginning of the<br />
sixties, the Russian embassy and some French devices were spied in London, thanks to their electromagn<strong>et</strong>ic<br />
radiations. While demodulating the recovered signal correctly, English people managed to find classified<br />
information. This time the signal processing was introduced and continuously took an increasingly place in the<br />
future. One example is related to the cryptanalysis of a Russian code during the crisis of Cuba. The American<br />
Oxford interceptor succeeded in recovering the electromagn<strong>et</strong>ic radiations emitted by a Sovi<strong>et</strong> ciphering device<br />
located on the island. Moreover the American marine carried out that the measurement of the radiated noise<br />
make it possible to know the position of the rotors inside some cryptographic devices.<br />
The civils did not y<strong>et</strong> know a lot about the interception possibilities, as this kind of m<strong>et</strong>hods was still<br />
confidential. But quickly, at the beginning of the seventies, people mentioned cases of interferences b<strong>et</strong>ween<br />
some of their electronic materials. And the cases of young researchers playing music with their screen or their<br />
printer into a radio receiver or a device including a demodulation, were not isolated.<br />
However the uses of the side channel analysis continued to exist and the Kilderkin operation which consisted<br />
in the interception of the electromagn<strong>et</strong>ic emanations of the Russian embassy in Canada took place in the<br />
middle of the seventies. Quite at the same time, the Polish services were surprised spying Sovi<strong>et</strong> military<br />
material; once more time, the electromagn<strong>et</strong>ic radiations were blamed. This time, in fact, it was the power<br />
wire that was listened. In �����£¢ the NSA introduced the new concept of saf<strong>et</strong>y zone around a measurement<br />
point and it is the next year that IBM builded its first armored PC [2]. At the end of twenties, I. Murphy a.k.a<br />
Captain Zap published the first plans of tempest receivers, just after British television showed demonstrations<br />
on this subject. At this time, the French army started to be very interested in the development of a tempest<br />
chain, and the Bulgarian services used equipped trucks with hidden antennas to spy and to intercept military<br />
communications in Western countries. In nin<strong>et</strong>ies R. Anderson and M. Kuhn worked on the reduction of<br />
radiations and published new fonts. For healthy reasons, the manufacturers had to drastically reduce screen<br />
radiations. In �����¡¤ P. Kocher published his work based on timing measurement. Using the processing time<br />
of a cryptosystem, his timing attack, exploited by F. Koeune, make it possible to recover a ¥�¦¥ bits RSA<br />
private key with a few hundreds of thousands of samples in a few minutes, whereas the factorization of an<br />
equivalent number required several intensive months of processing. The work of P. Kocher and its team then<br />
concentrated on power and consumption analysis. He unleashed the full of differential measurements. Then the<br />
large banking accounts asked silicon founders to quickly find fast and effective solutions to solve this problem.<br />
During the last ten years, another analysis appeared, based on fault injection. The idea was very simple: if it<br />
was not possible to extract keys from the leakage, maybe was possible to disturb the processor during a critic<br />
processing.<br />
The history reports even cases where the sides channels were voluntary introduced in order to be able to<br />
recover the significant data easier thereafter. Finally, the cryptanalysis using side channel has developed more<br />
and more to become today one of the serious components for intelligence collection.<br />
181
J-J. Quisquater & D. Samyde<br />
Electromagn<strong>et</strong>ic leakage<br />
The electromagn<strong>et</strong>ic radiations can still be used nowadays against recent systems. The quality of the<br />
antennas is very important, and it is possible to find several kinds (logarithmic, planar...) of them. In the same<br />
way, the frequency stability of the local oscillators are necessary to obtain a good result; the best receivers<br />
authorize a precision of �¨§�©�� Hz, using phase locked loop.<br />
The level of classical countermeasures has been improved in a significant manner since few years. In the<br />
case of a cathode ray tube, it is difficult to obtain a valid interception farther than ten m<strong>et</strong>ers, using an old<br />
material. This distance and this level of radiations must be compared to the distances obtained by the satellites<br />
who listen two aligned antenna from the space.<br />
Nowadays, some information is public because it has been declassified. But the simple presence, or not, of<br />
electromagn<strong>et</strong>ic radiations is often enough to provide useful information to an attacker. Some systems recreate<br />
a false magn<strong>et</strong>ic field around them, in order to mask their presence or their radiations. However, the theorem<br />
of C. Shannon indicates that by repeating measurement, it becomes possible to remove the noise and to obtain<br />
a signal noise ratio as high as desired.<br />
Devices as smart cards use operative countermeasures to limit the number of executions. In the large<br />
majority of cases, the designers try to limit the level of radiations or to define a protection area in order to<br />
reduce the power of the signal. But some applications very often require a Faraday cage to be protected, and it<br />
is not always simple and possible to use one.<br />
Some recommendations, related to the level of attenuation of the Faraday screen rooms, seemed<br />
unexplainable in the past. Recent work of Mr. Kuhn, and other academics, seem to be able to explain the<br />
differences b<strong>et</strong>ween the attenuations required by the military and the civilians. Indeed, the military attenuations<br />
do not seem to leave any chance of interception, even with recent material, whereas the civil levels did not<br />
ensure this shielding quality.<br />
It is also important to notice that the light emitted by a screen, contains useful information which is the video<br />
signal. M. Kuhn recently published it is possible to reconstruct a video image starting from the luminosity of a<br />
distant screen.<br />
Timing attack<br />
One of the first attacks by measurement of the response time of a system, made it possible to reduce the<br />
number of tests, in order to find a password. This attack was particularly effective against the implementations<br />
of Unix. Indeed, if the comparison b<strong>et</strong>ween the password recorded and the password seized is carried out byte<br />
by byte on the basis of the first bit, and if the machine response was available at the first error, it was then<br />
possible to test all the bytes located in first position and to choose the one which had the longest response<br />
time. Indeed, this last was inevitably the good, since the response time lengthened corresponded to the time<br />
of comparison and erroneous response of the second byte. According to R. Moreno, this kind of analysis<br />
also functioned at the time of the bearing of a banking application since a Motorola processor, on a smart<br />
card including a processor Thomson. This attack has been applied by F Grieu. It is also possible to use the<br />
measurement of the response time, in order to know the contents of the mask of a distant data-processing waiter.<br />
Indeed, if the information is already present in the memory cache of the computer, and if it has to be load the<br />
response time is different.<br />
In �����¡¤ , P. Kocher published a rather theor<strong>et</strong>ical article, on the use of the measurement of time, to try to<br />
find cryptographic keys. Two years later, F. Koeune applied this analysis and showed how it was possible to<br />
defeat a naive implementation of the algorithm Square & Multiply for the modular exponentiation. There are<br />
only two possibilities of connection inside the code carried out for its demonstration, but these two connections<br />
do not take the same time. It is then possible to know rather quickly the cryptographic keys [3], with a few<br />
hundreds of thousands samples.<br />
Countermeasures against timing attacks may seem to be trivial, but a constant time answer is not always<br />
possible: som<strong>et</strong>imes it is necessary to consider the worst case of an algorithm, or to insert much more subtle<br />
countermeasures, modifying the temporal properties.<br />
182
Thermal analysis<br />
Side channel cryptanalysis<br />
The thermal analysis is not used a lot against cryptographic devices; it is more current for satellite or<br />
space image analysis. In many cases, the materials stationed at a place has modified the temperature or the<br />
illumination of the storage place. Even a long time after their departure, it is always possible to carry out a<br />
measurement revealing their very last presence.<br />
Concerning processors, the limiting factor is the diffusion of heat. The equation of propagation is wellknown,<br />
but the propagation times are crippling. However, it is important not to obtain hot points on the chip,<br />
in order not to reveal a specific activity [4]. In the past, the security components verifiers used liquid crystals<br />
to reveal the activity areas of the component. But actually this m<strong>et</strong>hod is too slow.<br />
Power analysis<br />
A small antenna inserted in a perforated condenser can provide a lot of information on the activity of<br />
an electronic card. This old technic is well known and has been used for a long time. An electronic card<br />
often contains few very interesting elements to analyze, by measuring their consumption. Inserting a low<br />
value resistance b<strong>et</strong>ween the ground pin and the general ground of the card, is enough to track the specific<br />
consumption of a chip. In the past, some people had already noticed that the power analysis of a cryptoprocessor<br />
could provide information on the handled keys. In ������� , P. Kocher [5] introduced the concept of differential<br />
power analysis; it is the intercorrelation value of two random variables. This m<strong>et</strong>hod called DPA is very<br />
powerful against smart cards and recent processors. Moreover, it is possible to improve the resolution, using<br />
a coil located in the close field of the processor [6,7]. The signal noise ratio can be greatly improved by ��§ to<br />
¢�§¡��� . IBM recently used this m<strong>et</strong>hod to defeat GSM card security. The algorithm used is simple in both cases:<br />
the idea is to quantify the influence of a bit of the key and to separate the traces obtained in two s<strong>et</strong>s. These s<strong>et</strong>s<br />
are built according to the value of one bit of the key. Then checking the assumption on the value of the key bit,<br />
the real value can be recovered.<br />
Conclusion<br />
In conclusion, side channel cryptanalysis is a powerful tool and can defeat some implementations of very<br />
robust and well suited algorithms. Perhaps in the future, others side channels will be discovered; but the<br />
real cost of the these attacks is increasing. In order to be immunated to a high number of cryptanalysis,<br />
implementations must now integrate a very high level of expertise. The countermeasures are always possible<br />
and available, but they must be well thought. It is easy to believe avoiding a side channel and in fact to become<br />
weaker from another one [8,9].<br />
It is an <strong>et</strong>ernal game b<strong>et</strong>ween robbers and policemen; for the moment cryptanalysts seems to be b<strong>et</strong>ter [10]<br />
than designers, but in the future it will undoubtedly quickly evolve.<br />
References<br />
[1] NACSIM 5000: Tempest Fundamentals, National Security Agency, Fort George G.Meade, Maryland. Feb<br />
1982. Partially declassified also available at http://cryptome.org/nacsim-5000.htm.<br />
[2] M. Kuhn and R. Anderson, Soft tempest: Hidden data transmission using electromagn<strong>et</strong>ic emanations,<br />
In D. Aucsmith, editor, Information Hiding, vol 1525 of Lecture Notes in Computer Science, pp 124-142.<br />
Springer-Verlag, 1998.<br />
[3] J. Kelsey, B. Schneier, D. Wagner, and C. Hall, Side Channel Cryptanalysis of Product Ciphers, in Proc.<br />
of ESORICS’98, Springer-Verlag, September 1998, pp. 97-110.<br />
[4] J-S. Coron, P. Kocher, and D. Naccache, Statistics and Secr<strong>et</strong> Leakage, Financial Cryptography 2000<br />
(FC’00), Lecture Notes in Computer Science, Springer-Verlag.<br />
183
J-J. Quisquater & D. Samyde<br />
[5] P. Kocher, J. Jaffe and B. Jun, Differential Power Analysis, In M. Wiener, editor, Advances in Cryptology<br />
- CRYPTO’99, vol. 1666 of Lecture Notes in Computer Science, pp. 388-397, Springer-Verlag, 1999.<br />
Also available at http://www.cryptography.com/dpa/Dpa.pdf.<br />
[6] K. Gandolfi, C. Mourtel and F. Olivier, Electromagn<strong>et</strong>ic analysis : concr<strong>et</strong>e results, In Koç, Naccache,<br />
Paar editors, Cryptographic Hardware and Embedded Systems, vol. 2162 of Lecture Notes in Computer<br />
Science, pp. 251-261, Springer-Verlag, 2001.<br />
[7] J.-J. Quisquater and D. Samyde, ElectroMagn<strong>et</strong>ic Analysis (EMA) Measures and Counter-Measures for<br />
Smart Cards, in I. Attali and T. Jensen, editors, E-Smart Smartcard Programming and Security, vol. 2140<br />
of Lecture Notes in Computer Science, pp. 200-210, Springer-Verlag 2001.<br />
[8] R. Anderson, M.Kuhn, Tamper Resistance - A Cautionary Note, Proc. of the Second USENIX Workshop<br />
on Electronic Commerce, USENIX Association, 1996.<br />
[9] O. Kommerling and M. Kuhn, Design principles for tamper-resistant smartcard processors, In Proc. of<br />
the USENIX Workshop on Smartcard Technology (Smartcard’99), pp. 9–20. USENIX Association, 1999.<br />
[10] E. Biham and A. Shamir, Power Analysis of the Key Scheduling of the AES Canditates, in Second<br />
Advanced Encryption Standard Candidate Conference, Rome, March 1999.<br />
184