主题
最后登录1970-1-1
回帖0
精华
积分3
威望
RP
金钱 柯币
人气 ℃
注册时间2003-2-14
|
发表于 2006-3-23 17:39:36
|
显示全部楼层
回复: 一个简单的密码(已解)
我用计算机枚举暴力破解的~~~ ^_^
密码明文:shelock
密钥:UCAG
附破解程序:
===============================
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std ;
string key = "ACGU",s[8] = {"CUA","UCG","UCU","CUC","UAG","UGA","UUA","UAA"},t ;
int main()
{
int x,i,j,k ;
do{
t = "";
for(k = 0 ; k < 8 ; k++)
{
x = 0 ;
for(i = 0 ; i < 3 ; i++)
{
x*=4 ;
for(j = 0 ; j < 4 ; j++)
if(s[k] == key[j])
break ;
x += j ;
}
t += (char)x+'a' ;
}
cout << t << endl ;
}while(next_permutation(key.begin(),key.end()));
system("pause");
return 0 ;
} |
|