Project on Network Security with Source Code
In fact! Our technical experts are providing the complete research support for the research scholars based on the projects in network security along with source code through this article.
Network security is considered as the protection of network and data from the intrusions, threats and breaches. It is considered as the overarching and vast term to describe the software and hardware solutions with the processes of rules and configurations that are related to the protection of accessibility, usage and threat in the network.
There are two notable dimensions to protect the system from malicious penetrations and attacks. One is about the protection of the keys over key management and the other one is about the strength of the keys and effective mechanism with the algorithms such as,
- Asymmetric key algorithms
- Symmetric key algorithms
- Hash functions
For your reference, we have highlighted the source code for network security based on network simulator 3.
#include
#ifndef HAVE_IPSEC
# error "Must #define HAVE_IPSEC in config.h"
#endif
#include "aes.hh"
#include "esp.hh"
#include
#include
#include
#include
#include
#include "sadatatuple.hh"
CLICK_DECLS
Aes::Aes()
: _op(0)
{
}
Aes::~Aes()
{
}
Aes::Aes(int decrypt)
{
_op = decrypt;
}
int
Aes::configure(Vector &conf, ErrorHandler *errh)
{
int dec_int;
_ignore = 12;/*This is the message digest*/
if (Args(conf, this, errh).read_mp("ENCRYPT", dec_int).complete() < 0)
return -1;
_op = dec_int;
return 0;
}
int
Aes::initialize(ErrorHandler *)
{
return 0;
}
Packet *
Aes::simple_action(Packet *p_in)
{
WritablePacket *p = p_in->uniqueify();
unsigned char hold[8];
struct esp_new *esp = (struct esp_new *)p->data();
SADataTuple * sa_data;
unsigned char iv[8];
unsigned char *ivp = esp->esp_iv;
unsigned char * idat = p->data() + sizeof(esp_new);
int plen = p->length() - sizeof(esp_new) - _ignore;
int i;
if ((plen % 16) != 0) { plen += 8; }
i = plen;
sa_data =(SADataTuple *)IPSEC_SA_DATA_REFERENCE_ANNO(p);
if (_op == AES_DECRYPT) {
memcpy(iv, ivp, 8);
if(sa_data==NULL) {
click_chatter("AES: No SADataTuple reference annotation. check man page\n");
p->kill();
return 0;
}
/*Set the Decrypt key*/
AES_set_decrypt_key((const unsigned char *)&sa_data->Encryption_key, 128, &_key);
} else {
if(sa_data==NULL) {
click_chatter("AES: No SADataTuple annotation. This module is not properly placed check man page\n");
p->kill();
return 0;
}
AES_set_encrypt_key((const unsigned char *)&sa_data->Encryption_key, 128,&_key);
}
#ifdef DEBUG
click_chatter("Key: %x%x%x%x%x%x%x%x",sa_data->Encryption_key[0], sa_data->Encryption_key[1],
sa_data->Encryption_key[2],
sa_data->Encryption_key[3],sa_data->Encryption_key[4],
sa_data->Encryption_key[5], sa_data->Encryption_key[6],
sa_data->Encryption_key[7]);
#endif
// de/encrypt the payload
while (plen > 0) {
if(_op == AES_DECRYPT) {
memcpy(hold, idat, 8);
AES_decrypt((const unsigned char *)idat, (unsigned char *)idat, (const AES_KEY *)&_key);
/* CBC: XOR with the IV */
for (i = 0; i < 8; i++)
idat[i] ^= ivp[i];
memcpy(ivp, hold, 8);
} else {
/* CBC: XOR with the IV */
for (i = 0; i < 8; i++)
idat[i] ^= ivp[i];
AES_encrypt((const unsigned char *)idat, (unsigned char *)idat,&_key);
ivp = idat;
}
idat += 16;
plen -= 16;
}
if (_op == AES_DECRYPT)
memcpy(ivp, iv, 8);
return(p);
}
Now, you guys can just begin to implement the projects on network security along with source code by your own and hit us through numerous platforms if assistance required.