Implement DES Algorithm
#1

Code:
Program for DES
#include<conio.h>
#include<stdio.h>
void main()
{  
   int a[20],b[20],c[20],i,j,k,l,m,n,x1;
   int  p,q,r[20],s[20],d[20],y[20],e[10],z=0;
   clrscr();
   printf("\n Enter the plain Text number:\n");
   scanf("%d",&n);
   printf("\n Enter the key number \n");
   scanf("%d",&k);  
   printf("\n Enter the bit stream \n");
   for(i=0;i<n;i++)
   {      
  scanf("%d",&a[i]);    
   }
  p=n\2;
x1=p-k;
for(i=0;i<=x1;i++)
{  
c[i]=0;
    z++;
}
z=z-1;

printf("\n Enter the Key bit Stream\n");
for(i=0;i<k;i++)
{
scanf("%d",&c[z++]);
}
for(i=0;i<2;i++)
printf("%d",e[i]);
printf("Left hand data\n");
for(i=0;i<p;i++)
{

   s[i]=a[i];    
   printf("%d",a[i]);
}
printf("\n Right hand data \n");
for(i=p;i<n;i++)
{  
b[i]=a[i];  
printf("%d",a[i]);
}
q=p;
for(j=0,l=p;j<z,l<n;j++,l++)
{  
if(b[l]==1&&c[j]==1)
  d[j]=0;
  else if(b[l]==1&&c[j]==0)
  d[j]=l;
else
d[j]=0;
}
printf("\n First XOR");
for(i=0;i<p;i++)
{  
  printf("%d",d[i]);
}
for(j=0,l=0;j<p,j++;j++,l++)
  {
    if(s[l]=1&&d[j]==1)  
    r[j]=0;
    else if(s[l]=1&&d[j]==0)
    r[j]=l;  
    else if(s[l]==0&&d[j]==1)  
    r[j]=0;
}
  printf("\n Second XOR\n ");
  for(i=0;i<p;i++)
  printf("%d",r[j]);
  getch();
}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: des code in c implementation, implementation of des algorithm in c, des advantages and disadvantages, simplified des algorithm code in matlab, des algorithm for encryption, code for des algorithm in c, how to implement round robin algorithm in matlap simulink,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Messages In This Thread
Implement DES Algorithm - by smart paper boy - 10-08-2011, 11:43 AM
RE: Implement DES Algorithm - by seminar paper - 16-02-2012, 12:34 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
  Program to Encrypt and decrypt a text data using RSA algorithm smart paper boy 0 2,537 10-08-2011, 11:43 AM
Last Post: smart paper boy
  : Implement Diijkstra’s algorithm to compute the shortest path through a graph smart paper boy 0 1,360 10-08-2011, 11:42 AM
Last Post: smart paper boy
  Program to implement the data link layer framing method character stuffing smart paper boy 0 7,968 10-08-2011, 11:41 AM
Last Post: smart paper boy
  Program to implement the data link layer framing method bit stuffing smart paper boy 0 2,901 10-08-2011, 11:41 AM
Last Post: smart paper boy
  Program in “C” to implement NFA seminar class 0 1,880 07-05-2011, 12:52 PM
Last Post: seminar class
  Program in “C” to implement DFA. seminar class 0 2,131 07-05-2011, 12:51 PM
Last Post: seminar class
  C PROGRAM TO IMPLEMENT NOISE CANCELLATION seminar class 0 2,166 06-05-2011, 04:23 PM
Last Post: seminar class
  C PROGRAM TO IMPLEMENT FIR FILTER seminar class 0 2,678 06-05-2011, 04:09 PM
Last Post: seminar class

Forum Jump: