blob: 89dfd096e500749c15a98fc158a3ac05d504c367 [file] [log] [blame]
Sybren Stüvel454261b2008-04-23 13:22:44 +02001#!/usr/bin/python
2
3import sys
4import rsa
5
Sybren A. Stüvel4e167692011-01-09 12:56:08 +01006pub = {'e': 65537, 'n': 31698122414741849421263704398157795847591L}
7
8priv = {'d': 7506520894712811128876594754922157377793L,
9 'p': 4169414332984308880603L,
10 'q': 7602535963858869797L}
Sybren Stüvel454261b2008-04-23 13:22:44 +020011
12print "Running rsa.verify(verslag, pub)..."
13
Sybren A. Stüvel4e167692011-01-09 12:56:08 +010014crypto = open('verslag.crypt').read()
15verslag = rsa.verify(crypto, pub)
Sybren Stüvel454261b2008-04-23 13:22:44 +020016
17print "Decryption done, press enter to read"
18sys.stdin.readline()
19print verslag
20
21print "Generating public & private keypair for demonstrational purposes..."
Sybren A. Stüvel4e167692011-01-09 12:56:08 +010022(pub, priv) = rsa.newkeys(256)
Sybren Stüvel454261b2008-04-23 13:22:44 +020023
24print
25print "Public:"
26print "\te: %d" % pub['e']
27print "\tn: %d" % pub['n']
28print
29
30print "Private:"
31print "\td: %d" % priv['d']
32print "\tp: %d" % priv['p']
33print "\tq: %d" % priv['q']
34