I’m working on a Swift project and need to implement the traditional (non-elliptic) Diffie-Hellman key exchange. I’m aware that OpenSSL can be used for this, but I am looking for alternative methods in pure Swift.
Specifically, I have a few requirements and questions:
How can I perform the Diffie-Hellman key exchange in Swift without relying on OpenSSL?
Is it possible to manually input the parameters p (a prime number) and g (a generator)? If so, how can this be done?
Can the size of p be adjusted to different lengths such as 128, 256, or 512 bits?