Digital Signatures Scheme

Follow these steps to generate and verify digital signatures using RSA and SHA-1 in the simulation.

⚙️ Step 1: Select RSA Key Pair

Start by selecting one key preset in Step 1 before signing.

  • Choose one of the four key buttons:
    • Load 1024-bit Key (e=F4)
    • Load 1024-bit Key (e=3)
    • Load 512-bit Key (e=F4)
    • Load 512-bit Key (e=3)
  • After selection, the simulation displays all active key parameters:
    • Public exponent e (hex)
    • Modulus n (hex)
    • Private exponent d (hex)
  • The Apply RSA Signature button remains disabled until a key is selected.
  • If you change the key after signing, previous signature output is invalidated and cleared automatically.

📝 Step 2: Enter Plaintext and Generate Hash

  • Enter your message in Plaintext (default: test).
  • Click Generate SHA-1 Hash.
  • Hash output (hex) is computed and displayed.
  • The same hash is auto-copied to the RSA input field used for signing.

🔑 Step 3: Input Hash to RSA and Sign

  • Confirm the auto-populated Input to RSA (hex) value.
  • Click Apply RSA Signature.
  • Signature generation uses the active key selected in Step 1.

✅ Step 4: View Digital Signature Results

Step 4 shows the signature and computation details:

  • Digital Signature (hex)
  • Digital Signature (base64)
  • Status message
  • Signature Computation panel showing the exact operation:
    • Signature = HashAsInteger^d mod n
    • With current numeric values substituted from the selected key and hash

🔍 Step 5: Verify Signature

Use Step 5 to verify and experiment with tampering.

  • Message for verification is pre-filled from the original message.
  • Signature to verify (hex) is pre-filled from the generated signature.
  • Click Verify Signature to compute and compare:
    • Computed H(m)
    • Recovered s^e mod n
    • Verification Result (Valid signature or Invalid signature)

To observe failure behavior:

  • Edit either the verification message or the signature hex.
  • Click Verify Signature again.
  • The result should become Invalid signature when values no longer match.

📊 Summary Section

The Digital Signature Summary updates automatically with:

  • Original Message
  • SHA-1 Hash
  • Key Size (active preset)
  • Signature Status

🔍 What This Demonstrates

  1. Hashing binds the signature to message content.
  2. Signing uses the private exponent d of the active key pair.
  3. Verification uses the public key values (n, e).
  4. Any message or signature tampering causes verification failure.

🔧 Troubleshooting

Issue What to check
Apply RSA Signature is disabled Select a key preset in Step 1 first
Signature cleared unexpectedly Key/message/hash was changed; regenerate signature
Verification shows Invalid signature Ensure message and signature are the same pair from Step 4
Empty/old summary values Regenerate hash/signature and verify again