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

Office Address

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