Research breakthrough possible @S-Logix pro@slogix.in

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to apply symmetric cryptography in NS2?

Description

Message from the source to destination is sent in encrypted form. Input message is encrypted using the symmetric key and it is decrypted at the receiver using the same key. Encryption and decryption follows the symmetric cryptography algorithm.

Sample Code

#Filename: symmetric_Crypto.cc

Encryption() {

int key =brokey;
int i=0;
for (i=0;i<strlen(out);i++)
{
out[i]=(out[i]+key)%128;
}

Decryption () {
int key =brokey;
int i=0;
for (i=0;i<strlen(out);i++)
{
out[i]=(out[i]-key)%128;
}

data=out;

 

Screenshots

apply symmetric cryptography in NS2