Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //CN LAB
- ======================================================================================================================
- 1) Write a program for error detecting code using CRC-CCITT (16- bits).
- //Server
- #include<stdio.h>
- int main()
- {
- int i,j,n=24,dw[24],cw[24],p[]={1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,1};
- printf("Enter the 8 bit data word in binary\n");
- for(i=0;i<8;i++)
- scanf("%d",&dw[i]);
- for(i=0;i<8;i++)
- cw[i]=dw[i];
- for(i=8;i<24;i++)
- cw[i]=0;
- for(i=0;i<8;i++)
- if(cw[i]==1)
- for(j=0;j<17;j++)
- cw[i+j]=cw[i+j]^p[j];
- for(i=0;i<8;i++)
- cw[i]=dw[i];
- printf("The final code word is \n");
- for(i=0;i<24;i++)
- printf("%d",cw[i]);
- return 0;
- }
- /*OUTPUT:
- Enter the 8 bit data word in binary
- 1 0 0 0 0 0 0 1
- The final code word is
- 100000011000000110101001
- */
- //Client
- #include<stdio.h>
- int main()
- {
- int i,j,r[24],cw[24],p[]={1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,1};
- printf("Enter the reviced code word in binary\n");
- for(i=0;i<24;i++)
- scanf("%d",&cw[i]);
- for(i=0;i<8;i++)
- r[i]=cw[i];
- for(i=0;i<8;i++)
- if(cw[i]==1)
- for(j=0;j<17;j++)
- cw[i+j]=cw[i+j]^p[j];
- for(i=0;i<24;i++)
- if(cw[i]!=0)
- {
- printf("Error in recived data\n");
- exit(0);
- }
- printf("The recived data word \n");
- for(i=0;i<8;i++)
- printf("%d",r[i]);
- printf(" is correct\n");
- return 0;
- }
- /*OUTPUT:
- 1)Enter the reviced code word in binary
- 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1
- The recived data word
- 10000001 is correct
- 2)Enter the reviced code word in binary
- 1 0 1 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1
- Error in recived data
- */
- ==========================================================================================================================
- 2) Write a program for Hamming code generation for error detection and correction.
- #include<stdio.h>
- int main()
- {
- int a0,a1,a2,a3,r0,r1,r2,s0,s1,s2;
- printf("Enter the 4 bit data word in binary\n");
- scanf("%d%d%d%d",&a3,&a2,&a1,&a0);
- r0=a2^a1^a0;
- r1=a2^a1^a3;
- r2=a3^a1^a0;
- printf("The final code word is \n");
- printf("%d %d %d %d %d %d %d\n",a3,a2,a1,a0,r2,r1,r0);
- printf("Enter the 7 bit code word in binary\n");
- scanf("%d%d%d%d%d%d%d",&a3,&a2,&a1,&a0,&r2,&r1,&r0);
- s0=a2^a1^a0^r0;
- s1=a2^a1^a3^r1;
- s2=a3^a1^a0^r2;
- if(!(s0||s1||s2))
- {
- printf("NO error\nRecived data word is \n");
- printf("%d %d %d %d",a3,a2,a1,a0);
- }
- else if((!s2)&&(s1)&&(s0))
- {
- printf("Error at a2 bit and corrected data word is ");
- printf("%d %d %d %d",a3,!a2,a1,a0);
- }
- else if((s2)&&(!s1)&&(s0))
- {
- printf("Error at a0 bit and corrected data word is ");
- printf("%d %d %d %d",a3,a2,a1,!a0);
- }
- else if((s2)&&(s1)&&(!s0))
- {
- printf("Error at a3 bit and corrected data word is ");
- printf("%d %d %d %d",!a3,a2,a1,a0);
- }
- else if(s0&&s1&&s2)
- {
- printf("Error at a1 bit and corrected data word is ");
- printf("%d %d %d %d",a3,a2,!a1,a0);
- }
- return 0;
- }
- /*OUTPUT:
- 1)Enter the 4 bit data word in binary
- 0 1 0 0
- The final code word is
- 0 1 0 0 0 1 1
- Enter the 7 bit code word in binary
- 1 1 0 0 0 1 1
- Error at a3 bit and corrected data word is 0 1 0 0
- 2)Enter the 4 bit data word in binary
- 0 1 0 0
- The final code word is
- 0 1 0 0 0 1 1
- Enter the 7 bit code word in binary
- 0 0 0 0 0 1 1
- Error at a2 bit and corrected data word is 0 1 0 0
- 3)Enter the 4 bit data word in binary
- 0 1 0 0
- The final code word is
- 0 1 0 0 0 1 1
- Enter the 7 bit code word in binary
- 0 1 1 0 0 1 1
- Error at a1 bit and corrected data word is 0 1 0 0
- 4)Enter the 4 bit data word in binary
- 0 1 0 0
- The final code word is
- 0 1 0 0 0 1 1
- Enter the 7 bit code word in binary
- 0 1 0 1 0 1 1
- Error at a0 bit and corrected data word is 0 1 0 0
- 5)Enter the 4 bit data word in binary
- 0 1 0 0
- The final code word is
- 0 1 0 0 0 1 1
- Enter the 7 bit code word in binary
- 0 1 0 0 0 1 1
- NO error
- Recived data word is
- 0 1 0 0
- */
- ==========================================================================================================================
- 3) Write a program for even / odd parity checking on binary data.
- #include<stdio.h>
- int main()
- {
- int dw[5],cw[5],i,p,s,ch;
- printf("Sender side\n");
- printf("Enter data word of 4 bits in binary\n");
- for(i=0;i<4;i++)
- scanf("%d",&dw[i]);
- printf("Enter your choice\n1.Even dataword\n2.Odd dataword\n");
- scanf("%d",&ch);
- switch(ch)
- {
- case 1:p=dw[0]^dw[1]^dw[2]^dw[3];
- dw[4]=p;
- printf("Code word is\t");
- for(i=0;i<5;i++)
- printf("%d\t",dw[i]);
- printf("\n\nReceiver side\n");
- printf("Enter code word of 5 bits in binary\n");
- for(i=0;i<5;i++)
- scanf("%d",&cw[i]);
- s=cw[0]^cw[1]^cw[2]^cw[3]^cw[4];
- if(s==0)
- {
- printf("Code word is received correctly\n");
- printf("Data word is\t");
- for(i=0;i<4;i++)
- printf("%d\t",cw[i]);
- printf("\n");
- }
- else
- printf("Code word is incorrect\n");
- break;
- case 2:p=dw[0]^dw[1]^dw[2]^dw[3];
- dw[4]=!p;
- printf("Code word is\t");
- for(i=0;i<5;i++)
- printf("%d\t",dw[i]);
- printf("\n\nReceiver side\n");
- printf("Enter code word of 5 bits in binary\n");
- for(i=0;i<5;i++)
- scanf("%d",&cw[i]);
- s=!(cw[0]^cw[1]^cw[2]^cw[3]^cw[4]);
- if(s==0)
- {
- printf("Code word is received correctly\n");
- printf("Data word is\t");
- for(i=0;i<4;i++)
- printf("%d\t",cw[i]);
- printf("\n");
- }
- else
- printf("Code word is incorrect\n");
- break;
- default:printf("Invalid choice\n");
- return 0;
- }
- return 0;
- }
- /* 1) Sender side
- Enter data word of 4 bits in binary
- 1 0 1 0
- Enter your choice
- 1.Even dataword
- 2.Odd dataword
- 1
- Code word is 1 0 1 0 0
- Receiver side
- Enter code word of 5 bits in binary
- 1 0 1 0 0
- Code word is received correctly
- Data word is 1 0 1 0
- 2)Sender side
- Enter data word of 4 bits in binary
- 1 1 0 1
- Enter your choice
- 1.Even dataword
- 2.Odd dataword
- 2
- Code word is 1 1 0 1 0
- Receiver side
- Enter code word of 5 bits in binary
- 1 1 0 1 0
- Code word is received correctly
- Data word is 1 1 0 1
- 3)Sender side
- Enter data word of 4 bits in binary
- 1 1 0 0
- Enter your choice
- 1.Even dataword
- 2.Odd dataword
- 1
- Code word is 1 1 0 0 0
- Receiver side
- Enter code word of 5 bits in binary
- 1 1 1 0 0
- Code word is incorrect
- 4)Sender side
- Enter data word of 4 bits in binary
- 1 1 1 0
- Enter your choice
- 1.Even dataword
- 2.Odd dataword
- 2
- Code word is 1 1 1 0 0
- Receiver side
- Enter code word of 5 bits in binary
- 1 1 0 0 0
- Code word is incorrect
- 5) Sender side
- Enter data word of 4 bits in binary
- 1 1 0 1
- Enter your choice
- 1.Even dataword
- 2.Odd dataword
- 3
- Invalid choice*/
- ==========================================================================================================================
- 4) Write a program to perform stuffing and destuffing on given information.
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- char a[50];
- int ch,i,j=0,k;
- printf("Enter your choice\n1.Stuffing\n2.Destuffing\n");
- scanf("%d",&ch);
- switch(ch)
- {
- case 1: printf("Enter data for stuffing\n");
- scanf("%s",a);
- for(i=0;i<strlen(a);i++)
- {
- if(a[i]=='0')
- j=0;
- if(a[i]=='1')
- j++;
- if(j==5)
- { for(k=strlen(a);k>i;k--)
- a[k+1]=a[k];
- a[i+1]='0';
- }
- }
- printf("The stuffed data is = %s\n",a);
- break;
- case 2:printf("Enter data for destuffing\n");
- scanf("%s",a);
- for(i=0;i<strlen(a);i++)
- {
- if(a[i]=='0')
- j=0;
- if(a[i]=='1')
- j++;
- if(j==5)
- { for(k=i+1;k<=strlen(a);k++)
- a[k]=a[k+1];
- j=0;
- }
- }
- printf("The destuffed data is = %s\n",a);
- break;
- default:printf("Invalid choice\n");
- }
- return 0;
- }
- /*OUTPUT:
- 1) Enter your choice
- 1.Stuffing
- 2.Destuffing
- 1
- Enter data for stuffing
- 11110111111011111
- The stuffed data is = 1111011111010111110
- 2)Enter your choice
- 1.Stuffing
- 2.Destuffing
- 2
- Enter data for destuffing
- 0011111010111110111
- The destuffed data is = 00111111011111111
- */
- ==========================================================================================================================
- 5) Write a program for distance vector algorithm to find suitable path for transmission.
- #include<stdio.h>
- struct node
- {
- int dist[20],from[20];
- }rt[10];
- int main()
- {
- int c[20][20],s,d,arr[20],n,i,j,s1,k,count=0;
- printf("Enter the number of nodes\n");
- scanf("%d",&n);
- printf("Enter the cost of each node\n");
- for(i=0;i<n;i++)
- for(j=0;j<n;j++)
- {
- scanf("%d",&c[i][j]);
- rt[i].dist[j]=c[i][j];
- rt[i].from[j]=j;
- }
- for(i=0;i<n;i++)
- {
- printf("Routing information of routing %d\n",i);
- printf("Source\tDestination\tVia\tCost\n");
- for(j=0;j<n;j++)
- printf("\n%d\t%d\t\t%d\t%d\n",i,j,rt[i].from[j],rt[i].dist[j]);
- }
- do
- {
- count=0;
- for(i=0;i<n;i++)
- for(j=0;j<n;j++)
- for(k=0;k<n;k++)
- if(rt[i].dist[j]>(c[i][k]+rt[k].dist[j]))
- {
- rt[i].dist[j]=rt[i].dist[k]+rt[k].dist[j];
- rt[i].from[j]=k;
- count++;
- }
- }while(count!=0);
- printf("\nAfter updating\n");
- for(i=0;i<n;i++)
- {
- printf("Routing information of router %d\n",i);
- printf("Source\tDestination\tVia\tCost\n");
- for(j=0;j<n;j++)
- printf("\n%d\t%d\t\t%d\t%d\n",i,j,rt[i].from[j],rt[i].dist[j]);
- }
- printf("Enter the source node\n");
- scanf("%d",&s);
- s1=s;
- printf("Enter the desination node\n");
- scanf("%d",&d);
- printf("The main cost from router %d to router %d = %d",s,d,rt[s].dist[d]);
- arr[0]=s;
- i=1;
- while(s!=d)
- {
- arr[i]=rt[s].from[d];
- s=rt[s].from[d];
- i++;
- }
- printf("The shortest path from router %d to router %d \n",s1,d);
- for(j=0;j<i-1;j++)
- printf("%d -->",arr[j]);
- printf("%d\n",arr[j]);
- return 0;
- }
- /*OOUTPUT:
- Enter the number of nodes
- 4
- Enter the cost of each node
- 0 2 4 9999
- 2 0 4 3
- 4 4 0 5
- 9999 3 5 0
- Routing information of routing 0
- Source Destination Via Cost
- 0 0 0 0
- 0 1 1 2
- 0 2 2 4
- 0 3 3 9999
- Routing information of routing 1
- Source Destination Via Cost
- 1 0 0 2
- 1 1 1 0
- 1 2 2 4
- 1 3 3 3
- Routing information of routing 2
- Source Destination Via Cost
- 2 0 0 4
- 2 1 1 4
- 2 2 2 0
- 2 3 3 5
- Routing information of routing 3
- Source Destination Via Cost
- 3 0 0 9999
- 3 1 1 3
- 3 2 2 5
- 3 3 3 0
- After updating
- Routing information of router 0
- Source Destination Via Cost
- 0 0 0 0
- 0 1 1 2
- 0 2 2 4
- 0 3 1 5
- Routing information of router 1
- Source Destination Via Cost
- 1 0 0 2
- 1 1 1 0
- 1 2 2 4
- 1 3 3 3
- Routing information of router 2
- Source Destination Via Cost
- 2 0 0 4
- 2 1 1 4
- 2 2 2 0
- 2 3 3 5
- Routing information of router 3
- Source Destination Via Cost
- 3 0 1 5
- 3 1 1 3
- 3 2 2 5
- 3 3 3 0
- Enter the source node
- 0
- Enter the desination node
- 3
- The main cost from router 0 to router 3 = 5The shortest path from router 0 to ro
- uter 3
- 0 -->1 -->3
- */
- ==========================================================================================================================
- 6) Write a program for congestion control using leaky bucket algorithm
- #include<stdio.h>
- int main()
- {
- int i,t,c,b[50],op,sum=0,s=0,m;
- printf("Enter the time in sec:");
- scanf("%d",&t);
- printf("\nEnter the capacity of bucket:");
- scanf("%d",&c);
- printf("\nEnter the incoming bandwidth:\nTime in sec\tBandwith in MBPS\n");
- for(i=0;i<t;i++)
- {
- printf("\n%d\t\t",i+1);
- scanf("%d",&b[i]);
- if((sum+b[i])<=c)
- sum+=b[i];
- else
- printf("\t packet %d is rejected",i+1);
- }
- printf("Enter the operate:");
- scanf("%d",&op);
- printf("\nOutput transfer of leaky bucket\nTime in sec\tBandwith in MBPS\n");
- m=sum/op;
- i=0;
- for(i=0;i<t;i++)
- {
- if(i<m)
- {
- printf("%d\t\t%d\n",i+1,op);
- s+=op;
- }
- else if(s<sum)
- {
- printf("%d\t\t%d\n",i+1,sum%op);
- s+=sum%op;
- }
- else
- printf("%d\t\t%d\n",i+1,0);
- }
- return 0;
- }
- /*OUTPUT:
- 1)Enter the time in sec:10
- Enter the capacity of bucket:30
- Enter the incoming bandwidth:
- Time in sec Bandwith in MBPS
- 1 12
- 2 3
- 3 2
- 4 0
- 5 50
- packet 5 is rejected
- 6 0
- 7 0
- 8 0
- 9 0
- 10 0
- Enter the operate:2
- Output transfer of leaky bucket
- Time in sec Bandwith in MBPS
- 1 2
- 2 2
- 3 2
- 4 2
- 5 2
- 6 2
- 7 2
- 8 2
- 9 1
- 10 0
- 2) Enter the time in sec:10
- Enter the capacity of bucket:40
- Enter the incoming bandwidth:
- Time in sec Bandwith in MBPS
- 1 15
- 2 10
- 3 0
- 4 0
- 5 5
- 6 1
- 7 0
- 8 0
- 9 0
- 10 2
- Enter the operate:3
- Output transfer of leaky bucket
- Time in sec Bandwith in MBPS
- 1 3
- 2 3
- 3 3
- 4 3
- 5 3
- 6 3
- 7 3
- 8 3
- 9 3
- 10 3
- */
- ==========================================================================================================================
- 7) Using TCP/IP sockets, write a client – server program to make the client send the file name and to make the server send back the contents of the requested file if present.
- //server.c
- #include<stdio.h>
- #include<string.h>
- #include<stdlib.h>
- #include<errno.h>
- #include<string.h>
- #include<fcntl.h>
- #include<sys/types.h>
- #include<sys/ioctl.h>
- #include<net/if_arp.h>
- #include<sys/socket.h>
- #include<unistd.h>
- #include<netinet/in.h>
- #include<netdb.h>
- #include<arpa/inet.h>
- #define MAX 25
- #define MAXBUFF 100
- int main()
- {
- int fd,n,b;
- char buf1[MAXBUFF], buf[MAX];
- int sersock,clisock;
- struct sockaddr_in seraddr,cli_info;
- socklen_t addr_size;
- sersock=socket(AF_INET,SOCK_STREAM,0);
- if(sersock!=-1)
- printf("socket created\n");
- else
- printf("socket not created\n");
- seraddr.sin_family=AF_INET;
- seraddr.sin_port=htons(2500);
- b=bind(sersock,(struct sockaddr*)&seraddr,sizeof(seraddr));
- if(b==0)
- printf("binded successfully\n");
- else
- printf("binding failed\n");
- listen(sersock,5);
- addr_size=sizeof(cli_info);
- clisock=accept(sersock,(struct sockaddr*)&cli_info ,&addr_size);
- n=read(clisock,buf,MAX);
- buf[n]='\0';
- printf("the filereceived by client is %s=\n",buf);
- fd=open(buf,0,O_RDONLY);
- if(fd<0)
- {
- printf("file open error\n");
- strcpy(buf,"file open error");
- n=strlen(buf);
- buf[n]='\0';
- write(clisock,buf,n);
- }
- while((n=read(fd,buf1,MAXBUFF))>0)
- {
- write(clisock,buf1,n);
- }
- printf("\n");
- close(clisock);
- return 0;
- }
- //client
- #include<stdio.h>
- #include<string.h>
- #include<stdlib.h>
- #include<errno.h>
- #include<string.h>
- #include<fcntl.h>
- #include<sys/types.h>
- #include<sys/ioctl.h>
- #include<net/if_arp.h>
- #include<sys/socket.h>
- #include<unistd.h>
- #include<netinet/in.h>
- #include<netdb.h>
- #define MAXBUFF 1000
- #define MAX 25
- int main()
- {
- int n,clisock,c;
- char buf1[MAXBUFF];
- char buffer[1024];
- socklen_t addr_size;
- struct sockaddr_in seraddr;
- clisock=socket(AF_INET,SOCK_STREAM,0);
- seraddr.sin_family=AF_INET;
- seraddr.sin_port=htons(2500);
- addr_size=sizeof(seraddr);
- c=connect(clisock,(struct sockaddr*)&seraddr,addr_size);
- printf("c=%d",c);
- if(c==0)
- printf("connected to server\n");
- else
- printf("connection failed\n");
- printf("enter the file name\n");
- scanf("%s",buffer);
- write(clisock,buffer,strlen(buffer));
- printf("file contents are\n");
- n=read(clisock,buf1,MAXBUFF);
- write(1,buf1,n);
- printf("\n");
- return 0;
- }
- /*OUTPUT:
- gcc ser.c
- ./a.out
- socket created
- binded successfully
- the filereceived by client is abc.txt=
- gcc cli.c
- ./a.out
- c=0connected to server
- enter the file name
- abc.txt
- file contents are
- hi hello
- */
- ==========================================================================================================================
- 9) Implement the program 7 using the FIFO IPC channels:
- //fifoserver.c
- #include<stdio.h>
- #include<sys/types.h>
- #include<sys/stat.h>
- #include<fcntl.h>
- #include<errno.h>
- #include<string.h>
- #include<stdlib.h>
- #include<unistd.h>
- #define FIFO1 "fifo1"
- #define FIFO2 "fifo2"
- #define PERMS 0666
- char fname[256];
- int main()
- {
- int readfd,writefd,fd;
- char buff[512];
- ssize_t n;
- if(mkfifo(FIFO1,PERMS)<0||mkfifo(FIFO2,PERMS)<0)
- {
- printf("cant create file\n");
- exit(0);
- }
- printf("waiting for connection request\n");
- readfd=open(FIFO1,O_RDONLY,0);
- writefd=open(FIFO2,O_WRONLY,0);
- printf("Connection Established.....\n");
- read(readfd,fname,255);
- printf("Client has requested the file %s\n",fname);
- if((fd=open(fname,O_RDWR))<0)
- {
- strcpy(buff,"File does not exist..\n");
- write(writefd,buff,strlen(buff));
- }
- else
- {
- while((n=read(fd,buff,512))>0)
- write(writefd,buff,n);
- }
- close(readfd);
- close(writefd);
- unlink(FIFO1);
- unlink(FIFO2);
- return 0;
- }
- //client
- #include<stdio.h>
- #include<sys/types.h>
- #include<sys/stat.h>
- #include<fcntl.h>
- #include<errno.h>
- #include<string.h>
- #include<stdlib.h>
- #include<unistd.h>
- #define FIFO1 "fifo1"
- #define FIFO2 "fifo2"
- #define PERMS 0666
- char fname[256];
- int main()
- {
- int readfd,writefd,fd;
- char buff[512];
- ssize_t n;
- if(mkfifo(FIFO1,PERMS)<0||mkfifo(FIFO2,PERMS)<0)
- {
- printf("cant create file\n");
- exit(0);
- }
- printf("waiting for connection request\n");
- readfd=open(FIFO1,O_RDONLY,0);
- writefd=open(FIFO2,O_WRONLY,0);
- printf("Connection Established.....\n");
- read(readfd,fname,255);
- printf("Client has requested the file %s\n",fname);
- if((fd=open(fname,O_RDWR))<0)
- {
- strcpy(buff,"File does not exist..\n");
- write(writefd,buff,strlen(buff));
- }
- else
- {
- while((n=read(fd,buff,512))>0)
- write(writefd,buff,n);
- }
- close(readfd);
- close(writefd);
- unlink(FIFO1);
- unlink(FIFO2);
- return 0;
- }
- /*OUTPUT:
- gcc fifoserver.c
- ./a.out
- waiting for connection request
- Connection Established.....
- Client has requested the file abc.txt
- gcc fifoclient.c
- ./a.out
- Trying to connect to server...
- Connection Established.....
- Enter the file name to request from server
- abc.txt
- Waiting for server to reply..
- Contents of the file are...
- hi hello
- */
- ==========================================================================================================================
- 10) Write a program for simple RSA algorithm to encrypt and decrypt the data.
- #include<stdio.h>
- #include<math.h>
- int phi,d,c,m,e,n;
- void encrypt()
- {
- int i,c=1;
- for(i=0;i<e;i++)
- c=c*m%n;
- c=c%n;
- printf("Encrypted data is = %d\n",c);
- }
- void decrypt()
- {
- int i,m=1;
- for(i=0;i<d;i++)
- m=m*c%n;
- m=m%n;
- printf("Decrypted data is = %d\n",m);
- }
- int main()
- {
- int p,q,s;
- printf("Enter two large numbers\n");
- scanf("%d%d",&p,&q);
- n=p*q;
- phi=(p-1)*(q-1);
- printf("phi(%d)=%d\n",n,phi);
- printf("Enter the exponent value\n");
- scanf("%d",&e);
- d=e;
- do
- {
- s=(d*e)%phi;
- d++;
- }while(s!=1);
- d=d-1;
- printf("Public key is {%d,%d}\n",e,n);
- printf("Private key is {%d,%d}\n",d,n);
- printf("Enter plain text\n");
- scanf("%d",&m);
- encrypt();
- printf("Enter the cipher text\n");
- scanf("%d",&c);
- decrypt();
- return(0);
- }
- /*OUTPUT:
- 1)Enter two large numbers
- 53
- 67
- phi(3551)=3432
- Enter the exponent value
- 47
- Public key is {47,3551}
- Private key is {3359,3551}
- Enter plain text
- 99
- Encrypted data is = 1793
- Enter the cipher text
- 1793
- Decrypted data is = 99
- 2) Enter two large numbers
- 67
- 71
- phi(4757)=4620
- Enter the exponent value
- 23
- Public key is {23,4757}
- Private key is {1607,4757}
- Enter plain text
- 69
- Encrypted data is = 610
- Enter the cipher text
- 610
- Decrypted data is = 69
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement