Switch to full style
For C/C++ coders discussions and solutions
Post a reply

code hill cipher C++ Decrypt

Sun Mar 11, 2012 5:31 am

i want code hill cipher C++ Decrypt
cpp code
void main()
{
char c[10]={0},p[10],d[10]={0};
int i,l,k;
clrscr();
printf("Enter msg:");
gets(p);
printf("\n");
printf("Enter keysize:");
scanf("%d",&k);
puts(p);
for(i=0;i<10;i++)
{
if(p[i]>=65 && p[i]<=96)
{
c[i]=((p[i]-65+k)%26)+65;
}
else if(p[i]>=97 && p[i]<=122)
{
c[i]=((p[i]-97+k)%26)+97;
}
}
printf("\n");
puts(c);
for(i=0;i<10;i++)
{
if(c[i]>=65 && c[i]<=96)
{
if((c[i]-65-k)<0)
{
d[i]=c[i]-k+26;
}
else
{
d[i]=((c[i]-65-k)%26)+65;
}
}
else if(c[i]>=97 && c[i]<=122)
{
if((c[i]-97-k)<0)
{
d[i]=c[i]-k+26;
}
else
{
d[i]=((c[i]-97-k)%26)+97;
}
}
}
printf("\n");
puts(d);
getch();
}




Re: code hill cipher C++ Decrypt

Mon Feb 11, 2013 10:04 pm

updated.

Post a reply
  Related Posts  to : code hill cipher C++ Decrypt
 decrypt using the playfair cipher     -  
 playfair cipher assembly code     -  
 polyalphabetic cipher java code     -  
 Ceasar encryption-decryption-cipher-decipher code     -  
 Encryption and Decryption encryption Affine cipher code     -  
 Columnar Cipher & Playfair Cipher     -  
 Encrypt/Decrypt a file from source file to target file.     -  
 playfair cipher     -  
 Playfair Cipher technique     -  
 Polyalphabetic cipher technique     -  

Topic Tags

C++ Algorithms