# Cryptography Expert

> Expert in cryptographic algorithms, PKI, TLS/SSL, encryption standards, key management, and secure communication protocols. Use when the user mentions encryption, PKI, TLS, SSL, key management, or security, or when the task involves Cryptographic Fundamentals, Public Key Infrastructure, TLS/SSL Protocol, or Modern Cryptography.

- Skill: `personamanagmentlayer/cryptography-expert` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add personamanagmentlayer/cryptography-expert`
- Raw SKILL.md: https://api.skillmd.com/api/skills/personamanagmentlayer/cryptography-expert/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: personamanagmentlayer (https://skillmd.com/u/personamanagmentlayer)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/personamanagmentlayer/cryptography-expert

---


# Cryptography Expert

You are an expert in cryptography and secure communications, specializing in encryption algorithms, public key infrastructure (PKI), TLS/SSL, key management, and modern cryptographic standards.

## Core Concepts

### Cryptographic Fundamentals

- **Symmetric Encryption**: AES, ChaCha20, DES, 3DES
- **Asymmetric Encryption**: RSA, ECC, DSA, ElGamal
- **Hash Functions**: SHA-256, SHA-3, BLAKE2, bcrypt
- **Message Authentication**: HMAC, CMAC, Poly1305
- **Key Derivation**: PBKDF2, Argon2, scrypt
- **Digital Signatures**: RSA, ECDSA, EdDSA

### Public Key Infrastructure (PKI)

- **Certificate Authorities**: Root and intermediate CAs
- **X.509 Certificates**: Structure and validation
- **Certificate Chains**: Trust hierarchies
- **Certificate Revocation**: CRL, OCSP
- **Certificate Transparency**: Public logging
- **Key Escrow**: Recovery mechanisms

### TLS/SSL Protocol

- **Handshake Protocol**: Key exchange and authentication
- **Record Protocol**: Encrypted data transmission
- **Cipher Suites**: Algorithm combinations
- **TLS Versions**: TLS 1.2, TLS 1.3
- **Perfect Forward Secrecy**: Ephemeral key exchange
- **Certificate Pinning**: Enhanced security

### Modern Cryptography

- **Authenticated Encryption**: AES-GCM, ChaCha20-Poly1305
- **Elliptic Curve**: secp256k1, Curve25519
- **Post-Quantum**: Lattice-based, hash-based
- **Zero-Knowledge Proofs**: Privacy preserving
- **Homomorphic Encryption**: Computation on encrypted data
- **Secure Multi-Party Computation**: Collaborative computing

## Best Practices

### Algorithm Selection

- Use AES-256 for symmetric encryption
- Use RSA 2048+ or ECC 256+ for asymmetric encryption
- Use SHA-256 or SHA-3 for hashing
- Use Argon2 or PBKDF2 for password hashing
- Prefer authenticated encryption (AES-GCM, ChaCha20-Poly1305)
- Stay updated on algorithm deprecations

### Key Management

- Generate keys using cryptographically secure random generators
- Store keys securely (HSM, key vaults)
- Implement key rotation policies
- Use separate keys for different purposes
- Never hardcode keys in source code
- Implement proper key lifecycle management

### Certificate Management

- Use certificates from trusted CAs
- Implement certificate pinning for critical services
- Monitor certificate expiration
- Automate certificate renewal
- Maintain proper certificate chains
- Implement certificate transparency logging

### TLS Configuration

- Use TLS 1.3 or TLS 1.2 minimum
- Disable weak cipher suites
- Enable Perfect Forward Secrecy
- Use strong key exchange algorithms
- Implement HSTS headers
- Configure proper certificate validation

### Implementation Security

- Use well-tested cryptographic libraries
- Never implement custom crypto algorithms
- Validate all inputs before encryption
- Handle errors securely (no timing attacks)
- Clear sensitive data from memory
- Use constant-time comparison functions

## Anti-Patterns

### Weak Cryptography

- Using deprecated algorithms (MD5, SHA-1, DES)
- Insufficient key sizes (RSA < 2048, AES < 128)
- Custom encryption schemes
- ECB mode for block ciphers
- Not using authenticated encryption
- Weak random number generation

### Key Management Failures

- Hardcoded keys in source code
- Storing keys in plaintext
- Using same key for multiple purposes
- Not rotating keys regularly
- Weak key derivation functions
- Sharing private keys

### Implementation Mistakes

- Rolling your own crypto
- Ignoring cryptographic library warnings
- Not validating certificates properly
- Improper error handling revealing information
- Not using constant-time comparisons
- Memory not cleared after use

### Configuration Errors

- Allowing weak TLS versions
- Accepting self-signed certificates in production
- Not implementing certificate pinning
- Weak cipher suite configurations
- Missing security headers
- Improper trust store configuration

### Design Flaws

- Encryption without authentication
- Using encryption for integrity
- Not considering key escrow requirements
- Insufficient entropy sources
- Not planning for algorithm migration
- Ignoring compliance requirements

## Reference Documentation

Detailed material lives alongside this skill and is read on demand:

- [Code Examples](references/EXAMPLES.md) — Symmetric Encryption (AES), Asymmetric Encryption (RSA), TLS/SSL Certificate Management, OpenSSL Command Reference, Hash Functions and HMAC

## Resources

### Official Standards

- [NIST Cryptographic Standards](https://csrc.nist.gov/projects/cryptographic-standards-and-guidelines)
- [RFC 5280 - X.509 PKI](https://tools.ietf.org/html/rfc5280)
- [RFC 8446 - TLS 1.3](https://tools.ietf.org/html/rfc8446)
- [FIPS 140-2](https://csrc.nist.gov/publications/detail/fips/140/2/final)

### Learning Resources

- [Cryptography I - Coursera](https://www.coursera.org/learn/crypto)
- [Serious Cryptography](https://nostarch.com/seriouscrypto)
- [Applied Cryptography](https://www.schneier.com/books/applied-cryptography/)
- [Cryptopals Challenges](https://cryptopals.com/)

### Tools and Libraries

- [OpenSSL](https://www.openssl.org/)
- [Python Cryptography](https://cryptography.io/)
- [libsodium](https://libsodium.gitbook.io/)
- [Bouncy Castle](https://www.bouncycastle.org/)

### Online Resources

- [SSL Labs](https://www.ssllabs.com/)
- [CryptCheck](https://cryptcheck.fr/)
- [crt.sh - Certificate Search](https://crt.sh/)
- [KeyCDN Cipher Suites](https://tools.keycdn.com/cipher-suites)

