igbuend/grimbard/cryptographic-action-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.

Base security pattern for integrating cryptographic primitives into software systems. Use when implementing encryption, digital signatures, MACs, or any cryptographic operations. Provides guidance on library selection, key usage, configuration protection, and designing for cryptographic agility. Foundation pattern for Encryption, Digital signature, and MAC patterns.

Install

npx vskill@latest install igbuend/grimbard/cryptographic-action-pattern

SKILL.md

Cryptographic Action Security Pattern

This pattern encapsulates the common considerations for integrating cryptographic primitives into a system. It acts as a foundation for specific patterns like Encryption, Digital Signature, and Message Authentication Code (MAC).

Purpose

This pattern does not directly address a specific security problem but provides essential guidance for correctly applying cryptographic solutions. Proper implementation of cryptographic actions is crucial—incorrect usage can nullify all security guarantees.

Core Components

RoleTypeResponsibility
EntityEntityWants to perform one or more cryptographic actions
CryptographerCryptographic PrimitiveLibrary that provides cryptographic actions
Data Elements
  • input: The plaintext data on which the cryptographic action is performed
  • output: The result of the cryptographic action (e.g., ciphertext, digital signature)
  • keyInfo: Information on the cryptographic key to use (identifier or key material itself, depending on key management approach)
  • config: Configuration for the Cryptographer (e.g., cipher mode) - optional

Pattern Flow

Entity → [crypto_action(input, keyInfo, config)] → Cryptographer
Cryptographer → [output] → Entity
  1. Entity requests a cryptographic action (e.g., encrypt, sign)
  2. Entity provides input data, key information, and optional configuration
  3. Cryptographer performs the requested action
  4. Cryptographer returns the result to Entity

Critical Considerations

Reuse Existing Libraries

One should always use existing, well-known libraries when integrating cryptography into a system.

Never attempt to:

  • Define new, custom cryptographic ciphers
  • Implement existing ciphers yourself
  • Create custom cryptographic protocols

Before selecting a library:

  • Consult library documentation
  • Verify assumptions and dependencies are compatible with your system
  • Avoid libraries no longer actively maintained
  • Avoid libraries that deviate from best practices
Use Keys for a Single Purpose

A cryptographic key should never be used for multiple purposes.

Examples of violations:

  • Using the same key for encryption AND signing
  • Using the same key for different types of data

Why this matters:

  • May negatively impact security properties of operations
  • Increases damage if key is compromised
  • Different operations may have different security requirements
Design for Change

Over time, vulnerabilities in ciphers or implementations will be discovered, and processing power will increase. Software should be designed to allow:

  • Configuration changes (e.g., longer keys)
  • Cipher replacement
  • Library replacement

Recommended approach: Provide an API abstraction layer around the cryptography library. This abstraction:

  • Isolates cryptographic operations
  • Makes transitions easier
  • Centralizes cryptographic policy
Configuration Integrity

If Entity provides configuration to Cryptographer:

  • Protect against tampering during transmission and storage
  • An attacker might change configuration to use insecure, deprecated ciphers
  • Detect any unauthorized changes
Configuration Confidentiality

In some cases, configuration may reveal information about:

  • Keys that will be used
  • System capabilities
  • Attack surface

Consider additional measures to keep configuration confidential when warranted.

Implementations

This pattern is specialized by:

  • Encryption: Encrypting and decrypting data
  • Digital Signature: Signing and verifying messages
  • Message Authentication Code (MAC): Generating and verifying MACs

Each implementation provides specific considerations for that cryptographic action.

Related Patterns

  • Cryptographic key management: Addresses proper key handling
  • Cryptography as a service: Delegates crypto to external service (e.g., KMS)
  • Self-managed cryptography: Application manages its own keys

Library Resources

Pointers to cryptographic libraries can be found in:

  • Implementing patterns (Encryption, Digital signature, MAC)
  • Cryptographic key management pattern and its implementations
  • awesome-cryptography - comprehensive list by language

Implementation Checklist

  • [ ] Using established, well-known cryptographic library
  • [ ] No custom cryptographic implementations
  • [ ] Each key used for single purpose only
  • [ ] API abstraction layer for cryptographic operations
  • [ ] Configuration protected from tampering
  • [ ] Configuration confidentiality addressed if needed
  • [ ] Library actively maintained
  • [ ] Library follows current best practices
  • [ ] Designed for cipher/key length transitions

References

  • Source: https://securitypatterns.distrinet-research.be/patterns/99_01_001__cryptographic_action/
  • I. Arce et al., 'Avoiding the Top 10 Software Security Design Flaws', IEEE, 2014
  • Bundesamt für Sicherheit in der Informationstechnik, 'Cryptographic Mechanisms: Recommendations and Key Lengths', BSI TR-02102-1, Mar. 2020
  • E. Barker, 'Recommendation for Key Management: Part 1 – General', NIST SP 800-57 Part 1, May 2020
  • P. C. van Oorschot, Computer Security and the Internet - Tools and Jewels, 2020

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 23 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/cryptographic-action-pattern/badge)](https://verified-skill.com/skills/igbuend/grimbard/cryptographic-action-pattern)

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