题目:
最近出现了一个奇葩观点,说性别都不一样,怎么能谈恋爱?为了证明这个观点错误,请大家证明异性是相吸的。 注意:得到的 flag 请包上 flag{} 提交
key:asadsasdasdasdasdasdasdasdasdasdqwesqf
密文:ἇ̀Ј唒ဃ塔屋䩘卖剄䐃堂ن䝔嘅均ቄ䩝
首先,我们审计题目,仅仅知道两个根本看不懂的东西,对异性的审计可以让我们联想到一种古典密码——异或。于是,我们将key和密文使用010 Editor转为二进制:
由此,我们可以进行编码,两者相同时取0,不同时取1。
#include<bits/stdc++.h>
using namespace std;
int main(){
char a[] = "0110000101110011011000010110010001110011011000010111001101100100011000010111001101100100011000010111001101100100011000010111001101100100011000010111001101100100011000010111001101100100011000010111001101100100011000010111001101100100011000010111001101100100011100010111011101100101011100110111000101100110";
char b[] = "0000011100011111000000000000001100001000000001000001001001010101000000110001000001010100010110000100101101011100010110000100101001010110010100110100010001010010000000110100010000000010010110000100011000000110010101000100011100000101010101100100011101010111010001000001001001011101010010100001010000011011";
int c[5000];
int m=strlen(a);
for(int i=1;i<=m;i++){
int a1=a[i];
int b1=b[i];
if(a1==b1)
c[i]=0;
else
c[i]=1;
}
for(int i=0;i<m;i++)
cout<<c[i];
return 0;
}
将其换算为十六进制:
flag{ea1bc0988992276b7f95b54a7435e89e}