~ /results
Evaluation · Results

Every run ends the same way: the keys match.

Representative outputs from the Diffie–Hellman system across live and numerical test scenarios, showing that parameter validation, key agreement and encryption/decryption all work.

3 scenariosDecryption OK = trueq = 23 · α = 5 · K = 2

Live mode: manual example#

Live mode with manually entered parameters

In manual live mode, users enter \( q \), \( \alpha \) and the message directly. The system validates each input before continuing.

After key generation and exchange, both participants derive the same shared key, then encrypt and decrypt the message successfully.

Observation

Matching decrypted output confirms successful shared-key derivation and correct message flow.

Live mode: invalid α#

Live mode rejecting an out-of-range alpha

This case verifies input validation. If a user provides \( \alpha \) outside the valid range \( 1 < \alpha < q \), the program rejects it and asks for a valid value.

Validation path

Validator and Helpers jointly enforce numeric and range constraints before any cryptographic computation.

Numerical example (fixed values)#

Fixed numerical example output

This test uses small values for transparent, step-by-step verification. The values match the console output above.

Parameter Value
Prime number \( q \) 23
Primitive root \( \alpha \) 5
Private key \( X_a \) 6
Private key \( X_b \) 15
Public key \( Y_a \) 8
Public key \( Y_b \) 19
Shared key \( K \) 2

Result verification

Both participants compute the same shared key, \( K = 2 \), and the message decrypts back to the original text.

DH vs ECDH comparison#

Venn diagram comparing DH and ECDH

This visual comparison places the project in broader context.

Summary

DH and ECDH both establish shared secrets. ECDH typically provides comparable security with smaller keys and improved efficiency.