简单明了,问题就是用字符串str1经过运算生成一个新的字符串str2
现在按照结果和运算过程去逆出最开始的那个字符串,有原始的运算过程
代码是可运行的 问题就是如何用str3倒出str1对应的那一串呢
这个只是一个代码片段 我单独提出来的
#include <stdio.h>
#include <iostream>
using namespace std;
int main() {
// e8353bb721210db274dfce41052f1232
string str1 = "e;a60>9c1g2ce1531b67fe566;13619;";
string str2;
int key[6]={1,2,3,4,5,6};
int keyCount = sizeof(key)/sizeof(int);
int strCount = str1.length();
for(int i = 0; i < strCount; i++){
str2.append(1,str1[i]^(key[i%keyCount]));
}
cout<<str2<<endl;//-----d9b2588a2c7ed3674d75ea0079273789
//由字符串e8353bb721210db274dfce41052f123算出 str1
string str3("e8353bb721210db274dfce41052f1232");
for(int i = 0; i < strCount; i++){
// 如何倒算出字符串str1的值
}
return 0;
}
楼上的意思是一个数和同一个数异或两次结果就是他本身:
这样str3就和str1一样了。