From 64d264518a7c9c0cfa64e70e9f146d1e92e42523 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 2 Mar 2010 14:43:56 +0000 Subject: Corrupt signature instead of key in RSA example --- doc/python/rsa.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)') -- cgit v1.2.3