#!/usr/bin/python3 ''' Verifies signature of a message using RSA public key (possibly generated with rsa_key_gen.py) Author: Tim Pierson, Dartmouth CS55, Winter 2021 Based Wenliang Du https://github.com/kevin-w-du/BookCode/tree/master/Public_Key_Cryptography Usage: python3 rsa_verify.py python3 rsa_verify.py public.pem signature.bin ''' from Crypto.Signature import pss from Crypto.Hash import SHA512 from Crypto.PublicKey import RSA import sys message = b'An important message' #same message used in rsa_sign.py if __name__ == '__main__': #usage check: make sure we got a filename to read if len(sys.argv) != 3: print("Usage: python3 rsa_verify.py