2015-01-03 20:47:39 -05:00

17 lines
252 B
Python

#!/usr/bin/env python
from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
from Crypto import Random
key = RSA.generate(1024)
text = 'abcdefgh'
hash = SHA256.new(text).digest()
print hash
signature = key.sign(hash, '')
print signature