Use frequency analysis to decrypt the following message, which was encoded in th
ID: 3855885 • Letter: U
Question
Use frequency analysis to decrypt the following message, which was encoded in the 26-letter alphabet using a Vigenère cipher with a 3- letter key-word. Do this in the following way. To find the first letter of the key-word, work with the sequence consisting of every third letter starting with the first. Do not assume that the most frequently oc- curring letter is necessarily the ciphertext for "E". List the four most frequently occurring letters, and try out the possibility that each one in turn is the encryption of "E". If one of the other three frequently occurring letters would then have to be the encryption, say, of "Z" or "Q", then you know that you made a wrong choice for "E". By an elimination process, find the letter that must be "E" and then the key-word letter which produces that translation. In this way find the key-word and decipher the message: 2 Enciphering Matrices7 AWYVPQCTBLWYLPASQJWUPGBUSHFACELDLLDLWLBWAFAHS EBYJXXACELWCJTQMARKDDLWCSXBUDLKDPLXSEQCJTNWPR WSRGBCLWPGJEZIFWIMJDLLDAGCQMAYLTGLPPJXTWSGFRM VTLGUYUXJAIGWHCPXQLTBXDPVTAGSGFVRZTWTGMMVFLXR LDKWPRLWCSXPHDPLPKSHQGULMBZWGQAPQCTBAURZTWSHQ MBCVXAGJJVGCSSGLIFWNQSXBFDGSHIWSFGLRZTWEPLSVC VIFWNQSXBOWCFHMETRZXLYPPJXTWSGFRMVTRZTWHWMFTB OPOZXLYIMFPLVWYVIFWDPAVGFPJETQKPEWGCSSRGIFWBExplanation / Answer
#include<stdio.h>
void main()
{
char c;
int n,i,max=0,j,y;
int a[]={65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90};
scanf("%c",&c);
n=c;
for(i=0;i<5;i++)
{
int flag=0;
if(a[i]==n )
{
flag=1;
}
if(flag==1)
{
printf("%c",a[((i+1)*2)-1]);
break;
}
}
for(i=5;i<10;i++)
{
int flag=0;
if(a[i]==n )
{
flag=1;
}
if(flag==1)
{
printf("%c",a[(((i+1)%3)*5)-1]);
break;
}
}
for(i=10;i<15;i++)
{
int flag=0;
if(a[i]==n )
{
flag=1;
}
if(flag==1)
{
printf("%c",a[(((i+1)%4)*8)-1]);
break;
}
}
for(i=15;i<20;i++)
{
int flag=0;
if(a[i]==n )
{
flag=1;
}
if(flag==1)
{
printf("%c",a[((i+1)+10)-1]);
break;
}
}
for(i=15;i<26;i++)
{
int flag=0;
if(a[i]==n )
{
flag=1;
for(j=1;j<=(i+1)/2;j++)
{
if((i+1)%j==0)
{
if(max<j)
{
max=j;
}
}
}
}
if(flag==1)
{
y=(max*12)/6;
if(y>=0)
{
printf("%c",a[y-1]);
}
else
{
printf("#");
}
break;
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.