Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name:...

11
Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen

Transcript of Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name:...

Page 1: Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen.

Project 2.AExtending NS-2 to support

encryption/decryption

Date: 04/07/2005Course: CSCI 5931Name: Sam Tran

Tuan Nguyen

Page 2: Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen.

Extending NS-2 to support encryption/decryption

1. Abstract2. Approach3. How to add new security features in NS-24. General design encryption/decryption in NS-25. Implementation6. Simple demonstration7. Conclusion8. References

Page 3: Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen.

1. Abstract

Implementation of security on NS-2 is necessary in network simulation. However, currently, NS-2 does not support these features. Our project will aim to solve this issue.

Page 4: Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen.

2. Approach

• NS-2 is open source network simulation application.

• NS-2 currently supports IP protocol suite and various standard routing protocols for wire and wireless network.

• To add security functions. We have to modify/build new packet formats.

Page 5: Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen.

3. Add new security features in NS-2

• Define a new packet format.

• Derive new class from Agent class for processing this new packet format.

• Processing includes:– Encrypting function.– Decrypting function.– Message digest generation function.– E.t.c

Page 6: Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen.

4. General design flow for security packet in NS-2

Figure1: Steps to add new packet to NS-2 and testing results

Page 7: Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen.

5. Implementation

EncryptionCESAR cipher

Key=3

DecryptionCESAR cipher

Key=3

System console

System console

Enc

rypt

ed te

xt +

hash

va

lue

Pla

in te

xt

Enc

rypt

ed te

xt +

hash

va

lue

Dec

rypt

ed te

xt

Ack

now

ledg

emen

t

Ack

now

ledg

emen

t

Hash function

Hash function

Compare hashed value

Sender

Receiver

Figure 2: Logical design of the encryption/decryption system

Page 8: Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen.

• Hash function– Polynomial Algorithm.

• Encryption function– Input: String of plain text– Algorithm: CESAR cipher with pre-shared key of 3– Output: Encrypted text.

• Decryption function– Input: string of encrypted text– Algorithm: CESAR cipher with pre-shared key of 3– Output: decrypted text.

5. Implementation (cont.)

Page 9: Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen.

6. Simple demonstration

Figure 3: Outcome of simple demonstration script.

Page 10: Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen.

7. Conclusion

• The project shows a method to add security functions into NS-2.

• With this approach, we can build standard security components into NS-2 using industrial standard algorithm such as SHA-1, MD5 for hash function and DES,3DES and AES for encryption/decryption.

• Project can be extended to support asymmetric key encryption/decryption.

Page 11: Project 2.A Extending NS-2 to support encryption/decryption Date: 04/07/2005 Course: CSCI 5931 Name: Sam Tran Tuan Nguyen.

8. References

• Marc Greis (2005). Tutorial for the network simulator ns. Retrieved 3/28/05 from: http://www.isi.edu/nsnam/ns/tutorial/index.html

• Free Information Society (2005). Hash Table Class. Retrieved 4/4/05 from: http://www.freeinfosociety.com/computers/programs/cpp/hashtable.h

• Jess Garms, Daniel Somerfield (2001). Professional Java Security. ISBN 1-861004-25-7

• Hash function implemented in C++ with polynomial algorithm. Retrieved 4/14/05 from http://wikisource.org/wiki/Polynomial_hash_function