一键导入
pqc-signatures-security
Expert instructions to implement and verify ML-DSA-65 post-quantum cryptographic signatures and agentic workflow security.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Expert instructions to implement and verify ML-DSA-65 post-quantum cryptographic signatures and agentic workflow security.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Post-quantum cryptography secrets management system for protecting API keys, tokens, and private data.
Enterprise-grade codebase intelligence via a TWO-LAYER knowledge graph. Use GitNexus (MCP-native, AST-precise, call-graph aware) as the always-on operational layer for code call-chains, blast-radius, and rename. Use Graphify (multimodal, code+docs+papers+video+image) as the on-demand semantic enrichment layer for cross-document reasoning, PR triage, and visual deliverables. Trigger on: "how does X work", "what calls Y", "what breaks if I change Z", "show me the architecture", "ingest this paper/RFC", "triage my PRs", "client briefing", "merge-order risk", "find dead code", "explain this symbol", "find god nodes", or any codebase question. Skips guessing, fast-paths through cached graphs.
Multi-tool coding skill integrating gstack (Claude Code skills), claude (Claude Code), and mini-live (mini-swe-agent with Live-SWE-agent config). Use when spawning Claude Code sessions for coding work, running security audits, code reviews, QA testing URLs, building features end-to-end, or planning before building. Also configures and orchestrates sub-agents to maximize utilization of all AI subscriptions and APIs. For MCP-equipped sub-agent dispatch with provider fallback, pair with pi-mini-orchestrator skill.
Multi-agent orchestration via fixed claude→mini rotation with scoped MCP tools and provider fallback chains. Every dispatch gets exactly the MCP servers it needs, a provider chain that auto-recovers from API failures, and its own git worktree for filesystem isolation. Use when dispatching subagent tasks, running parallel coding work across subscriptions, or orchestrating complex multi-step code changes.
Enhances and hardens markdown documents through two independent pipelines — (1) fusing external knowledge bases into a target document via multi-agent orchestration, and (2) recursively optimizing documents for multi-model LLM effectiveness using a split→optimize→review→merge architecture.
Extracts structured markdown knowledge bases from YouTube videos by combining spoken transcripts with sequential visual frames via a Vision-Language Model (VLM). Use this when you need to turn a video into a deep, searchable knowledge document.
| name | pqc-signatures-security |
| description | Expert instructions to implement and verify ML-DSA-65 post-quantum cryptographic signatures and agentic workflow security. |
Companion skill: pqc-secrets — API key encryption at rest via ML-KEM-768 + AES-256-GCM. Use both together for complete PQC coverage: pqc-secrets encrypts your secrets; this skill verifies your code integrity.
This skill provides comprehensive instructions, blueprints, and reference code for implementing post-quantum cryptographic (PQC) signature verification and agentic security standards in any repository.
AI agents using this skill are equipped to:
Every cryptographic implementation exists to protect data and sovereignty. Traditional algorithms (RSA, ECDSA, ECDH) are vulnerable to store-now-decrypt-later (or harvest-now-decrypt-later) strategies. The reduction in quantum attack resources requires proactive migration to NIST FIPS 204/203 standards:
Whenever a Large Language Model (LLM) or autonomous agent initializes inside a repository with this infrastructure:
AGENT_PUBKEY.pem in the root, along with corresponding .sig files.<pqc_audit_log> block.<pqc_audit_log>
[✓] Public Key Detected: AGENT_PUBKEY.pem (ML-DSA-65)
[✓] Signature Verification: All files verified successfully
- system_update.sh: Verified
- verify_signatures.sh: Verified
[✓] Cryptography Standards: PQC Enforced
</pqc_audit_log>
To re-implement the cryptographic signature verification system in any repository, follow these steps:
Create a .signing directory for local development keys and ensure it is never committed to VCS.
mkdir -p .signing
echo ".signing/" >> .gitignore
Using OpenSSL 3.5+ (or OpenSSL 3.x compiled with the oqs-provider):
# Generate the private key
openssl genpkey -algorithm ML-DSA-65 -out .signing/agent_privkey.pem
chmod 600 .signing/agent_privkey.pem
# Extract the public key to the repo root
openssl pkey -in .signing/agent_privkey.pem -pubout -out AGENT_PUBKEY.pem
Note: In production environments, store the private key in a KMS (e.g. AWS KMS, HashiCorp Vault) or HSM.
Sign all executable scripts, shell scripts, system configuration files, and critical agent policies. Common files include:
*.sh, *.bash, *.zshAGENTS.md (Agent Security Policy)llms.txt or configuration files.verify_signatures.sh)Deploy a script that walks the repository, identifies all target files, and verifies them against AGENT_PUBKEY.pem.
#!/usr/bin/env bash
# verify_signatures.sh
set -euo pipefail
PUBKEY="AGENT_PUBKEY.pem"
verify_file() {
local file="$1"
local sig="${file}.sig"
if [[ ! -f "$file" ]]; then
echo "ERROR: File not found: $file" >&2
return 1
fi
if [[ ! -f "$sig" ]]; then
echo "MISSING SIGNATURE: $file" >&2
return 2
fi
if openssl pkeyutl -verify -pubin -inkey "$PUBKEY" -in "$file" -sigfile "$sig" 2>&1 | grep -q "Signature Verified Successfully"; then
echo "OK: $file"
return 0
else
echo "VERIFICATION FAILED: $file" >&2
return 1
fi
}
Install a post-merge hook so that files are automatically verified immediately upon a git pull or git merge.
# .git/hooks/post-merge
#!/usr/bin/env bash
set -euo pipefail
./verify_signatures.sh || { echo "Signature check failed. Aborting." >&2; exit 1; }
Create .signing/sign_file.sh to allow maintainers to easily sign or re-sign files when modified.
# .signing/sign_file.sh
#!/usr/bin/env bash
set -euo pipefail
FILE="$1"
openssl pkeyutl -sign -inkey .signing/agent_privkey.pem -in "$FILE" -out "${FILE}.sig"
Implementations must adopt secure programming practices to prevent injection, escalation, and leaks.
Ensure Python scripts verify subprocesses, configs, or modules before running them.
import subprocess
from pathlib import Path
def verify_mldsa_signature(file_path: Path, sig_path: Path, pubkey_path: Path) -> bool:
if not file_path.is_file() or not sig_path.is_file() or not pubkey_path.is_file():
return False
result = subprocess.run(
["openssl", "pkeyutl", "-verify", "-pubin", "-inkey", str(pubkey_path),
"-in", str(file_path), "-sigfile", str(sig_path)],
check=False, text=True, capture_output=True
)
return result.returncode == 0 and "Signature Verified Successfully" in result.stdout
A pipeline filter that strips sensitive keys, credentials, and block certificates before passing outputs to logs or external processes.
import re
SECRET_PATTERNS = [
re.compile(r"AKIA[0-9A-Z]{16}"),
re.compile(r"(?i)(api[_-]?key|token|secret|password)\s*[:=]\s*['\"]?[^'\"\s]+"),
re.compile(r"-----BEGIN (?:[A-Z ]*)?PRIVATE KEY-----[\s\S]+?-----END (?:[A-Z ]*)?PRIVATE KEY-----")
]
def redact(text: str) -> str:
redacted = text
for pattern in SECRET_PATTERNS:
redacted = pattern.sub("[REDACTED]", redacted)
return redacted
Prevent path traversal attacks by resolving symlinks and asserting containment.
from pathlib import Path
def safe_child_path(base_dir: Path, user_path: str) -> Path:
base = base_dir.resolve()
target = (base / user_path).resolve()
if not target.is_relative_to(base):
raise ValueError("Path traversal blocked")
return target
Never use shell=True or pass concatenated strings to the shell. Always use argument arrays.
# GOOD:
subprocess.run(["tar", "-xzf", "archive.tar.gz", "-C", "/tmp/extracted"])
# BAD:
# subprocess.run(f"tar -xzf archive.tar.gz -C {user_input}", shell=True)
Always store passwords or sensitive verification tokens using memory-hard Argon2id parameters.
from argon2 import PasswordHasher
PASSWORD_HASHER = PasswordHasher(
time_cost=3,
memory_cost=65536,
parallelism=4,
hash_len=32,
salt_len=16,
)