
 
network it is obvious that identity-based encryption 
suits ad hoc networks’ needs very well. It is like they 
were made for each other. Using identity-based 
cryptography for securing ad hoc networks is a 
lately preoccupation of researchers. An example can 
be found in Oliveira L.B.et al., 2007. A team from 
The University of Brazil had successfully 
implemented and tested a secure communication 
scheme for sensor networks based on Tate pairing 
and named TinyTate. The protocol developed 
focuses on the needs of resource constrained nodes, 
but this does not affect the generality of the 
implementation. 
What our team proposed was to develop a 
simulation environment where the use of identity-
based cryptography in ad hoc networks can be 
simulated and tested. The simulation of ad hoc 
routing protocols is very easy with the use of 
network simulators (like ns2), because ad hoc 
routing protocols implementations already exists. 
But simulating secure ad hoc networks is not as 
easy. This was the motivation of our work that tried 
to answer this issue. 
2 IDEA 
Imagine the scenario of a conference. When a 
conference is organized, several discussion topics 
are established, and for every one of the themes a 
separate room is assigned. People joining the 
conference can participate at discussions in all the 
rooms. This means that someone can arrive at the 
beginning and join discussion topic in room A. After 
an half an hour, say he or she gets bored and goes to 
room B. Then, after fifteen minutes, decides to go 
back to room A. And so on and so forth. A mobile 
ad hoc network would be the best solution to assure 
the communication between the laptops or the PDAs 
of the participants. But how can someone assure 
security? What are the characteristics of such a 
scenario? First of all, before the actual 
communication starts all the participants had arrived 
and all had checked in. After the conference began 
no one can check in anymore. Second, the security 
of communications has to be provided only for the 
duration of the conference, witch is a relative small 
time (several hours maybe). Third, once a person 
was selected for this conference, he of she cannot be 
excluded during the conference. 
The following security scheme can be proposed 
for such scenarios, based on the utilization of 
identity-based cryptography. At checking in, every 
attendant of the conference is provided with an IP, in 
order to access the ad hoc network of the 
conference. At the reception there is also the key 
generation center. After the IP is assigned to the 
participant’s device, it can ask the key generation 
center for the public variables needed for identity-
based computations. After it receives them, it can 
ask for its private key. The key generation center 
computes the participant’s private key based on the 
IP assigned to it and returns it. The private key is 
exchanged on a secure channel (for example 
Bluetooth) and the authentication of the requestor is 
made by physical contact. The participant will also 
receive a list of all the participants of the conference 
and their IP numbers. After all the participants check 
in, the key generation center, the only one that can 
generate the private keys is shutdown. So the 
participants can interchange secure messages based 
only on their IPs.  
3 IMPLEMENTATION 
When implementing all these in ns2, the work was 
divided in several steps. The first step was to 
determine how this security scheme can be 
implemented in ns2. The second step was to find an 
identity-based cryptography library that can be use 
with ns2 (this means that it had to be written in C or 
C++). The next step was the implementation of the 
objects involved (the key generation centre, the 
communicating nodes) through the implementation 
of the five needed algorithms (Boyen X., Martin L., 
2007): initialization of the key generation centre, 
generation of the private keys, generation of the 
public keys, and encryption of a message and 
decryption of a message. The last step was to test the 
implementation and to conclude future development 
directions. 
3.1  Security Scheme Implementation 
and Library Utilization 
With ns2, ad hoc networks can be simulated using 
specific objects that represent the nodes of the 
network. For these nodes, among other things, the 
name of the ad hoc routing protocol needs to be 
specified. Of course, ns2 does not contain an 
implementation for all the routing protocols known, 
but only for the most important ones like AODV, 
DSR, and TORA. To simulate traffic in ns2, an 
agent object must be attached to the nodes. The 
agent object can act as a source or as a destination 
for the communication packets. New agents can be 
SECRYPT 2009 - International Conference on Security and Cryptography
136