igbuend/grimbard/digital-signature-pattern

Claude Code and agent skill by igbuend/grimbard

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Security pattern for implementing digital signatures. Use when implementing document signing, code signing, certificate signing, non-repudiation, or verifying authenticity and integrity of messages using asymmetric cryptography (RSA, ECDSA, Ed25519).

Install

npx vskill@latest install igbuend/grimbard/digital-signature-pattern

SKILL.md

Digital Signature Security Pattern

Create and verify digital signatures to ensure data integrity, authenticity, and non-repudiation using asymmetric cryptography.

Properties Provided

  1. Data Integrity: Message not modified since signing
  2. Authentication: Message originated from key holder
  3. Non-repudiation: Signer cannot deny having signed

Core Components

RoleTypeResponsibility
EntityAEntityCreates digital signatures
EntityBEntityVerifies digital signatures
Signature GeneratorCryptographic PrimitiveCreates signatures
Signature VerifierCryptographic PrimitiveVerifies signatures
Data Elements
  • message: Data to be signed
  • signature: Digital signature of message
  • private_key: Signing key (secret)
  • public_key: Verification key (can be distributed)

Signature Flow

Signing
EntityA → [sign(message, private_key)] → Signature Generator
Signature Generator → [signature] → EntityA
EntityA → [message + signature] → EntityB
Verification
EntityB → [verify(message, signature, public_key)] → Signature Verifier
Signature Verifier → [valid/invalid] → EntityB

Comparison with MAC

AspectDigital SignatureMAC
Key typeAsymmetric (public/private)Symmetric (shared)
Non-repudiationYesNo
Verification keyPublic (distributable)Secret (shared)
PerformanceSlowerFaster
Use caseExternal parties, legalInternal, performance

Use digital signatures when non-repudiation required or verifiers shouldn't be able to create signatures.

Algorithm Recommendations

RSA Signatures
VariantStatusNotes
RSA-PSSRecommendedProbabilistic padding
RSA-PKCS#1 v1.5AcceptableDeterministic, widely supported

Key sizes:

  • 3072 bits: Recommended for long-term
  • 2048 bits: Minimum acceptable
  • 4096 bits: High security requirements
  • 15360 bits: 30+ year protection (if needed)
Elliptic Curve Signatures
AlgorithmCurveStatus
Ed25519Curve25519Recommended (modern)
ECDSAP-256Recommended
ECDSAP-384High security
ECDSAP-521Highest security

Key sizes:

  • 256 bits: Standard security (≈RSA 3072)
  • 384 bits: High security
  • 512 bits: Long-term protection
Hash Functions for Signing
  • SHA-256: Standard
  • SHA-384/SHA-512: Higher security
  • SHA-3: Alternative

Never: MD5, SHA-1

Security Considerations

Private Key Protection

Critical: Private key security = signature trustworthiness

  • Store in HSM for high-value keys
  • Use secure key storage APIs
  • Never expose in logs or errors
  • Implement access controls
  • Consider key ceremonies for critical keys
Public Key Authenticity

Verifier must trust public key belongs to signer:

  • Certificate from trusted CA
  • Out-of-band verification
  • Web of trust
  • Key pinning
Algorithm Selection
  • Use current recommendations
  • Plan for algorithm transitions
  • Avoid deprecated algorithms
Timestamp Considerations
  • Include timestamp in signed data
  • Consider timestamping service
  • Prevents backdating
Message Hashing

Typically, signature is over hash of message:

  1. Hash the message (SHA-256)
  2. Sign the hash

Library usually handles this—verify behavior.

Signature Malleability

Some signature schemes are malleable (valid signature can be modified to create another valid signature). Use signature schemes that prevent malleability or handle at application layer.

Common Use Cases

Code Signing
  • Sign software/updates
  • Verify before installation
  • Protect against tampering
Document Signing
  • Legal documents
  • Contracts
  • Non-repudiation
Certificate Signing
  • X.509 certificates
  • CA hierarchy
  • TLS/HTTPS
JWT Signing
  • Token integrity
  • RS256 (RSA), ES256 (ECDSA)
  • Verify before trusting claims
API Request Signing
  • Request authenticity
  • Webhook verification
  • Prevents tampering

Implementation Checklist

  • [ ] Using RSA-PSS, Ed25519, or ECDSA
  • [ ] Key size ≥ 3072 bits (RSA) or ≥ 256 bits (ECC)
  • [ ] Private key stored securely
  • [ ] Public key authenticity established
  • [ ] SHA-256+ for hashing
  • [ ] No MD5 or SHA-1
  • [ ] Verification before trusting signed data
  • [ ] Algorithm agility for future changes

Common Mistakes

MistakeImpactFix
Weak key sizeForgery possibleUse recommended sizes
MD5/SHA-1Collision attacksUse SHA-256+
Private key exposureFull compromiseSecure storage (HSM)
Skipping verificationAccept forged dataAlways verify
Trusting unverified public keyAccept attacker's signatureEstablish key authenticity

Related Patterns

  • Cryptographic action (parent pattern)
  • Message authentication code (symmetric alternative)
  • Cryptographic key management (key handling)
  • Verifiable token-based authentication (JWT use case)

References

  • Source: https://securitypatterns.distrinet-research.be/patterns/99_01_003__digital_signature/
  • NIST FIPS 186-5 Digital Signature Standard
  • RFC 8017 (PKCS#1 RSA)

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
4
Repository forks
1
7-day trend score
8

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 26 Mar 2026, 8 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/igbuend/grimbard/digital-signature-pattern/badge)](https://verified-skill.com/skills/igbuend/grimbard/digital-signature-pattern)

Something wrong with this skill or its page? Tell us.