[UTCTF2020]Curveball
题目
Curveball
My friend Shamir was trying to share the flag with me and some of the other problem writers, but he wanted to make sure it didn’t get intercepted in transmission, so he split it up. He said that the secrets that he shared will help us find the flag, but I can’t figure it out! These are the secrets I’ve gathered so far:
(C81E728D9D4C2F636F067F89CC14862C, 31E96A93BF1A7CE1872A3CCDA6E07F86)
(ECCBC87E4B5CE2FE28308FD9F2A7BAF3, ADF6E4F1052BDE978344743CCDCF5771)
(E4DA3B7FBBCE2345D7772B0674A318D5, 0668FBCFE4098FEA0218163AC21E6531)
Can you figure out which flag is the right one?
by balex
解题
意思是
我的朋友Shamir试图与我和其他一些问题作家分享这个flag,但他想确保它在传输过程中不会被截获,所以他把它分开。他说他分享的秘密会帮助我们找到flag,但我搞不懂!以下是我迄今为止收集到的秘密:
(C81E728D9D4C2F636F067F89CC14862C、31E96A93BF1A7CE1872A3CDA6E07F86)
(ECCBC87E4B5CE2FE28308FD9F2A7BAF3,ADF6E4F1052BDE978344743CCDCF5771)
(E4DA3B7FBBCE2345D7772B0674A318D5,0668FBCFE4098FEA0218163AC21E6531)
我们这道题已知三组的 ( x i , y i ) (x_i,y_i) (xi,yi),但是我们却没有大素数p
而且给出的数字不是十六进制,最有可能是MD5,用MD5解密得到
(2,5398141)
(3,5398288)
(5,5398756)
(好吧,有的数网站上没解出来,参考的大佬笔记)
然后用sage解
sage: x_0,y_0 = (2,5398141)
....: x_1,y_1 = (3,5398288)
....: x_2,y_2 = (5,5398756)
....: R.<x> = QQ[]
....: l_0 = ((x-x_1)/(x_0-x_1))*((x-x_2)/(x_0-x_2))
....: l_1 = ((x-x_0)/(x_1-x_0))*((x-x_2)/(x_1-x_2))
....: l_2 = ((x-x_0)/(x_2-x_0))*((x-x_1)/(x_2-x_1))
....: f_x = (y_0*l_0) +(y_1*l_1) + (y_2*l_2)
....: print(f_x)
得到
29*x^2 + 2*x + 5398021
这样就算出那个 F ( x ) F(x) F(x)了,
但是发现S的值5398021却并不是最后的flag,
yxx
题目
密文
V
0
0
0
明文
lovelovelovelovelovelovelovelove
解题
先用ASCII码转成十六进制密文:
0a031702560115110a140e0a1e300e0a1e300e0a1e30140c190a1f100e060318
然后用异或运算
a = 'lovelovelovelovelovelovelovelove'
b = [0x0A,0x03,0x17,0x02,0x56,0x01,0x15,0x11,0x0A,0x14,0x0E,0x0A,0x1E,0x30,0x0E,0x0A,0x1E,0x30,0x0E,0x0A,0x1E,0x30,0x14,0x0C,0x19,0x0D,0x1F,0x10,0x0E,0x06,0x03,0x18]
m = ''
for i in range(len(a)):
m+=chr(ord(a[i])^b[i])
print (m)
运行得到:flag:nctf{xor_xor_xor_biubiubiu}
答案
flag{xor_xor_xor_biubiubiu}