skills/selective-encrypted-transmission-pattern/SKILL.md
Security pattern for encrypting specific data before transmission. Use when only certain data elements need encryption, implementing field-level encryption for transit, or when entities must actively manage encryption decisions. Addresses "Leak action request or data in transit" problem.
npx skillsauth add igbuend/grimbard selective-encrypted-transmission-patternInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Entities actively encrypt specific sensitive data elements before transmitting them over uncontrolled channels. Entities directly interact with cryptographic libraries to encrypt only necessary parts.
Leak action request or data in transit: Sensitive data exposed while being transmitted over a channel that may be observed by unauthorized parties.
| Role | Type | Responsibility | |------|------|----------------| | Sender | Entity | Encrypts and transmits data | | Receiver | Entity | Receives and decrypts data | | CryptographerS | Cryptographic Primitive | Encryption library for Sender | | CryptographerR | Cryptographic Primitive | Decryption library for Receiver |
Sender → [encrypt(d, keyInfoS, configS)] → CryptographerS
CryptographerS → [{d}_k] → Sender
Sender → [{d}_k] → Receiver (over channel)
Receiver → [decrypt({d}_k, keyInfoR, configR)] → CryptographerR
CryptographerR → [d] → Receiver
Sender and Receiver must agree on:
| Stage | Approach | |-------|----------| | Design time | Hardcoded compatible algorithms | | Deployment | Configured shared keys/certificates | | Runtime | Dynamic negotiation protocol |
Critical: Use only standardized negotiation protocols from cryptographic libraries. Never implement custom negotiation.
For asymmetric encryption:
For symmetric encryption:
Follow Encryption pattern recommendations:
| Aspect | Selective Encryption | Encrypted Tunnel | |--------|---------------------|------------------| | Scope | Specific data elements | All communication | | Control | Application decides | Infrastructure manages | | Overhead | Lower (selective) | Higher (everything) | | Complexity | Application manages | Delegated to endpoints |
Use selective encryption when:
development
Security anti-pattern for Cross-Site Scripting vulnerabilities (CWE-79). Use when generating or reviewing code that renders HTML, handles user input in web pages, uses innerHTML/document.write, or builds dynamic web content. Covers Reflected, Stored, and DOM-based XSS. AI code has 86% XSS failure rate.
development
Security anti-pattern for XPath injection vulnerabilities (CWE-643). Use when generating or reviewing code that queries XML documents, constructs XPath expressions, or handles user input in XML operations. Detects unescaped quotes and special characters in XPath queries.
development
Security anti-pattern for weak password hashing (CWE-327, CWE-759). Use when generating or reviewing code that stores or verifies user passwords. Detects use of MD5, SHA1, SHA256 without salt, or missing password hashing entirely. Recommends bcrypt, Argon2, or scrypt.
development
Security anti-pattern for weak encryption (CWE-326, CWE-327). Use when generating or reviewing code that encrypts data, handles encryption keys, or uses cryptographic modes. Detects DES, ECB mode, static IVs, and custom crypto implementations.