>>> from Crypto.Hash import MD5
>>> from Crypto.PublicKey import RSA
>>> from Crypto import Random
>>> rng = Random.new().read
>>> RSAkey = RSA.generate(384, rng) # This will take a while...
>>> hash = MD5.new(plaintext).digest()
>>> signature = RSAkey.sign(hash, rng)
>>> signature # Print what an RSA sig looks like--you don't really care.
('\021\317\313\336\264\315' ...,)
>>> RSAkey.verify(hash, signature) # This sig will check out
1
>>> RSAkey.verify(hash[:-1], signature)# This sig will fail
0
ä¸é¢çä¾åéè¦å®è£
pycrypto第ä¸æ¹åº