Digital Signature Generator & Verifier Online | RSA-PSS & ECDSA
Digital Signatures How It Works
What Are Digital Signatures?
A digital signature is a cryptographic proof that a message was created by a specific sender (authenticity) and has not been altered (integrity). The signer uses their private key to create a signature; anyone with the corresponding public key can verify it. Digital signatures are the foundation of code signing, secure communications, and blockchain transactions.
This tool creates and verifies digital signatures entirely in your browser. It supports two algorithm families — RSA (PSS and PKCS#1 v1.5 padding) and ECDSA (P-256, P-384, P-521, secp256k1). RSA-PSS is the recommended RSA padding scheme with a formal security proof; ECDSA offers smaller keys and faster operations at equivalent security levels, and is the standard for TLS 1.3 and JWT.
When to Use Digital Signatures
- Code signing — Prove that software updates come from the legitimate developer
- Document signing — Sign PDFs, contracts, and legal documents electronically
- JWT authentication — Sign JSON Web Tokens for API authentication (RS256, ES256, PS256)
- Blockchain transactions — Sign cryptocurrency transactions (secp256k1 ECDSA)
- Secure messaging — Verify message authenticity in encrypted communications
- When NOT to use — Digital signatures prove authenticity, not confidentiality; combine with encryption for both properties
Algorithm Comparison
| Algorithm | Key Size | Signature Size | Speed | Best for |
|---|---|---|---|---|
| RSA-PSS | 2048-4096 bit | 256-512 bytes | Slower | Legacy compatibility, code signing |
| RSA PKCS#1 v1.5 | 2048-4096 bit | 256-512 bytes | Slower | Older standards, X.509 certificates |
| ECDSA P-256 | 256 bit | 64 bytes | Fast | TLS 1.3, JWT ES256, modern protocols |
| ECDSA P-384 | 384 bit | 96 bytes | Fast | Government, payment, JWT ES384 |
| ECDSA secp256k1 | 256 bit | 64 bytes | Fast | Bitcoin, Ethereum, blockchain |
Standards Compliance
- NIST FIPS 186-5 — Digital Signature Standard (DSS) — RSA and ECDSA specifications
- RFC 8017 — PKCS #1: RSA Cryptography Specifications (RSA-PSS, PKCS#1 v1.5)
- RFC 6090 — Fundamental Elliptic and Elliptic Curve Cryptography
- SEC 1 / SEC 2 — Standards for Efficient Cryptography (ECDSA, secp256k1)
- Web Crypto API — W3C standard for browser-based signature operations
Last updated:
Code Examples
Sign and verify data in multiple languages:
JavaScript — Web Crypto API (Browser)
// ECDSA P-256 sign & verify
const keyPair = await crypto.subtle.generateKey(
{ name: 'ECDSA', namedCurve: 'P-256' }, true, ['sign', 'verify']
);
// Sign
const data = new TextEncoder().encode('message to sign');
const signature = await crypto.subtle.sign(
{ name: 'ECDSA', hash: 'SHA-256' }, keyPair.privateKey, data
);
// Verify
const isValid = await crypto.subtle.verify(
{ name: 'ECDSA', hash: 'SHA-256' }, keyPair.publicKey, signature, data
);
console.log('Signature valid:', isValid); Python — cryptography library
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import ec
private_key = ec.generate_private_key(ec.SECP256R1())
message = b"message to sign"
# Sign
signature = private_key.sign(message, ec.ECDSA(hashes.SHA256()))
# Verify
public_key = private_key.public_key()
public_key.verify(signature, message, ec.ECDSA(hashes.SHA256()))
print("Signature valid") Go — crypto/ecdsa
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/sha256"
)
privateKey, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
message := []byte("message to sign")
hash := sha256.Sum256(message)
// Sign
signature, _ := ecdsa.SignASN1(rand.Reader, privateKey, hash[:])
// Verify
valid := ecdsa.VerifyASN1(&privateKey.PublicKey, hash[:], signature) Rust — p256 crate
use p256::ecdsa::{SigningKey, VerifyingKey, Signature, signature::Signer};
let signing_key = SigningKey::random(&mut rng);
let verifying_key = VerifyingKey::from(&signing_key);
// Sign
let message = b"message to sign";
let signature: Signature = signing_key.sign(message);
// Verify
use p256::ecdsa::signature::Verifier;
assert!(verifying_key.verify(message, &signature).is_ok()); Node.js — crypto module
const { createSign, createVerify, generateKeyPairSync } = require('crypto');
const { publicKey, privateKey } = generateKeyPairSync('ec', {
namedCurve: 'P-256'
});
// Sign
const sign = createSign('SHA256');
sign.update('message to sign');
const signature = sign.sign(privateKey, 'base64');
// Verify
const verify = createVerify('SHA256');
verify.update('message to sign');
const isValid = verify.verify(publicKey, signature, 'base64');
console.log('Signature valid:', isValid); Common Pitfalls
Security Notes
Disclaimer
This tool is provided for educational and development purposes. All signing and verification happens entirely in your browser using the native Web Crypto API and the audited @noble/curves library. For high-value production signing (code-signing certificates, financial transactions), use a hardware security module (HSM).
Further Reading
- NIST FIPS 186-5 — Digital Signature Standard
- RFC 8017 — PKCS #1: RSA Cryptography Specifications
- SEC 1: Elliptic Curve Cryptography
- RFC 6090 — Fundamental Elliptic and Elliptic Curve Cryptography
Related Concepts
- ECC Key Generator — Generate standalone ECC keys for signing
- Ed25519 Sign/Verify — Modern EdDSA signatures (faster, smaller)
- JWT Signature Verifier — Sign and verify JSON Web Tokens
Related Tools
Need to generate standalone ECC keys for use outside this demo? Try the ECC Key Generator. For Ed25519 signatures (faster, smaller), see the Ed25519 Sign/Verify tool. You can also parse the resulting PEM keys with the PEM Certificate Parser.
Frequently Asked Questions
Which signature algorithm should I choose?
For new projects, use ECDSA with P-256 and SHA-256 — it is the standard for TLS 1.3, JWT ES256, and most modern protocols. If you need compatibility with older systems, RSA-PSS with SHA-256 is the safest RSA option. Avoid RSA PKCS#1 v1.5 for new designs unless a specific standard requires it. This tool lets you generate a test key pair with one click so you can try each algorithm before committing.
What key formats are supported?
For RSA: PKCS#8 private key (BEGIN PRIVATE KEY) and SPKI public key (BEGIN PUBLIC KEY) — the standard PEM formats produced by OpenSSL and every key generator on this site. For ECDSA: the same PKCS#8 / SPKI PEM formats, plus raw hex (scalar for private keys, uncompressed point for public keys). Use the Generate button above the private-key field to create a fresh pair instantly.
Is it safe to sign data here?
All signing and verification happens entirely in your browser using the native Web Crypto API (for RSA and NIST curves) and the audited @noble/curves library (for secp256k1). No private key or data ever leaves the page. For development and testing this is perfectly adequate. For high-value production signing — code-signing certificates, financial transactions — use a hardware security module (HSM) so the private key never exists in software.
Why does my ECDSA signature look different from OpenSSL output?
This tool encodes ECDSA signatures as raw r‖s bytes (fixed-length, concatenated) wrapped in Base64 or hex. OpenSSL often outputs DER-encoded signatures (ASN.1 SEQUENCE of two INTEGERs). Both represent the same mathematical values — if verification fails, check that you are comparing the same encoding format. You can switch between Base64 and hex output using the Signature format selector above.
What data formats can I sign?
You can sign plain text, hexadecimal bytes, or Base64-encoded binary data. Select the input format before signing — the tool hashes the raw bytes exactly as provided. For file signing, convert the file to Base64 first and paste the result; the signature covers the entire file content.
Privacy: This tool runs entirely in your browser — nothing is uploaded or stored. · Disclaimer: For educational purposes only. Not professional security advice.
More in Signatures
Ed25519 Sign / Verify
Sign and verify with Ed25519 or Ed25519ph (EdDSA) online. PEM and raw hex keys, built-in key pair generator, public key derivation.
JWT Signer & Verifier
Sign, parse, and verify JWT (JSON Web Token) online. HS/RS/PS/ES algorithms, decode header and payload, claims breakdown, expiration checks.
ML-DSA Sign / Verify
Generate ML-DSA (FIPS 204) post-quantum key pairs, sign messages, and verify signatures online. ML-DSA-44/65/87, hex and Base64 output.