Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import os
- from Crypto.Util import number
- random.seed(os.getpid())
- def randfunction(N):
- # N is in bytes
- # pycrypto expects a string
- l = []
- while N > 0:
- l.append(chr(random.getrandbits(8)))
- N -= 1
- return "".join(l)
- p = number.getPrime(512, randfunction)
- q = number.getPrime(512, randfunction)
- n = p*q
Advertisement
Add Comment
Please, Sign In to add comment