# Zymkey4 problem with ECDH

**URL:** <https://community.zymbit.com/t/zymkey4-problem-with-ecdh/1551>\
**Category:** Uncategorized\
**Created:** [August 11, 2023, 8:58am UTC](https://community.zymbit.com/t/zymkey4-problem-with-ecdh/1551 "2023-08-11T08:58:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisCCF](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@ChrisCCF](https://community.zymbit.com/u/ChrisCCF)\
**Post date:** [August 11, 2023, 8:58am UTC](https://community.zymbit.com/t/zymkey4-problem-with-ecdh/1551/1 "2023-08-11T08:58:59Z")

</div>

I think Zymbit should consider to add example for key exchange like the use of ecdh.  
Now I get running error message with just calling

zymkey.client.ecdh(0,0)

Error from **init**.py line 936  
dc = (c\_ubyte \* derived\_key\_size).from\_address(derived\_key.value)  
TypeError: integer expected

I observed that dervied\_key.value is None.

What should I do share key for two pi with different zymkey4? Could anybody give me a piece of example in how to use ecdh?

Also the C/C++ API example is none… Why the bar in using Zymbit products is so “High”?

---

<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:** [August 12, 2023, 12:53am UTC](https://community.zymbit.com/t/zymkey4-problem-with-ecdh/1551/2 "2023-08-12T00:53:17Z")

</div>

@ChrisCCF The ZYMKEY4 does not support ECDH. From the API docs,

> Derive a key or a pre-master secret from an ECDH operation. (Supported Devices: HSM6, Secure Compute Module).

See this table for feature comparison.

> **[ZYMBIT - Secure Modular Hardware Products](https://www.zymbit.com/product-select/#compare)**
>
> Secure your distributed assets from real work exploits

---

<div class="post-metadata">

**Author:** ![ChrisCCF](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@ChrisCCF](https://community.zymbit.com/u/ChrisCCF)\
**Post date:** [April 10, 2024, 6:39am UTC](https://community.zymbit.com/t/zymkey4-problem-with-ecdh/1551/3 "2024-04-10T06:39:33Z")

</div>

Thanks to your reply.

I had been tried the zymkey 4i.

I notice that the API used in this module could mainly deal with local problem.

If I would like to establish a secure data exchange through network, I would need to use HSM6?

I read the spec from HSM6. It covered the whole pin out for raspberry pi. Does it mean it utlized all GPIO? Could I still use the GPIO for connecting other device with HSM6 on top?
