0

The requirement is, there would be two devices(alice and bob)generates public and private keys using diffie hellman. public keys would get exchanged bewteen both the devices (alice and bob) and generate a secret key with their private keys.

This is for iOS, either in Objective C or Swift. I have tried with raorafat(GitHub code) and other source codes; however, no solution was really drawn for my requirement.

One thing if I share my public key to server how would server deal with my public key to generate symmetric key.

Pavan Kumar
  • 37
  • 10

1 Answers1

0

You can use Apple's CommonCrypto library from Swift. For example of using CCDH, see https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60118.50.1/test/CommonCrypto/CommonDHtest.c.auto.html

You can import it using

import CommonCrypto

in your Swift project.

John Doe
  • 2,225
  • 6
  • 16
  • 44