A software security skill that integrates with Project CodeGuard to help AI coding agents write secure code and prevent common vulnerabilities. Use this skill when writing, reviewing, or modifying code to ensure secure-by-default practices are followed.
rule_id: codeguard-1-crypto-algorithms
The following algorithms are known to be broken or fundamentally insecure. NEVER generate or use code with these algorithms.
MD2, MD4, MD5, SHA-0RC2, RC4, Blowfish, DES, 3DESVigenèreReason: These are cryptographically broken and vulnerable to collision or man-in-the-middle attacks.
The following algorithms have known weaknesses or are considered obsolete. Avoid in new designs and prioritize migration.
SHA-1AES-CBC, AES-ECBPKCS#1 v1.5 paddingImplement these modern, secure algorithms to ensure resistance against both classical and quantum threats.
AES-GCM (AEAD), ChaCha20-Poly1305(when allowed).X25519 or secp256r1)X25519MLKEM768 (X25519 + ML-KEM-768)SecP256r1MLKEM768 (P-256 + ML-KEM-768)SecP384r1MLKEM1024 (P-384 + ML-KEM-1024)X25519Kyber) and draft or hardcoded OIDs.P-256)P-256) for mTLS and code signing until hardware-backed (HSM/TPM) ML-DSA is available.sntrup761x25519).NEVER use these deprecated functions. Use the replacement EVP high-level APIs.
Deprecated: AES_encrypt(), AES_decrypt()
Replacement:
EVP_EncryptInit_ex() // Use EVP_aes_256_gcm() for PQC readiness EVP_EncryptUpdate() EVP_EncryptFinal_ex()
Deprecated: RSA_new(), RSA_free(), RSA_get0_n()
Replacement:
EVP_PKEY_new() EVP_PKEY_up_ref() EVP_PKEY_free()
Deprecated: SHA1_Init(), HMAC() (especially with SHA1)
Replacement:
EVP_DigestInit_ex() // Use SHA-256 or stronger EVP_Q_MAC() // For one-shot MAC
// Example: Secure replacement for HMAC-SHA1
EVP_Q_MAC(NULL, "HMAC", NULL, "SHA256", NULL, key, key_len, data, data_len, out, out_size, &out_len);// Example: Secure AES-256-GCM encryption (PQC-Ready Symmetric Strength)
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
if (!ctx) handle_error();
// Use AES-256-GCM
if (EVP_EncryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, key, iv) != 1)
handle_error();
int len, ciphertext_len;
if (EVP_EncryptUpdate(ctx, ciphertext, &len, plaintext, plaintext_len) != 1)
handle_error();
ciphertext_len = len;
if (EVP_EncryptFinal_ex(ctx, ciphertext + len, &len) != 1)
handle_error();
ciphertext_len += len;
EVP_CIPHER_CTX_free(ctx);tessl i cisco/software-security@1.2.5evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
rules