Diffie Hellman Key Exchange

Top  Previous  Next

"Diffie–Hellman key exchange is a specific method of exchanging cryptographic keys. It is one of the earliest practical examples of key exchange implemented within the field of cryptography. The Diffie–Hellman key exchange method allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure communications channel. This key can then be used to encrypt subsequent communications using a symmetric key cipher. [wikipedia]"

 

 

Using Cybele's ThinAPI library to perform a Diffie Hellman key exchange:

 

1. Add the Cybele.ThinAPI.dll to your application. It is available on the Demo application under the bin directory.

2. Create an object instance of the DHCypher class.

3. Call the Init method, sending the server address as argument. This method is responsible to negotiate the key with z/Scope Anywhere Server.

4. Call the EncodeStr method passing the data to be encrypted as argument of the method.

 

    c# example:

 

using Cybele.ThinAPI;

 

...

 

      DHCypher myDHCypher = new DHCypher();

       myDHCypher.Init("http://127.0.0.1:8023");

       authInfo = HttpUtility.UrlEncode(myDHCypher.EncodeStr(authInfo));

 

...

 

Sending encrypted data:

 

After performing the Diffie Hellman key exchange, the external application may send the encrypted data to z/Scope Anywhere Server proceeding it by an * symbol.

 

c# example:

 

using Cybele.ThinAPI;

 

...

       authInfo = "*" + authInfo;

 

...

 

The authentication information is then encrypted to be send to z/Scope Anywhere Server within the URL query string:

 

http://127.0.0.1:8023/asp/? + authInfo

 

Read more:

Apikey
Building the Query String
Using z/Scope Anywhere In-Memory Dictionary
Integrating a Login Macro
C# External Authentiation Demo
Web Authentication Provider