diff options
Diffstat (limited to 'doc/python')
-rwxr-xr-x | doc/python/rsa.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/python/rsa.py b/doc/python/rsa.py index 15ffcffa3..09ca22314 100755 --- a/doc/python/rsa.py +++ b/doc/python/rsa.py @@ -26,6 +26,9 @@ print plaintext == key signature = rsa_priv.sign(key, 'EMSA4(SHA-256)', rng) -key = key.replace('a', 'b') +print rsa_pub.verify(key, signature, 'EMSA4(SHA-256)') + +# Corrupt the signature, make sure it doesn't verify +signature = signature.replace(signature[0], '0') print rsa_pub.verify(key, signature, 'EMSA4(SHA-256)') |