| name | implementing-rsa-key-pair-management |
| description | RSA (Rivest-Shamir-Adleman) is the most widely deployed asymmetric cryptographic algorithm, used for digital signatures, key exchange, and encryption. This skill covers generating, storing, rotating, |
| domain | cybersecurity |
| subdomain | cryptography |
| tags | ["cryptography","rsa","key-management","pki","asymmetric-encryption"] |
| version | 1.0 |
| author | mahipal |
| license | Apache-2.0 |
| nist_csf | ["PR.DS-01","PR.DS-02","PR.DS-10"] |
Implementing RSA Key Pair Management
Overview
RSA (Rivest-Shamir-Adleman) is the most widely deployed asymmetric cryptographic algorithm, used for digital signatures, key exchange, and encryption. This skill covers generating, storing, rotating, and managing RSA key pairs following NIST SP 800-57 key management guidelines, including key serialization formats (PEM, DER, PKCS#8), passphrase protection, and key strength validation.
When to Use
- When deploying or configuring implementing rsa key pair management capabilities in your environment
- When establishing security controls aligned to compliance requirements
- When building or improving security architecture for this domain
- When conducting security assessments that require this implementation
Common Misconfigurations & Verification
- PKCS#1 v1.5 encryption (padding oracle):
RSA/PKCS1v15 decryption that reveals padding-validity (via errors or timing) enables a Bleichenbacher attack to recover plaintext. Use RSA-OAEP (padding.OAEP with SHA-256) for encryption, never PKCS1v15 for new systems.
- PKCS#1 v1.5 signatures: prefer RSA-PSS for signing; if PKCS1v15 verification must stay for legacy, pin the exact hash and never mix.
- Key too small / weak: reject keys
<2048 bits (use ≥3072 for new deployments). Validate the modulus bit length and run a weak-key check (small factors, low public exponent like e=3 with no OAEP, shared primes / ROCA).
- Unprotected private key: encrypt private keys with a strong passphrase (
BestAvailableEncryption, AES-256) in PKCS#8, and store with 0600 permissions — never commit unencrypted PEMs.
- No key rotation / versioning: rotate at least annually and retain old public keys for verifying historical signatures only.
- Mandatory tests: an RSA-PSS signature over a tampered message is REJECTED; verification with the wrong public key is REJECTED; OAEP decryption of a corrupted ciphertext fails cleanly without leaking padding state; loading the private key with a wrong passphrase fails;
key.key_size >= 3072 is asserted.
Prerequisites
- Familiarity with cryptography concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Objectives