# Verifying Zymkey Signatures against Public Key on AWS and other Devices

**URL:** <https://community.zymbit.com/t/verifying-zymkey-signatures-against-public-key-on-aws-and-other-devices/220>\
**Category:** ZYMKEY4\
**Tags:** aws-iot\
**Created:** [September 14, 2017, 12:23pm UTC](https://community.zymbit.com/t/verifying-zymkey-signatures-against-public-key-on-aws-and-other-devices/220 "2017-09-14T12:23:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzheng](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@jzheng](https://community.zymbit.com/u/jzheng)\
**Post date:** [September 14, 2017, 12:23pm UTC](https://community.zymbit.com/t/verifying-zymkey-signatures-against-public-key-on-aws-and-other-devices/220/1 "2017-09-14T12:23:27Z")

</div>

For the most recent documentation on verifying signatures, see [Zymbit’s Documentation Site](https://docs.zymbit.com/tutorials/aws-iot/verify-sigs/).

---

<div class="post-metadata">

**Author:** ![Phil\_S\_Zymbit\_1](https://avatars.discourse-cdn.com/v4/letter/p/45deac/32.png) [@Phil\_S\_Zymbit\_1](https://community.zymbit.com/u/Phil_S_Zymbit_1)\
**Post date:** [September 22, 2017, 6:10pm UTC](https://community.zymbit.com/t/verifying-zymkey-signatures-against-public-key-on-aws-and-other-devices/220/3 "2017-09-22T18:10:22Z")

</div>



---

<div class="post-metadata">

**Author:** ![crvinay1992](https://avatars.discourse-cdn.com/v4/letter/c/ecc23a/32.png) [@crvinay1992](https://community.zymbit.com/u/crvinay1992)\
**Post date:** [February 27, 2019, 8:15am UTC](https://community.zymbit.com/t/verifying-zymkey-signatures-against-public-key-on-aws-and-other-devices/220/4 "2019-02-27T08:15:21Z")

</div>

Instead of AWS, can I use another RaspberryPi 3 to decrypt the stored data. I am using Ethereum and IPFS for distributed storage.

---

<div class="post-metadata">

**Author:** ![dhieaz](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@dhieaz](https://community.zymbit.com/u/dhieaz)\
**Post date:** [May 7, 2019, 11:06am UTC](https://community.zymbit.com/t/verifying-zymkey-signatures-against-public-key-on-aws-and-other-devices/220/5 "2019-05-07T11:06:14Z")

</div>

> [@jzheng](#):
>
> Simple Signature Verification with Public Key

I just bought Zymkey. I tried to publish data to the cloud. But I got an error when signing the certificate. I tried also the code in the first part of this discussion and got the same error.

The error is:

Traceback (most recent call last):  
File “testECDSA.py”, line 6, in   
payload\_sig = zymkey.client.sign(encrypted\_payload)  
File “/usr/local/lib/python2.7/dist-packages/zymkey/module.py”, line 325, in sign  
sha256.update(src.encode(‘utf-8’))  
AttributeError: ‘bytearray’ object has no attribute ‘encode’

Any solution for that error?

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [May 9, 2019, 7:43am UTC](https://community.zymbit.com/t/verifying-zymkey-signatures-against-public-key-on-aws-and-other-devices/220/6 "2019-05-09T07:43:53Z")

</div>

It looks like the code snippet is incorrect. Things should work for you if you change line 6 from  
`data = bytearray('hello world!')`  
to  
`data = 'hello world!'`

---

<div class="post-metadata">

**Author:** ![gilbert](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@gilbert](https://community.zymbit.com/u/gilbert)\
**Post date:** [March 15, 2021, 7:54am UTC](https://community.zymbit.com/t/verifying-zymkey-signatures-against-public-key-on-aws-and-other-devices/220/7 "2021-03-15T07:54:18Z")

</div>

Hi, I had the same issue and when I use: data = ‘hello world!’ I get the following error:  
Traceback (most recent call last):

File “/home/admin/sig\_test.py”, line 5, in   
encrypted\_payload = zymkey.client.lock(data)  
File “/usr/local/lib/python3.7/dist-packages/zymkey/module.py”, line 230, in lock  
raise AssertionError(‘bad return code %d’ % ret)  
AssertionError: bad return code -2

---

<div class="post-metadata">

**Author:** ![Michelle\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michelle\_of\_Zymbit](https://community.zymbit.com/u/Michelle_of_Zymbit)\
**Post date:** [August 25, 2021, 5:24pm UTC](https://community.zymbit.com/t/verifying-zymkey-signatures-against-public-key-on-aws-and-other-devices/220/8 "2021-08-25T17:24:00Z")

</div>


