0

RSA Algorithm using C

RSA Algorithm using C Language

You can also Download the Program code and corresponding output....
To Download the program in correct format
CLICK HERE 



#include
#include

int phi,m,n,e,d,c,flag;
int check()
{
int i;
for(i=3;e%i==0&φ%i==0;i+2)
{
flag=1;
return;
}
flag=0;
}


int encrypt()
{
   int i;
  c=1;
   for(i=0;i
   c=c*m%n;
     c=c%n;
   printf("\n\t Encrypted keyword is %d",c);
   return c;
}

void decrypt()
{

   int i;
   m=1;
   for(i=0;i
    m=m*c%n;
   m=m%n;
   printf("\n\t decrypted keyword is %d",m);
}
void main()
{
   int p,q,s;
   clrscr();
   printf("enter two relatively prime numbers");
scanf("%d%d",&p,&q);
   n=p*q;
  phi=(p-1)*(q-1);
  printf("\n\t f(n)\t=%d",phi);
   do
   {
   printf("\n\n Enter e\t");
     scanf("%d",&e);
     check();
  }while(flag==1);
   d=1;
  do
   {
   s=(d*e)%phi;
     d++;
   }while(s!=1);
   d=d-1;
  printf("\n\t Public key{ %d,%d}",e,n);
printf("\n\t Private key{%d,%d}",d,n);
  printf("\n\n Enter the plain text\t");
  scanf("%d",&m);
  encrypt();
  decrypt(c);
   getch();
}

0

Shutdown Windows XP in Different ways

There are so many different ways to turn off your Windows XP computer, let's look at some of them:

1)The standard approach - click the Start Button with your mouse, then select the Turn Off menu and finally click the Turn Off icon on the Turn Off computer dialog. blink.gif

2)Press Ctrl+Esc key or the Win key and press u two times - the fastest approach.


0

Gesture 3D Cube

gesture-cube-3d-interface.jpgGesture-controlling-cube-450x288.jpg

Gesture Cube uses 3D spatial movement tracking to help transform navigating a device into a magical intuitive experience.The underlying GestIC technology detects your hand`s approach and movements-your favourite apps and media at a wave of your hand.
0

Open Office 2010

The decade-old Open Office was the free and Open Source replication to Microsoft`s Office that has enriched it self in the office productivity suite segment.Originally a proprietary software application that was Open-Sourced  by Sun Micro systems,  Open Office has come a long way ,with the release of its new-improved version 3.2.Today, having crossed 300 million downloads-a third of this community project is among the most successful  stand-alone Open Source product.


0

Hidden Programs In Windows XP

1) Private Character Editor

This program is for designing icons and Characters(Alphapet)
Click :Start Menu
Then :Run
Type :EUDCEDIT



2) iExpress

This Program is for converting your files to EXECUTABLE files
Click : Start
Then : Run
Type : iexpress



3) Disk Cleanup

This program used for cleaning harddisk to offer space
cl!ck : start
Then : run
type : cleanmgr



4) Dr Watson

This program Is for repairing problems in Windows
cl!ck : start
Then : run
type : drwtsn32



0

Sony 3D TV

TH10_SONY_BRAVIA-TV__61012f 3D_01

Sony introduced 3D TV in India, which would prove to be the next big trend in the evolution of multimedia entertainment.Based on new LED technology, the new range of TVs also compatible with the internet and the company has exclusive tie-ups with some  of the content providers like ‘you tube’ to provide videos and clips.The company also announced the launch of new models under the popular Bra via brand,priced between Rs.45,900 and Rs.3.50-lakh.

0

Cyclic Redundency Check(CRC)

Cyclic Redundency Check is also known as CRC
Here the program in written in using C language


You can also Download the Program code and corresponding output....
To Download the program in correct format
Click Here

#include
#include
#include
void main()
{
int i,j,n,g,a,arr[20],gen[20],b[20],q[20],s;
clrscr();
printf("Transmitter side:");
printf("\nEnter no. of data bits:");


scanf("%d",&n);
printf("Enter data:");
for(i=0;i< n;i++)
scanf("%d",&arr[i]);

printf("Enter size of generator:");
scanf("%d",&g);
do
{
printf("Enter generator:");
for(j=0;j< g;j++)
scanf("%d",&gen[j]);

}
while(gen[0]!=1);
printf("\n\tThe generator matrix:");
for(j=0;j< g;j++)
printf("%d",gen[j]);
         a=n+(g-1);
printf("\n\tThe appended matrix is:");
for(i=0;i< j;++i)
arr[n+i]=0;
for(i=0;i< a;++i)
printf("%d",arr[i]);

for(i=0;i< n;++i)
q[i]= arr[i];
for(i=0;i< n;++i)
{
if(arr[i]==0)
{
for(j=i;j< g+i;++j)
arr[j] = arr[j]^0;
}
else
{
arr[i]=arr[i]^gen[0];
arr[i+1]=arr[i+1]^gen[1];
arr[i+2]=arr[i+2]^gen[2];
arr[i+3]=arr[i+3]^gen[3];
}
}
printf("\n\tThe CRC is :");
for(i=n;i < a;++i)
printf("%d",arr[i]);
s=n+a;
for(i=n;i< s;i++)
q[i]=arr[i];
printf("\n");
for(i=0;i< a;i++)
printf("%d",q[i]);
getch();
}
0

Broadcast Routing

Broadcast Routing using C language

You can also Download the Program code and corresponding output
to Download
Click here

/* Broadcast Routing */

#include
int a[10][10],n;
main()
{
 int i, j, root;
clrscr();
printf("Enter the no. of nodes:");
scanf("%d",&n);
printf("Enter the adjacent matrix \n");
for(i=1;i<=n;i++) 

 for(j=1;j<=n;j++) 
{

printf("Enter connecting of %d ----->%d::", i, j);
scanf("%d", &a[i][j]);
}

printf("Enter root node:");
scanf("%d",&root);
adj(root);
}
adj(int k)
{
int i,j;
printf("Adjacent node of root node:: \n");
printf("%d \n \n", k);
for(j=1;j<=n;j++)
{
if(a[k][j]==1 || a[j][k] ==1)
printf("%d \t",j);
}

printf("\n");
for(i=1;i<=n;i++)
{
if((a[k][j]==0) && (a[i][k] ==0) && (i!=k))
printf("%d",i);
}
}


0

Passport Studio

wdfmp-studio wdpassportstudioelabel
Western Digital has announced the availability of new My Passport Studio Portable HDD which features the FireWire 800 interface for speedy data transfer and customizable e-label utilizing the e-paper technology for better visibility if digital labels, which works even when the drive is unplugged.The device sports a stylish look, with an option of personalizing the drive with e-label showing your name or labeling it according to its content using the bundled smart ware software, the e-label also shows available space and whether it locked or not.


Features

0

DistanceVectorRouting

Distance Vector Routing



You can also Download the Program code and corresponding output
to Download
click here


#include
main()
{
int n,nadj,delay[15],i,j,k,distance[15][15],min,index;
int sum[15][15],suml[15],shortdelay[15];
char source,node[15],adj[15],finalnode[15];
clrscr();
printf("\n Enter the no of nodes\t");
scanf("%d",&n);
printf("\n Enter the names of the nodes:\t");
for(i=0;i<i

{
flushall();
node[i]=getchar();
}

printf(" \n Enter the source node \t");
flushall();
source=getchar();
printf("\n Enter the no of Adjacent nodes\t");
scanf("%d",&nadj);
printf("\n Enter the names of the adjacent nodes\t");
for(i=0;i
{ flushall();
adj[i]=getchar();
}
printf("\nEnter the delay of the nodes\t");
for(i=0;i
scanf("%d",&delay[i]);
printf("\n Enter the distances to all the nodes from the adjacent nodes");
for(i=0;i
{
for(j=0;j
{
scanf("%d",&distance[i][j]);
}
}
for(i=0;i
{
for(j=0;j
{
sum[i][j]=delay[i]+distance[i][j];
}
}
printf(" \n NODES \t\t ADJACENT NODES\t\t SHORT DELAY:");
k=0;
while(k!=n)
{
for(j=0;j
suml[j]=sum[j][k];
min=3200;
for(j=0;j
{
if(suml[j]
{
min=suml[j];
index=j;
}
}
finalnode[k]=adj[index];
shortdelay[k]=min;
k++;
}
for(i=0;i
{
printf("\n %c",node[i]);
if(node[i]==source)
{
printf("\t\t");
printf(0);
printf("\n");
}
else
{
printf("\t\t\t %c",finalnode[i]);
printf("\t\t\t %d",shortdelay[i]);
printf("\n");
}
}
getch();
}
1 comments

Bit Stuffing Character stuffing using C

This is a program on Bit stuffing and Character stuffing using C language

This program is used for Networking.
In this program it includes both bit and character Stuffing and Unstuffing.

Here is the program

The Total Program code will not be given here to Download the total file 
click here

#include
#include
#include
main()
{
int ch;
clrscr();
do
{
printf("\n");
printf("\n 1:bit stuffing \n 2:character stuffing \n 3.exit \n Enter u r choice \n");
scanf("%d",&ch);
switch(ch)
{
case 1:bit();
break;
case 2:character();
break;
case 3:exit(0);
}
}
while(ch!=3);
getch();
}
bit()
{
FILE *fp,*fp1;
char ch;
int i;
if((fp=fopen("source.txt","w"))==NULL)
{
printf("\n ERROR IN OPENING THE FILE");
exit(0);
}
printf("\n enter data to send press 'e' to end:\n");
i=0;
while(1)
{
scanf("%c",&ch);
if(ch=='e')
break;
if(ch=='1')
i++;
else
i=0;
putc(ch,fp);
if(i==5)
{
putc('0',fp);
i=0;
}
}
fclose(fp);
i=0;
fp=fopen("source.txt","r");
fp1=fopen("dest.txt","w");
printf("\n DATA AFTER STUFFING \n");
while((ch=getc(fp))!=EOF)
{
putc(ch,stdout);
}
fseek(fp,0L,0);
printf("\n DATA AFTER UNSTUFFING \n");
while((ch=getc(fp))!=EOF)
{
if(ch=='1')
i++;
else
i=0;
if(i==5)
{
putc(ch,stdout);
putc(ch,fp1);
ch=getc(fp);
i=0;
}
else
{
putc(ch,stdout);
putc(ch,fp1);
}
}
fclose(fp);
fclose(fp1);
}
character()
{
FILE *fp,*fp1;
char ch,c[2],k[4],j[9];
long beg,end;
if((fp=fopen("input.txt","w"))==NULL)
{
printf("\n inpur.txt file opening problem.....");
exit(0);
}
printf("\n enter data to send at end put '}':\n \n");
while(1)
{
scanf("%c",&ch);
if(ch=='}')
break;
putc(ch,fp);
}
fclose(fp);
if((fp=fopen("input.txt","r"))==NULL)
{
printf("\n input.txt file opening problem.....");
exit(0);
}
if((fp1=fopen("csource.txt","w"))==NULL)
{
printf("\n csource.txt file opening problem.....");
exit(0);
}
fputs(" DLE STX ",fp1);
printf("\n");
printf("\n DATA AFTER STUFFING \n");
while((ch=getc(fp))!=EOF)
{
if(ch=='D')
{
c[0]=getc(fp);
c[1]=getc(fp);
if(c[0]=='L'&&c[1]=='E')
fputs("DLE",fp1);
putc(ch,fp1);
putc(c[0],fp1);
putc(c[1],fp1);

}
else
putc(ch,fp1);
}
fputs(" DLE ETX ",fp1);
fclose(fp);
fclose(fp1);

if((fp=fopen("csource.txt","r"))==NULL)
{
printf("\n source.txt file opening problem.....");
exit(0);
}
if((fp1=fopen("cdest.txt","w"))==NULL)
{
printf("\n cdest.txt file opening problem.....");
exit(0);
}
beg=ftell(fp);
beg+=9;
fseek(fp,-0L,2);
end=ftell(fp);
end-=9;
fclose(fp);
fp=fopen("csource.txt","r");
while((ch=getc(fp))!=EOF)
putc(ch,stdout);
fclose(fp);
printf("\n");
printf("\n THE DATA AFTER UNSTUFFING \n");
fp=fopen("csource.txt","r");
fgets(j,9,fp);
while(beg



Output