-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecryptTest.py
More file actions
25 lines (19 loc) · 1.32 KB
/
decryptTest.py
File metadata and controls
25 lines (19 loc) · 1.32 KB
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
"""
File: decryptTest.py
Created by Andrew Ingson (aings1@umbc.edu)
Date: 4/24/2020
CMSC 441 Intro to Algo
Notes: This file checks to see if the RSA is working correctly
"""
import gmpy2
def main():
print("Decrypt Test")
signature = 25660405584573360719592803989660882355920323616538194032029445921897631384417973212713260856982686330131538496643089868888722966099555149056730599775969354929043259101737456029599282530403149475863538316263009441157977617512734351937660180028689639772205975244323960175313317608922463267325748915788262194461
d = 89214912903862187406044069508919242220500694019514171683565525168529220658734778820359733928589936348802232912341804073702696922317830036011987393000287271297064167892437261357908908440879458348792563501925573713261517136660247282223085639842028765490280049715941411612520757640783800985732542654593035529985
n = 112142348133423149641910126652461551601614062372106721961445276438871831184769289185429358289117316707419769426831577996437409340556669359586436337701097625666583740357811368022551273841591331790315008987862664947946042032070418480266964766680874360045481008310457761239661944973234113604452759506774872149253
post = 1483182273414461829907973061615681
m = gmpy2.powmod(signature, d, n)
if m == post:
print("Success")
if __name__ == "__main__":
main()