小心猪圈-CTF(Crypto)

题目:

R29kIGpvYjo1NzY1NkM2QzIwNjQ2RjZFNjUzQTRBMzU1ODQ3NTkzNjRBNDE0RTM1NTg0NzRCNDk0NDU0NEY1MjUzNTg0MTQ5NDQ0MjRGMzU1MTU4NTM0RjUzNTI0NzQ5MzQ1ODRCNTc1MjU0NEE0QTU1NDc0OTUzNDM1NzRGNEU0RDU2NTE1NTU0NTE0RDQ5NUE0NDRCMzY1MzUwNEU1NTM0NTc1NTU5NEM0RjQ5NDkzMzU3NEIzMzRDNTU0RjQyNTI1NzMyMzQ0MjU0NEQ0QTRDNTQ1MTM1NDQ0MzQ3NEEzNDQ4NDc1OTRDNEE0NzQ2MzI1NzQ1NTYzMzU5NDc0RTQ3NDY0RjM0NDQ1NzRENTY0NDU3NTczNTQ0NDU0OTM0NTk1ODRENTk1MzQ4NDc1NjM0NTc0NTMzNEE1QTQ3NDI1MzQ3MzI0RDRDMzI0RDVBNDk1NDMyNTA0OTNE

解密:

看这明文由大写小写字母和数字组成,熟悉的话很容易想到这是base64加密的

先用base64解密:

God job:57656C6C20646F6E653A4A35584759364A414E3558474B4944544F525358414944424F355158534F5352474934584B5752544A4A5547495343574F4E4D56515554514D495A444B3653504E55345755594C4F494933574B334C554F425257323442544D4A4C5451354443474A344847594C4A4746325745563359474E47464F3444574D56445757354445493459584D5953484756345745334A5A47425347324D4C324D5A49543250493D

这格式一看就是hex,转为字符:

Well done:J5XGY6JAN5XGKIDTORSXAIDBO5QXSOSRGI4XKWRTJJUGISCWONMVQUTQMIZDK6SPNU4WUYLOII3WK3LUOBRW24BTMJLTQ5DCGJ4HGYLJGF2WEV3YGNGFO4DWMVDWW5DEI4YXMYSHGV4WE3JZGBSG2ML2MZIT2PI=

解密后的文明看着像是base64,但试了才知道其实是base32,再解密:

Only one step away:Q29uZ3JhdHVsYXRpb25zOm9janB7emtpcmp3bW8tb2xsai1ubWx3LWpveGktdG1vbG5ybm90dm1zfQ==

解密后的明文开头:还差最后一步,马上就完全解出来了,这有小写字母的明文,用base64解密:

Congratulations:ocjp{zkirjwmo-ollj-nmlw-joxi-tmolnrnotvms}

这又是什么东西,提交了答案错误

原来它还用了猪圈密码:

密码表:

小心猪圈-CTF(Crypto)_第1张图片

规则:左对右,右对左

用python实现代码:

a='abcdefghistuv'
s='jklmnopqrwxyz'
t='ocjp{zkirjwmo-ollj-nmlw-joxi-tmolnrnotvms}'
f=[]
len=len(t)
for i in range(0,len):
    n=a.find(t[i])
    m=s.find(t[i])
    if n==-1 and m==-1:
        f.append(t[i])
    if n==-1 and m!=-1:
      f.append(a[m])
    elif m==-1 and n!=-1:
        f.append(s[n])
for i in range(0,len):
  print(f[i],end="")

解密后:flag{vbriasdf-fcca-edcs-aftr-xdfceiefxzdw}

还有其他的猪圈变种,规律需要自己看着明文来找

你可能感兴趣的:(猪圈)