Post

RSA

  • Points: 8

Description

Decrypt this RSA message:

1
2
3
4
5
6
7
8
9
10
11
12
13
309117097659990665453
125675338953457551017
524099092120785248852
772538252438953530955
547462544172248492882
028215860448757441963
543018082275730030658
585936545563088067075
131807465077304821584

N= 783340156742833416191

E= 653

Solution

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from Crypto.Util.number import long_to_bytes

ct = [309117097659990665453,
125675338953457551017,
524099092120785248852,
772538252438953530955,
547462544172248492882,
28215860448757441963,
543018082275730030658,
585936545563088067075,
131807465077304821584]

N= 783340156742833416191

E= 653
# -------------------------------
p = 27789079547
q = 28188776653

phi = (p - 1) * (q - 1)

d = pow(E, -1, phi)

ans = long_to_bytes(pow(ct[0], d, N))

for i in range(1, len(ct)):
    ans += long_to_bytes(pow(ct[i], d, N))

print(ans)
1
b'Well done ! The password which validate this challenge is : 2if9g94yb   '

The flag is

1
W3C{2if9g94yb}
This post is licensed under CC BY 4.0 by the author.