How can I verify the signature on my lopy4 device?
-
For example, my signature is got by crypto.generate_rsa_signature.
My code isself.signature = crypto.generate_rsa_signature(self.computeHash(), key, pers="my_pers")and then how can I do to verify it?
-
My verify code is
def isValid(self): if self.comefrom == "": return True global public_sender # public key message_decrypted = crypto.rsa_decrypt(self.signature, public_sender) return self.computeHash() == message_decryptedAnd the function rsa_decrypt can only accept the parameter of a private key. If I use the public key it throws a ValueError:
Traceback (most recent call last): File "main.py", line 37, in <module> File "/flash/lib/blockChain.py", line 158, in addTransaction File "/flash/lib/blockChain.py", line 82, in isValid ValueError: Invalid private key, mbedtls error code: 0x3D00So I'm confused ...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login