脑洞大开 密文简单破译
作者:互联网
“二八”分析得到十六进制,“爱死它”说明是ASCII码,再考虑移位。
代码如下
#include <stdio.h> #include <stdlib.h> void dec(char str[]); void main() { char code[61]; gets(code); dec(code); return 0; } void dec(char str[]) { int i = 0, next = 0; int after[30]; for (i = 0;i < 60;i+=2) { if (str[i] >= 48 && str[i] <= 57) { after[i / 2] = str[i] - 48; } if (str[i+1] >= 65 && str[i+1] <= 70) { next = str[i + 1] - 55; } if (str[i + 1] >= 48 && str[i + 1] <= 57) { next = str[i + 1] - 48; } after[i / 2] = after[i / 2] * 16 + next; } for (i = -74;i <= 74;i++) { for (next = 0;next < 30;next++) { printf("%c", after[next] + i); } printf("\n"); } }
最后选出最合适的
即 you very smart but you spent too time
标签:code,&&,void,大开,脑洞,char,str,密文,dec 来源: https://www.cnblogs.com/zhs06/p/16199489.html