hack23/cia/cryptography-policy

Claude Code and agent skill by hack23/cia

Trust tier 2
  • community
LLM review pending
Source check pending

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

Cryptographic controls implementation: TLS 1.3, AES-256-GCM, bcrypt, RSA-4096, key management per NIST FIPS 140-2 and ISO 27001 A.8.24

Install

npx vskill@latest install hack23/cia/cryptography-policy

SKILL.md

The same SKILL.md was published earlier as hack23/cia/cryptography-policy.

Cryptography Policy Skill

Purpose

This skill establishes cryptographic standards and implementation patterns for the CIA platform, ensuring proper encryption of data at rest, in transit, and in processing. It demonstrates professional cryptographic practices aligned with NIST FIPS 140-2, ISO 27001 A.8.24, and Hack23 ISMS Cryptography Policy.

When to Use This Skill

Apply this skill when:

  • ✅ Implementing encryption for sensitive data storage
  • ✅ Configuring TLS/SSL for network communication
  • ✅ Managing cryptographic keys and certificates
  • ✅ Implementing password hashing and authentication
  • ✅ Designing secure API authentication mechanisms
  • ✅ Configuring AWS encryption services (KMS, S3, RDS)
  • ✅ Implementing digital signatures or message authentication
  • ✅ Conducting cryptographic compliance audits

Do NOT use for:

  • ❌ Encoding/decoding (Base64, URL encoding - not encryption)
  • ❌ Compression (gzip, zip - not security)
  • ❌ Obfuscation (code minification - not cryptography)

Decision Tree

mermaid
%%{
init: {
'theme': 'base',
'themeVariables': {
'primaryColor': '#1565C0',
'primaryTextColor': '#fff',
'lineColor': '#1565C0',
'secondaryColor': '#7B1FA2',
'tertiaryColor': '#4CAF50'
}
}
}%%
flowchart TD
START["🔒 Cryptography Need"] --> TYPE{"📊 Data State?"}
TYPE -->|At Rest| REST["💾 Data at Rest<br/>Storage Encryption"]
TYPE -->|In Transit| TRANSIT["🌐 Data in Transit<br/>TLS/HTTPS"]
TYPE -->|In Use| USE["🔐 Data in Use<br/>Application Encryption"]
REST --> CLASS{"🏷️ Data Classification?"}
TRANSIT --> PROTOCOL{"📡 Protocol?"}
USE --> ALGO{"🔑 Algorithm Type?"}
CLASS -->|Extreme/High| AES256["🔐 AES-256-GCM<br/>Customer Managed Keys"]
CLASS -->|Standard/Low| AES128["🔐 AES-256<br/>Service Managed Keys"]
PROTOCOL -->|Web/API| HTTPS["🌐 HTTPS/TLS 1.3<br/>Strong Ciphers"]
PROTOCOL -->|Database| DBSSL["🗄️ Database SSL/TLS<br/>PostgreSQL SSL"]
PROTOCOL -->|Email| SMTPTLS["📧 SMTP + TLS<br/>S/MIME Optional"]
ALGO -->|Symmetric| SYM["🔐 AES-256-GCM<br/>Authenticated Encryption"]
ALGO -->|Asymmetric| ASYM["🔑 RSA-4096 or Ed25519<br/>Public Key Crypto"]
ALGO -->|Hashing| HASH[#️⃣ SHA-256 or bcrypt<br/>Secure Hashing]
AES256 --> KMS["🔑 AWS KMS<br/>Key Management"]
AES128 --> KMS
SYM --> KMS
ASYM --> KEYSTORE["🏦 Key Storage<br/>HSM or Secrets Manager"]
HASH --> IMPL["✅ Implementation"]
HTTPS --> TLS["✅ TLS Configuration"]
DBSSL --> TLS
SMTPTLS --> TLS
KMS --> ROTATION["🔄 Key Rotation<br/>Annual Minimum"]
KEYSTORE --> ROTATION
TLS --> CERT["📜 Certificate Management<br/>90-day Renewal"]
ROTATION --> AUDIT["📊 Audit Logging<br/>All Key Operations"]
CERT --> AUDIT
IMPL --> AUDIT
style START fill:#1565C0,color:#fff
style AES256 fill:#7B1FA2,color:#fff
style HTTPS fill:#4CAF50,color:#fff
style KMS fill:#FF9800,color:#fff
style AUDIT fill:#4CAF50,color:#fff

Approved Cryptographic Algorithms

Symmetric Encryption

✅ APPROVED: AES (Advanced Encryption Standard)

yaml
Algorithm: AES
Key_Sizes:
- 256-bit (Preferred)
- 192-bit (Acceptable)
- 128-bit (Legacy support only)
Modes:
Recommended:
- GCM (Galois/Counter Mode): Authenticated encryption
- CCM (Counter with CBC-MAC): Authenticated encryption
Acceptable_with_Caution:
- CBC (Cipher Block Chaining): Requires HMAC for authentication
- CTR (Counter Mode): Requires HMAC for authentication
PROHIBITED:
- ECB (Electronic Codebook): Insecure, deterministic
- OFB, CFB: Use GCM or CCM instead
Use_Cases:
- Database encryption (RDS, PostgreSQL)
- File encryption (S3, EBS volumes)
- Application-level encryption
- Session data encryption

Java Implementation:

java
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.SecureRandom;
/**
* AES-256-GCM encryption implementation
* Compliant with NIST SP 800-38D
*/
public class SecureEncryption {
private static final String ALGORITHM = "AES";
private static final String TRANSFORMATION = "AES/GCM/NoPadding";
private static final int KEY_SIZE = 256;
private static final int GCM_IV_LENGTH = 12; // 96 bits
private static final int GCM_TAG_LENGTH = 128; // 128 bits
/**
* Generate a new AES-256 encryption key
*/
public static SecretKey generateKey() throws Exception {
KeyGenerator keyGenerator = KeyGenerator.getInstance(ALGORITHM);
keyGenerator.init(KEY_SIZE, new SecureRandom());
return keyGenerator.generateKey();
}
/**
* Encrypt data using AES-256-GCM
*
* @param plaintext Data to encrypt
* @param key AES-256 secret key
* @return Encrypted data (IV + ciphertext + tag)
*/
public static byte[] encrypt(byte[] plaintext, SecretKey key) throws Exception {
// Generate random IV
byte[] iv = new byte[GCM_IV_LENGTH];
new SecureRandom().nextBytes(iv);
// Initialize cipher
Cipher cipher = Cipher.getInstance(TRANSFORMATION);
GCMParameterSpec spec = new GCMParameterSpec(GCM_TAG_LENGTH, iv);
cipher.init(Cipher.ENCRYPT_MODE, key, spec);
// Encrypt
byte[] ciphertext = cipher.doFinal(plaintext);
// Combine IV + ciphertext for storage
byte[] encrypted = new byte[iv.length + ciphertext.length];
System.arraycopy(iv, 0, encrypted, 0, iv.length);
System.arraycopy(ciphertext, 0, encrypted, iv.length, ciphertext.length);
return encrypted;
}
/**
* Decrypt data using AES-256-GCM
*
* @param encrypted Encrypted data (IV + ciphertext + tag)
* @param key AES-256 secret key
* @return Decrypted plaintext
*/
public static byte[] decrypt(byte[] encrypted, SecretKey key) throws Exception {
// Extract IV
byte[] iv = new byte[GCM_IV_LENGTH];
System.arraycopy(encrypted, 0, iv, 0, iv.length);
// Extract ciphertext
byte[] ciphertext = new byte[encrypted.length - GCM_IV_LENGTH];
System.arraycopy(encrypted, GCM_IV_LENGTH, ciphertext, 0, ciphertext.length);
// Initialize cipher
Cipher cipher = Cipher.getInstance(TRANSFORMATION);
GCMParameterSpec spec = new GCMParameterSpec(GCM_TAG_LENGTH, iv);
cipher.init(Cipher.DECRYPT_MODE, key, spec);
// Decrypt and verify authentication tag
return cipher.doFinal(ciphertext);
}
}

❌ PROHIBITED: DES, 3DES, RC4

yaml
Deprecated_Algorithms:
DES:
Reason: 56-bit key length insufficient
Replacement: AES-256
Deadline: Immediate removal required
3DES:
Reason: Block size vulnerability (Sweet32)
Replacement: AES-256
Deadline: Migrate by end of 2025
RC4:
Reason: Multiple cryptographic weaknesses
Replacement: AES-GCM or ChaCha20-Poly1305
Deadline: Immediate removal required
Asymmetric Encryption

✅ APPROVED: RSA

yaml
Algorithm: RSA
Key_Sizes:
- 4096-bit (Preferred for long-term keys)
- 3072-bit (Acceptable)
- 2048-bit (Minimum, legacy support only)
Padding_Schemes:
Encryption:
- OAEP (Optimal Asymmetric Encryption Padding) with SHA-256
Signature:
- PSS (Probabilistic Signature Scheme) with SHA-256
PROHIBITED_Padding:
- PKCS#1 v1.5: Vulnerable to padding oracle attacks
Use_Cases:
- SSH keys (prefer Ed25519)
- TLS certificates (prefer ECDSA)
- Data encryption for small payloads
- Digital signatures

Java Implementation:

java
import java.security.*;
import javax.crypto.Cipher;
import java.security.spec.RSAKeyGenParameterSpec;
/**
* RSA-4096 encryption and signature implementation
* Compliant with NIST SP 800-56B
*/
public class RSASecureEncryption {
private static final int KEY_SIZE = 4096;
private static final String ALGORITHM = "RSA";
private static final String TRANSFORMATION = "RSA/ECB/OAEPWithSHA-256AndMGF1Padding";
private static final String SIGNATURE_ALGORITHM = "SHA256withRSA/PSS";
/**
* Generate RSA-4096 key pair
*/
public static KeyPair generateKeyPair() throws Exception {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance(ALGORITHM);
keyGen.initialize(KEY_SIZE, new SecureRandom());
return keyGen.generateKeyPair();
}
/**
* Encrypt data using RSA-OAEP
* Note: RSA should only encrypt small data (e.g., symmetric keys)
* For large data, use hybrid encryption (RSA + AES)
*/
public static byte[] encrypt(byte[] plaintext, PublicKey publicKey) throws Exception {
Cipher cipher = Cipher.getInstance(TRANSFORMATION);
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
return cipher.doFinal(plaintext);
}
/**
* Decrypt data using RSA-OAEP
*/
public static byte[] decrypt(byte[] ciphertext, PrivateKey privateKey) throws Exception {
Cipher cipher = Cipher.getInstance(TRANSFORMATION);
cipher.init(Cipher.DECRYPT_MODE, privateKey);
return cipher.doFinal(ciphertext);
}
/**
* Sign data using RSA-PSS
*/
public static byte[] sign(byte[] data, PrivateKey privateKey) throws Exception {
Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM);
signature.initSign(privateKey);
signature.update(data);
return signature.sign();
}
/**
* Verify signature using RSA-PSS
*/
public static boolean verify(byte[] data, byte[] signatureBytes, PublicKey publicKey)
throws Exception {
Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM);
signature.initVerify(publicKey);
signature.update(data);
return signature.verify(signatureBytes);
}
}

✅ APPROVED: Elliptic Curve Cryptography (ECC)

yaml
Algorithm: ECDSA / ECDH
Curves:
Preferred:
- Ed25519 (EdDSA signatures)
- X25519 (ECDH key exchange)
- P-384 (NIST curve for FIPS compliance)
Acceptable:
- P-256 (secp256r1, prime256v1)
PROHIBITED:
- P-192: Insufficient security margin
- Custom curves: Avoid unless peer-reviewed
Use_Cases:
- SSH keys (Ed25519 preferred)
- TLS certificates (ECDSA preferred over RSA)
- JWT signatures
- Cryptocurrency/blockchain applications

SSH Key Generation Example:

bash
# Generate Ed25519 SSH key (RECOMMENDED)
ssh-keygen -t ed25519 -C "user@cia.hack23.com" -f ~/.ssh/id_ed25519
# Generate ECDSA SSH key (alternative)
ssh-keygen -t ecdsa -b 384 -C "user@cia.hack23.com" -f ~/.ssh/id_ecdsa
# Generate RSA SSH key (legacy compatibility)
ssh-keygen -t rsa -b 4096 -C "user@cia.hack23.com" -f ~/.ssh/id_rsa
# Verify SSH key fingerprint
ssh-keygen -lf ~/.ssh/id_ed25519.pub
Cryptographic Hashing

✅ APPROVED: SHA-2 Family

yaml
Algorithms:
SHA-256:
Output: 256 bits
Use: General purpose, integrity verification
Status: Approved
SHA-384:
Output: 384 bits
Use: Higher security margin required
Status: Approved
SHA-512:
Output: 512 bits
Use: Long-term security, high-security applications
Status: Approved
Use_Cases:
- File integrity verification
- Digital signatures
- Certificate fingerprints
- HMAC authentication
- Git commit hashing

Java Implementation:

java
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.xml.bind.DatatypeConverter;

This is the start of the file. Read the full SKILL.md on GitHub.

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
235
Repository forks
56
7-day trend score
27

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

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/hack23/cia/cryptography-policy/badge)](https://verified-skill.com/skills/hack23/cia/cryptography-policy)

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