# Non-numeric Diffie-Hellman?

It may seem that this is a programming question, but I just need advice on the cryptography side of the question. I want to implement the Diffie-Hellman key exchange algorithm on iOS (since no free library with easy integration exists). I'm wondering how the implementation would be if the parameters would be – for example – 128 bytes of data, instead of integers.

I'm looking for instructions so that I find out how I should implement it because performing such operations on non-integers is quite ambiguous to me.

Sorry if it's a newbie question, but I'm new to this concept.

Any suggestions is really appreciated.

• "I want to implement the Diffie-Hellman key exchange algorithm on iOS (since no free library with easy integration exists)."- Crypto++ (boost license) supports iOS and offers (EC)DH... (Disclaimer: I'm a helper with them). Commented Jan 19, 2016 at 10:02
• @SEJPM I compiled Crypto++ to use its methods for Diffie-Hellman key exchange. However there's not much about how to use crypto++ library with iOS SDK in the community, and most of the links inside Wiki and FAQ pages on Cryptopp website is broken and missing. I have no idea how to start. It would be great if we can chat a few minutes about some basic concepts on Crypto++. Commented Jan 22, 2016 at 11:00
• So go ahead and create a new chat room (on chat.stackexchange.com ) and post the link here. I'll join asap and be at your disposal (chances are good I'll be there within 3 hours and ping you) Commented Jan 22, 2016 at 16:17
• Thank you very much Looking forward to see you in the room : chat.stackexchange.com/rooms/34744/… Commented Jan 23, 2016 at 12:04

With Java for instance the conversion can be as easy as new BigInteger(1, data) where 1 indicates a positive integer and data is a byte array.
• Diffie Hellman does not rely on a mathematical problem of positive integers. It relies on a problem (CDH) in discrete log hard groups. It happens that among such groups (besides elliptic curve groups) are the multiplicative groups of prime fields of large prime characteristic $p$ and that are the integers from $1$ to $p-1$. Commented Jan 19, 2016 at 7:20