南邮ctf mysql_南邮ctf知识点汇总 - Crypto篇

这篇博客介绍了南邮CTF Crypto部分的解题技巧,涉及Base64解码、键盘顺序解密、异或操作、Wiener攻击等方法,通过实例展示了如何利用这些技术解决相关挑战,最后提到了简单的RSA分解和解密。
摘要由CSDN通过智能技术生成

easy!:

bmN0Znt0aGlzX2lzX2Jhc2U2NF9lbmNvZGV9

base64解码获得flag

import base64

encoded = "bmN0Znt0aGlzX2lzX2Jhc2U2NF9lbmNvZGV9"

base64.b64decode(encoded)

Keyboard:

按顺序在键盘上比划一下获得flag。。。

异性相吸:

提示说xor,直接xor明文密文获得flag

#coding=utf-8

encrypted=[]

with open("./biubiubiu/密文.txt".decode('utf-8')) as f:

while True:

c = f.read(1)

if not c:

break

encrypted.append(c)

plain=[]

with open("./biubiubiu/明文.txt".decode('utf-8')) as f:

while True:

c = f.read(1)

if not c:

break

plain.append(c)

flag=""

for i in range(len(encrypted)):

flag+=chr(ord(encrypted[i])^ord(plain[i]))

print flag

Wiener Wiener Chicken Dinner:

RSA wiener attack:

import math

def continued_fractions_expansion(numerator,denominator):#(e,N)

result=[]

divident=numerator%denominator

quotient=numerator/denominator

result.append(quotient)

while divident!=0:

numerator=numerator-quotient*denominator

tmp=denominator

denominator=numerator

numerator=tmp

divident=numerator%denominator

quotient=numerator/denominator

resu

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值