hello

i have a simple client server program in which different paramters are asked by client. i want to use cryptographic techniques like DES, AES, RSA

but i do not know how and where to use.... i m doing socket programing first time even programing in linux. so i do not know linux functions and libraries and their usage.

i have this program in simple C langugae.

plz help me with this!!

Recommended Answers

All 3 Replies

hello

i have a simple client server program in which different paramters are asked by client. i want to use cryptographic techniques like DES, AES, RSA

but i do not know how and where to use.... i m doing socket programing first time even programing in linux. so i do not know linux functions and libraries and their usage.

i have this program in simple C langugae.

plz help me with this!!

Firstly , Sorry for late reply...

See you can create your own cryptographic techniques ... Simply by using bitwise operators in C like ... Bitwise OR , Bitwise and , Right Shift , Left Shift.......But that requires massive logic and a lot of time testing your program , debugging etc..etc... Or another way could be just simply creating a unique code for each letter...Like in the following example..

eg:-

#include<stdio.h>
#include<string.h>

int main()
{
	char data[] = { "Aneesh is here\n" } ;
	int i;
	//echo server side
	// enter data to send
	// Encrypt before sending data
	for( i = 0 ; i<=strlen(data) ; i++)
	{
		if(data[i] == 'A')
		{
			data[i] = 'z';
		}
		if(data[i] == 'n')
		{
			data[i] = 'p';
		}
	}
	printf("%s\n",data);
	// At client side
	// recieve the data
	// decrypt the data 
	for( i = 0 ; i<=strlen(data) ; i++)
	{
		if(data[i] == 'z')
		{
			data[i] = 'a';
		}	
		if(data[i] == 'p')
		{
			data[i] = 'n';
		}
	}	 
	printf("%s\n",data);
}

Hi iqra123

You may have a look into gnu C library. It contains fully DES Encryption, also MD5.

If you are only interested in putting some cipher on your data, there is a nice method by using pseudo random numbers:

sender side:
for all chars of message to send do
..compute random number with given random number generator
..add random number to char

send message to receiver

receiver side:
for all chars of message received
..compute random number with given random number generator
..subtract random number from char

Important: Sender and receiver must use a random number generator which generates
same sequence of random numbers. This can be controlled by the random number's seed.
Encryption with superposed random numbers is hardly to break.


>> lionaneesh

Imperator Julius Caesar's encryption/decryption cipher is really way too weak, even for Junior Ones.

-- tesu

hii

my problem is solved now any hows thanx lionaneesh and Tesuji for ur sugesstions and concern :-)

bye

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.