Sobes.tech
Middle

How does electronic digital signature (EDS) work?

sobes.tech AI

Answer from AI

Digital signature (EDS) is a cryptographic mechanism that confirms the authenticity and integrity of an electronic document, as well as the identity of the signer.

The principle of EDS operation is based on using a pair of keys: a private (secret) key and a public key.

  1. The signer creates a signature using their private key, which depends on the content of the document (usually, the hash of the document is calculated first, then it is encrypted with the private key).
  2. The recipient can verify the signature using the signer's public key: decrypt it and compare it with the hash of the received document. If they match, it means the document has not been altered and is signed by the owner of the private key.

Thus, EDS provides:

  • Authenticity (the signature belongs to a specific person)
  • Integrity (the document has not been changed after signing)
  • Non-repudiation (the signer cannot deny the signature)

Example in pseudocode:

hash = sha256(document)
signature = encrypt_with_private_key(hash, private_key)

# Verification
hash_received = sha256(received_document)
hash_decrypted = decrypt_with_public_key(signature, public_key)
assert hash_received == hash_decrypted