This website works better with JavaScript.
Home
Explore
Help
Sign In
ChaO
/
WriteUps
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
added RSA decode script
master
Christopher Yu
5 years ago
parent
c4575216a4
commit
a484499bcf
1 changed files
with
22 additions
and
0 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+22
-0
TAMUCTF/Crypto/RSAaaay/decodrsa.py
+ 22
- 0
TAMUCTF/Crypto/RSAaaay/decodrsa.py
View File
@ -0,0 +1,22 @@
from
Crypto.Util.number
import
inverse
from
fractions
import
*
e
=
43
n
=
2531257
c
=
"
906851 991083 1780304 2380434 438490 356019 921472 822283 817856 556932 2102538 2501908 2211404 991083 1562919 38268
"
c
=
c
.
split
(
"
"
)
c
=
map
(
int
,
c
)
p
=
509
q
=
4973
phi
=
(
p
-
1
)
*
(
q
-
1
)
d
=
inverse
(
e
,
phi
)
m
=
[
]
for
i
in
c
:
m
.
append
(
pow
(
i
,
d
,
n
)
)
print
m
plain
=
[
103
,
105
,
103
,
101
,
109
,
123
,
83
,
97
,
118
,
97
,
103
,
101
,
95
,
83
,
105
,
120
,
95
,
70
,
108
,
121
,
105
,
110
,
103
,
95
,
84
,
105
,
103
,
101
,
114
,
115
,
125
]
flag
=
"
"
for
i
in
plain
:
flag
+
=
chr
(
i
)
print
"
Decoded flag :
"
,
flag
Write
Preview
Loading…
Cancel
Save