BUUCTF Crypto yxx wp

打开密文.txt发现基本上是不可见字符
在这里插入图片描述
然后再打开明文的txt
在这里插入图片描述
首先,用winhex打开密文txt文档查看不可见字符
在这里插入图片描述
我们发现,他这个位数刚好是两行,32位,再来查看明文.txt发现刚好也是32位字符,于是怀疑这道题是道一次性密码本OTP的题目,将明文与密文的txt一位一位异或即可得到flag

// python2
h=['0A','03','17','02','56','01','15','11','0A','14','0E','0A','1E','30','0E','0A','1E','30','0E','0A','1E','30','14','0C','19','0D','1F','10','0E','06','03','18']
l=['l','o','v','e','l','o','v','e','l','o','v','e','l','o','v','e','l','o','v','e','l','o','v','e','l','o','v','e','l','o','v','e','l','o','v','e','l','o','v','e']
for i in range(32):
    h[i]=int(h[i],16)
print(h)
#[10, 3, 23, 2, 86, 1, 21, 17, 10, 20, 14, 10, 30, 48, 14, 10, 30, 48, 14, 10, 30, 48, 20, 12, 25, 13, 31, 16, 14, 6, 3, 24]
res=""
for i in range(32):
    res+=chr(h[i]^ord(l[i]))
print(res)
#flag:nctf{xor_xor_xor_biubiubiu}
发布了22 篇原创文章 · 获赞 1 · 访问量 189

猜你喜欢

转载自blog.csdn.net/weixin_44017838/article/details/104887020