# 几道密码题练习记录

### 0x01 上学期的知识

snipaste20180522_120232.png

snipaste20180522_120359.png

AMJINQ0M04IKLII1I74398K0099308L2LNL93I

SEBAFI0E04ACDAA1A74398C0099308D2DFD93A

### 0x02 这是新知识？

snipaste20180522_120746.png

snipaste20180522_120914.png

snipaste20180522_121042.png

snipaste20180522_121103.png

### 0x03 密码是8位弱密码

snipaste20180522_121245.png

snipaste20180522_121459.png

### 0x04 你知道的密码学

snipaste20180522_121620.png

NmSgNv{m09f718v9kr8gk7p66ncv38nr0i44640}

free software utility which allows you to find the most frequent phrases and frequencies of words non english language texts are supported it also counts number of words characters sentences and syllables also calculates lexical density and the key is virginia

SeBaFi{e09f718a9ca8ac7c66fca38fa0c44640}

snipaste20180522_121914.png

txt文件中题目描述：

n = 87924348264132406875276140514499937145050893665602592992418171647042491658461
e = 65537

hex(密文) = 0xbd26c0d83060811775e4beb2c9778fd9407d55c7c4aa47e216181be0a201e559

http://factordb.com/

n可以分解
275127860351348928173285174381581152299
319576316814478949870590164193048041239

d =10866948760844599168252082612378495977388271279679231539839049698621994994673
SeBaFi{RSA_is_easy}

snipaste20180522_122412.png

def egcd(a, b):
if a == 0:
return (b, 0, 1)
else:
g, y, x = egcd(b % a, a)
return (g, x - (b // a) * y, y)
def modinv(a, m):
g, x, y = egcd(a, m)
if g != 1:
raise Exception('modular inverse does not exist')
else:
return x % m

c=0xbd26c0d83060811775e4beb2c9778fd9407d55c7c4aa47e216181be0a201e559
n=87924348264132406875276140514499937145050893665602592992418171647042491658461
p=275127860351348928173285174381581152299
q=319576316814478949870590164193048041239
e=65537
d=modinv(e,(p-1)*(q-1))
#print (p-1)*(q-1)
print d
m=pow(c,d,n)
print hex(m)[2:len(hex(m))-1].decode('hex')

### 0x06 作者喜欢看RFC1421

snipaste20180522_122534.png

### 0x07 春秋战国

snipaste20180522_122800.png

Rivest Cipher 4

key welcometohere

### 0x08 题目都好难啊

snipaste20180522_123220.png

7.png

https://www.taringa.net/posts/tv-peliculas-series/19306900/Aprende-el-Alfabeto-Alienigena-de-Futurama.html

SeBaFi{alienmess}

### 0x09 我好菜啊

snipaste20180522_123405.png

p = 15424654874903
a = 16546484
b = 4548674875
G(6478678675,5636379357093)

k = 546768

(注意，大括号里面是x和y加起来求和，不是用加号连接)

https://www.yourhome.ren/index.php/sec/314.html

#coding:utf-8
#欧几里得算法求最大公约数
def get_gcd(a, b):
k = a // b
remainder = a % b
while remainder != 0:
a = b
b = remainder
k = a // b
remainder = a % b
return b

#改进欧几里得算法求线性方程的x与y
def get_(a, b):
if b == 0:
return 1, 0
else:
k = a // b
remainder = a % b
x1, y1 = get_(b, remainder)
x, y = y1, x1 - k * y1
return x, y

#返回乘法逆元
def yunsle(a,b):
#将初始b的绝对值进行保存
if b < 0:
m = abs(b)
else:
m = b
flag = get_gcd(a, b)

#判断最大公约数是否为1，若不是则没有逆元
if flag == 1:
x, y = get_(a, b)
x0 = x % m #对于Python '%'就是求模运算，因此不需要'+m'
#print(x0) #x0就是所求的逆元
return x0
else:
print("Do not have!")

mod=15424654874903
#mod=23
a=16546484
#a=1
b=4548674875
#b=1
G=[6478678675,5636379357093]
#G=[3,10]
#次数
k=546768
temp=[6478678675,5636379357093]
#temp=[3,10]
for i in range(0,k):
if i == 0:
aaa=(3*pow(G[0],2) + a)
bbb=(2*G[1])
if aaa % bbb !=0:
val=yunsle(bbb,mod)
y=(aaa*val) % mod
else:
y=(aaa/bbb) % mod
else:
aaa=(temp[1]-G[1])
bbb=(temp[0]-G[0])
if aaa % bbb !=0:
val=yunsle(bbb,mod)
y=(aaa*val) % mod
else:
y=(aaa/bbb) % mod

#print y
Rx=(pow(y,2)-G[0] - temp[0]) % mod
Ry=(y*(G[0]-Rx) - G[1]) % mod
temp=[Rx,Ry]
#print temp

print temp
snipaste20180522_123803.png

### 0x10 付费游戏

snipaste20180522_123908.png

498782e74580b57b

this is flag

32位MD5结果是

6f450d5d498782e74580b57b1bdd138e

16位MD5就是从32位中取中间16位而已

|
3月前
|

1067 试密码 （20 分）
1067 试密码 （20 分）
21 0
|
4月前

35 1
|
4月前
|
SQL 数据挖掘 数据处理
「SQL面试题库」 No_11 查找重复的电子邮箱
「SQL面试题库」 No_11 查找重复的电子邮箱
42 0
|

(leecode)密码检查

60 0
|

【刷题日记】398. 随机数索引

56 0
|
C++
C/C++ leetcode刷题的各种小tips记录
C/C++ leetcode刷题的各种小tips记录
126 0
|
SQL 数据库
leetcode--SQL例题+数据库面经（留个坑再填
leetcode--SQL例题+数据库面经（留个坑再填
53 0
|

93 0
|
SQL
leetcode 删除重复的电子邮箱

80 0