summaryrefslogtreecommitdiff
path: root/runme.py
blob: 89dfd096e500749c15a98fc158a3ac05d504c367 (plain)
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
30
31
32
33
34
#!/usr/bin/python

import sys
import rsa

pub = {'e': 65537, 'n': 31698122414741849421263704398157795847591L}

priv = {'d': 7506520894712811128876594754922157377793L,
        'p': 4169414332984308880603L,
        'q': 7602535963858869797L}

print "Running rsa.verify(verslag, pub)..."

crypto = open('verslag.crypt').read()
verslag = rsa.verify(crypto, pub)

print "Decryption done, press enter to read"
sys.stdin.readline()
print verslag

print "Generating public & private keypair for demonstrational purposes..."
(pub, priv) = rsa.newkeys(256)

print
print "Public:"
print "\te: %d" % pub['e']
print "\tn: %d" % pub['n']
print

print "Private:"
print "\td: %d" % priv['d']
print "\tp: %d" % priv['p']
print "\tq: %d" % priv['q']