Digital Signature Generator & Verifier Online | RSA-PSS & ECDSA

Digital Signatures
100% client-side. Processed locally in your browser using the Web Crypto API. Nothing is sent to any server.
⚠️ Critical Security: Use SHA-256 or stronger hash algorithms — SHA-1 is deprecated and vulnerable to collision attacks. For new projects, prefer ECDSA (P-256) or Ed25519 over RSA. Store private keys securely — never expose them in client-side code for production; use HSMs or server-side signing.

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

AlgorithmKey SizeSignature SizeSpeedBest for
RSA-PSS2048-4096 bit256-512 bytesSlowerLegacy compatibility, code signing
RSA PKCS#1 v1.52048-4096 bit256-512 bytesSlowerOlder standards, X.509 certificates
ECDSA P-256256 bit64 bytesFastTLS 1.3, JWT ES256, modern protocols
ECDSA P-384384 bit96 bytesFastGovernment, payment, JWT ES384
ECDSA secp256k1256 bit64 bytesFastBitcoin, 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

⚠️ Using SHA-1 for Signatures: SHA-1 is deprecated and vulnerable to collision attacks. Always use SHA-256 or stronger (SHA-384, SHA-512) for new signatures.
⚠️ Signature Encoding Mismatch: ECDSA signatures can be encoded as raw r‖s bytes or DER (ASN.1). OpenSSL often uses DER; Web Crypto uses raw r‖s. Verify both sides use the same encoding.
⚠️ Not Protecting Private Keys: Private keys must be stored securely. For production signing, use HSMs or server-side signing — never expose private keys in client-side code.
⚠️ Data Format Mismatch: Signatures cover exact bytes. If you sign text but verify hex (or vice versa), verification will fail. Always use the same data format for signing and verification.
⚠️ Using RSA PKCS#1 v1.5 for New Designs: RSA-PSS has a formal security proof and is preferred for new applications. PKCS#1 v1.5 is only needed for legacy compatibility.

Security Notes

ℹ️ ECDSA Signatures Are Randomized: Signing the same message twice produces different but equally valid signatures. This is by design (due to the random k value), not a bug.
ℹ️ Prefer ECDSA Over RSA: ECDSA P-256 provides 128-bit security with 256-bit keys and 64-byte signatures. RSA requires 3072-bit keys and 384-byte signatures for equivalent security.
ℹ️ secp256k1 for Blockchain: secp256k1 is the Bitcoin/Ethereum curve. For TLS, JWT, and general-purpose use, stick with NIST curves (P-256/P-384).
ℹ️ Test Key Generation: This tool includes a one-click Generate button for test key pairs. For production use, generate keys with proper cryptographic tools and secure key management.

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

Related Concepts

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

Learn More