Training: Crypto - Transposition I (Crypto, Training)
题目描述
It seems that the simple substitution ciphers are too easy for you.
From my own experience I can tell that transposition ciphers are more difficult to attack.
However, in this training challenge you should have not much problems to reveal the plaintext.
看来简单的替代密码对你来说太容易了。
根据我自己的经验,我可以说移位密码更难攻击。
但是,在这次培训挑战中,您应该不会有太多问题来揭示明文。
密文:oWdnreuf.lY uoc nar ae dht eemssga eaw yebttrew eh nht eelttre sra enic roertco drre . Ihtni koy uowlu dilekt oes eoyrup sawsro don:wn iffsfrgfba.a
解
仔细观察不难发现开头的单词是Wonderful,对比密文每两个字母及符合进行移位,自己可以手动解出明文也可以跑代码
这里给出C语言代码
#include<stdio.h>
#include<string.h>
int main()
{
char a[1000],temp;
int n,i,j;
gets(a);
//printf("%s\n",a);
n=strlen(a);
j=0;
for(i=0;i<n;i++){
if(j%2!=0)
{
temp=a[j];
a[j]=a[j-1];
a[j-1]=temp;
}
j++;
}
//printf("%d",n);
printf("%s\n",a);
}
得到关键信息