Insecure rsa

From zakirkun/ice-tea · View interactive version

Insecure rsa is an AI agent skill from the GitHub repository zakirkun/ice-tea. Detects RSA usage with insufficient key sizes, PKCS#1 v1.5 padding (vulnerable to padding oracle), or direct message encryption without hybrid scheme.

How to use this skill

Skill file

Insecure RSA Configuration

Overview

Common RSA vulnerabilities:

  1. Key size < 2048 bits: Keys below 2048 bits are factorable; minimum is 3072 bits by 2030 (NIST guidance)
  2. PKCS#1 v1.5 padding: Vulnerable to Bleichenbacher's padding oracle attack; OAEP must be used
  3. Direct message encryption: RSA should only encrypt symmetric keys (hybrid encryption), not arbitrary messages
  4. Public exponent e=1 or e=3: Trivial to break with small exponents

Remediation

Vulnerable (Python):

from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5  # Vulnerable padding!
key = RSA.generate(1024)  # Too small!

Safe (Python):

from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
key = RSA.generate(4096)
cipher = PKCS1_OAEP.new(key.publickey())
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.