@hardkeel/quantum-scan 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pqc.js CHANGED
@@ -1,32 +1,32 @@
1
- // Detects post-quantum encryption already in use (ML-KEM, ML-DSA, SLH-DSA, FN-DSA, hybrids).
2
- // Used only by the readiness score, to credit migration work. Never reported as a problem.
3
- // Order matters: the first rule that matches a line wins, so hybrids come before plain ML-KEM.
4
- const PQC_RULES = [
5
- { pattern: /\b(?:X25519|SecP256r1|SecP384r1)[-_]?MLKEM[-_]?(?:768|1024)\b|\bX25519Kyber768\b/i, algorithm: "Hybrid ML-KEM key exchange", use: "key-establishment" },
6
- { pattern: /\b(?:ML[-_]?KEM|MLKEM)(?:[-_]?(?:512|768|1024))?\b|\bcrypto\/mlkem\b/i, algorithm: "ML-KEM", use: "key-establishment" },
7
- { pattern: /\bKyber(?:512|768|1024)\b/, algorithm: "ML-KEM", use: "key-establishment" },
8
- { pattern: /\b(?:ML[-_]?DSA|MLDSA)(?:[-_]?(?:44|65|87))?\b/i, algorithm: "ML-DSA", use: "signature" },
9
- { pattern: /\bDilithium[2-5]\b/, algorithm: "ML-DSA", use: "signature" },
10
- { pattern: /\bSLH[-_]?DSA\b|\bSPHINCS\+/i, algorithm: "SLH-DSA", use: "signature" },
11
- { pattern: /\bFN[-_]?DSA\b|\bFalcon[-_]?(?:512|1024)\b/, algorithm: "FN-DSA", use: "signature" },
12
- ];
13
- const CODE_OR_CONFIG = /\.(py|pyw|js|mjs|cjs|jsx|ts|mts|cts|tsx|go|java|kt|kts|scala|rs|c|cc|cpp|h|hpp|cs|rb|php|swift|conf|cfg|ini|ya?ml|toml|tf|hcl|json|properties)$|(^|\/)(nginx|httpd)[^/]*$/i;
14
- /** Post-quantum algorithms used in one source or config file. Documentation is ignored. */
15
- export function findPqc(path, content) {
16
- if (!CODE_OR_CONFIG.test(path) || content.includes("\u0000"))
17
- return [];
18
- const out = [];
19
- const lines = content.split(/\r?\n/);
20
- for (let i = 0; i < lines.length; i++) {
21
- const text = lines[i];
22
- if (text.length > 2000)
23
- continue;
24
- for (const r of PQC_RULES) {
25
- if (r.pattern.test(text)) {
26
- out.push({ algorithm: r.algorithm, use: r.use, file: path, line: i + 1 });
27
- break;
28
- }
29
- }
30
- }
31
- return out;
32
- }
1
+ // Detects post-quantum encryption already in use (ML-KEM, ML-DSA, SLH-DSA, FN-DSA, hybrids).
2
+ // Used only by the readiness score, to credit migration work. Never reported as a problem.
3
+ // Order matters: the first rule that matches a line wins, so hybrids come before plain ML-KEM.
4
+ const PQC_RULES = [
5
+ { pattern: /\b(?:X25519|SecP256r1|SecP384r1)[-_]?MLKEM[-_]?(?:768|1024)\b|\bX25519Kyber768\b/i, algorithm: "Hybrid ML-KEM key exchange", use: "key-establishment" },
6
+ { pattern: /\b(?:ML[-_]?KEM|MLKEM)(?:[-_]?(?:512|768|1024))?\b|\bcrypto\/mlkem\b/i, algorithm: "ML-KEM", use: "key-establishment" },
7
+ { pattern: /\bKyber(?:512|768|1024)\b/, algorithm: "ML-KEM", use: "key-establishment" },
8
+ { pattern: /\b(?:ML[-_]?DSA|MLDSA)(?:[-_]?(?:44|65|87))?\b/i, algorithm: "ML-DSA", use: "signature" },
9
+ { pattern: /\bDilithium[2-5]\b/, algorithm: "ML-DSA", use: "signature" },
10
+ { pattern: /\bSLH[-_]?DSA\b|\bSPHINCS\+/i, algorithm: "SLH-DSA", use: "signature" },
11
+ { pattern: /\bFN[-_]?DSA\b|\bFalcon[-_]?(?:512|1024)\b/, algorithm: "FN-DSA", use: "signature" },
12
+ ];
13
+ const CODE_OR_CONFIG = /\.(py|pyw|js|mjs|cjs|jsx|ts|mts|cts|tsx|go|java|kt|kts|scala|rs|c|cc|cpp|h|hpp|cs|rb|php|swift|conf|cfg|ini|ya?ml|toml|tf|hcl|json|properties)$|(^|\/)(nginx|httpd)[^/]*$/i;
14
+ /** Post-quantum algorithms used in one source or config file. Documentation is ignored. */
15
+ export function findPqc(path, content) {
16
+ if (!CODE_OR_CONFIG.test(path) || content.includes("\u0000"))
17
+ return [];
18
+ const out = [];
19
+ const lines = content.split(/\r?\n/);
20
+ for (let i = 0; i < lines.length; i++) {
21
+ const text = lines[i];
22
+ if (text.length > 2000)
23
+ continue;
24
+ for (const r of PQC_RULES) {
25
+ if (r.pattern.test(text)) {
26
+ out.push({ algorithm: r.algorithm, use: r.use, file: path, line: i + 1 });
27
+ break;
28
+ }
29
+ }
30
+ }
31
+ return out;
32
+ }
package/dist/report.js CHANGED
@@ -1,179 +1,179 @@
1
- // Human-readable output: pull request comment, check-run annotations, migration report.
2
- import { gradeSentence } from "./score.js";
3
- export const COMMENT_MARKER = "<!-- hardkeel-quantum-scan -->";
4
- const SEV_ORDER = { critical: 0, high: 1, medium: 2, low: 3 };
5
- export function sortFindings(fs) {
6
- return [...fs].sort((a, b) => SEV_ORDER[a.severity] - SEV_ORDER[b.severity] || a.file.localeCompare(b.file) || a.line - b.line);
7
- }
8
- function counts(fs) {
9
- return {
10
- secrets: fs.filter((f) => f.risk === "secret").length,
11
- weak: fs.filter((f) => f.risk === "weak-now").length,
12
- quantum: fs.filter((f) => f.risk === "quantum-vulnerable").length,
13
- exposed: fs.filter((f) => f.risk === "exposed").length,
14
- };
15
- }
16
- function riskLabel(f) {
17
- if (f.risk === "secret")
18
- return "Leaked key or password";
19
- if (f.risk === "weak-now")
20
- return "Weak today";
21
- if (f.risk === "exposed")
22
- return "Exposed setting";
23
- return "Quantum-vulnerable";
24
- }
25
- function esc(s) {
26
- return s.replace(/\|/g, "\\|").replace(/`/g, "'");
27
- }
28
- /** Conclusion for the GitHub check run. Secrets and weak crypto fail; quantum-only is neutral. */
29
- export function checkConclusion(fs, blockOnQuantum = false) {
30
- const c = counts(fs);
31
- if (c.secrets || c.weak || c.exposed)
32
- return "failure";
33
- if (c.quantum)
34
- return blockOnQuantum ? "failure" : "neutral";
35
- return "success";
36
- }
37
- export function prSummaryLine(fs) {
38
- const c = counts(fs);
39
- if (!fs.length)
40
- return "No leaked keys or passwords, weak encryption, exposed infrastructure settings, or encryption quantum computers will break in this change.";
41
- const parts = [];
42
- if (c.secrets)
43
- parts.push(`${c.secrets} leaked key${c.secrets > 1 ? "s or passwords" : " or password"}`);
44
- if (c.weak)
45
- parts.push(`${c.weak} use${c.weak > 1 ? "s" : ""} of weak encryption`);
46
- if (c.exposed)
47
- parts.push(`${c.exposed} exposed infrastructure setting${c.exposed > 1 ? "s" : ""}`);
48
- if (c.quantum)
49
- parts.push(`${c.quantum} use${c.quantum > 1 ? "s" : ""} of encryption quantum computers will break`);
50
- return `This change adds ${parts.length > 1 ? parts.slice(0, -1).join(", ") + " and " + parts[parts.length - 1] : parts[0]}.`;
51
- }
52
- const LOGO = "https://avatars.githubusercontent.com/in/5838578?s=64";
53
- /** Short name for a finding, like "MD5 hash" or "RSA-1024 key". */
54
- export function shortLabel(f) {
55
- const a = f.algorithm;
56
- if (f.kind === "config" && a === "Open to the internet")
57
- return f.title; // names the ports, like "SSH (22) open to the whole internet"
58
- if (f.risk === "secret" || f.kind === "config")
59
- return a;
60
- if (a.startsWith("RSA") && f.keySize !== undefined && f.keySize < 2048)
61
- return `RSA-${f.keySize} key`;
62
- if (a === "RSA")
63
- return "RSA key";
64
- if (a === "EC")
65
- return "Elliptic-curve key";
66
- if (/(mode|signature|encryption)$/.test(a) || a.startsWith("TLS"))
67
- return a;
68
- const noun = {
69
- hash: "hash",
70
- "block-cipher": "cipher",
71
- "stream-cipher": "cipher",
72
- signature: "signature",
73
- "key-agreement": "key exchange",
74
- "public-key-encryption": "encryption",
75
- };
76
- return noun[f.primitive] ? `${a} ${noun[f.primitive]}` : a;
77
- }
78
- function plural(n, one, many) {
79
- return `${n} ${n === 1 ? one : many}`;
80
- }
81
- /** The comment's bold first line. */
82
- export function prHeadline(fs) {
83
- const now = fs.filter((f) => f.risk !== "quantum-vulnerable").length;
84
- const later = fs.length - now;
85
- if (!fs.length)
86
- return "**Nothing to fix.** No leaked keys, weak or quantum-breakable encryption, or exposed infrastructure settings in this change.";
87
- if (!now)
88
- return `**Nothing blocks this merge.** ${plural(later, "item", "items")} to plan for, below.`;
89
- return `**${plural(now, "problem", "problems")} to fix before merging.**` + (later ? ` ${plural(later, "more item", "more items")} to plan for.` : "");
90
- }
91
- export function prComment(fs, opts = {}) {
92
- const max = opts.maxRows ?? 25;
93
- const sorted = sortFindings(fs).slice(0, max);
94
- const where = (f) => {
95
- const label = `\`${esc(f.file)}:${f.line}\``;
96
- return opts.repo && opts.sha ? `[${label}](https://github.com/${opts.repo}/blob/${opts.sha}/${encodeURI(f.file)}#L${f.line})` : label;
97
- };
98
- const table = (rows) => [
99
- "| Where | Issue | Fix |",
100
- "| --- | --- | --- |",
101
- ...rows.map((f) => `| ${where(f)} | ${esc(shortLabel(f))} | ${esc(f.fix)} |`),
102
- ];
103
- const now = sorted.filter((f) => f.risk !== "quantum-vulnerable");
104
- const later = sorted.filter((f) => f.risk === "quantum-vulnerable");
105
- const lines = [
106
- COMMENT_MARKER,
107
- `### <img src="${LOGO}" width="20" height="20" alt=""> Hard Keel Quantum Scan`,
108
- "",
109
- prHeadline(fs),
110
- ];
111
- if (now.length)
112
- lines.push("", "#### Fix before merging", "", ...table(now));
113
- if (later.length) {
114
- lines.push("", "#### Plan for later", "", "Safe today, but quantum computers will be able to break these. NIST plans to phase them out between 2030 and 2035.", "", ...table(later));
115
- }
116
- if (fs.length > max)
117
- lines.push("", `${fs.length - max} more are listed in the check results.`);
118
- if (opts.reportUrl) {
119
- lines.push("", `**[Open the full report](${opts.reportUrl})** to see every use of encryption in this repository and the order to fix them in.`);
120
- }
121
- lines.push("", "<sub>Hard Keel · hardkeel.com · Questions: contact@hardkeel.com</sub>");
122
- return lines.join("\n");
123
- }
124
- export function annotations(fs) {
125
- return sortFindings(fs).map((f) => ({
126
- path: f.file,
127
- start_line: f.line,
128
- end_line: f.line,
129
- annotation_level: f.risk === "quantum-vulnerable" ? "warning" : "failure",
130
- title: `${riskLabel(f)}: ${f.title}`,
131
- message: f.fix,
132
- }));
133
- }
134
- /** Group a full-repo scan by algorithm and rank by what to migrate first. */
135
- export function migrationPlan(fs) {
136
- const map = new Map();
137
- for (const f of fs)
138
- map.set(`${f.risk}|${f.algorithm}`, [...(map.get(`${f.risk}|${f.algorithm}`) ?? []), f]);
139
- const groups = [...map.values()].map((g) => {
140
- const f = g[0];
141
- let priority = 4;
142
- let when = "Before 2035";
143
- if (f.risk === "secret")
144
- [priority, when] = [0, "Now"];
145
- else if (f.risk === "exposed")
146
- [priority, when] = [1, "Now"];
147
- else if (f.risk === "weak-now")
148
- [priority, when] = [1, "Now"];
149
- else if (f.primitive === "key-agreement" || f.primitive === "public-key-encryption")
150
- [priority, when] = [2, "By 2030"];
151
- else
152
- [priority, when] = [3, "By 2030 to 2035"];
153
- return { algorithm: f.algorithm, risk: f.risk, count: g.length, files: [...new Set(g.map((x) => x.file))], fix: f.fix, priority, when };
154
- });
155
- return groups.sort((a, b) => a.priority - b.priority || b.count - a.count);
156
- }
157
- export function migrationReportMarkdown(repo, fs, scannedAt, score) {
158
- const plan = migrationPlan(fs);
159
- const c = counts(fs);
160
- const out = [
161
- `# Quantum readiness report: ${repo}`,
162
- "",
163
- ...(score ? [`**${gradeSentence(score)}** How the score works: https://hardkeel.com/learn/quantum-readiness-score/`, ""] : []),
164
- `Scanned ${scannedAt}. ${c.quantum} use${c.quantum === 1 ? "" : "s"} of encryption quantum computers will break, ${c.weak} of weak encryption, ${c.exposed} exposed infrastructure setting${c.exposed === 1 ? "" : "s"}, and ${c.secrets} leaked key${c.secrets === 1 ? "" : "s"} or password${c.secrets === 1 ? "" : "s"}.`,
165
- "",
166
- "NIST's final transition plan (IR 8547, October 2026) deprecates today's public-key algorithms (RSA, elliptic curve, Diffie-Hellman) after 2030 and disallows them after 2035. Key exchange comes first, because encrypted traffic recorded today can be decrypted once a large quantum computer exists.",
167
- "",
168
- "| Order | What | Uses | Files | When | Move to |",
169
- "| --- | --- | --- | --- | --- | --- |",
170
- ];
171
- plan.forEach((g, i) => {
172
- const files = g.files.slice(0, 3).map((f) => `\`${esc(f)}\``).join(", ") + (g.files.length > 3 ? ` +${g.files.length - 3}` : "");
173
- out.push(`| ${i + 1} | ${esc(g.algorithm)} | ${g.count} | ${files} | ${g.when} | ${esc(g.fix)} |`);
174
- });
175
- if (!plan.length)
176
- out.push("| | Nothing found | | | | |");
177
- out.push("", "This report lists what the scanner found in source code and infrastructure config in the repository. It does not cover compiled dependencies, running services or certificates in use. Hard Keel can assess those separately.");
178
- return out.join("\n");
179
- }
1
+ // Human-readable output: pull request comment, check-run annotations, migration report.
2
+ import { gradeSentence } from "./score.js";
3
+ export const COMMENT_MARKER = "<!-- hardkeel-quantum-scan -->";
4
+ const SEV_ORDER = { critical: 0, high: 1, medium: 2, low: 3 };
5
+ export function sortFindings(fs) {
6
+ return [...fs].sort((a, b) => SEV_ORDER[a.severity] - SEV_ORDER[b.severity] || a.file.localeCompare(b.file) || a.line - b.line);
7
+ }
8
+ function counts(fs) {
9
+ return {
10
+ secrets: fs.filter((f) => f.risk === "secret").length,
11
+ weak: fs.filter((f) => f.risk === "weak-now").length,
12
+ quantum: fs.filter((f) => f.risk === "quantum-vulnerable").length,
13
+ exposed: fs.filter((f) => f.risk === "exposed").length,
14
+ };
15
+ }
16
+ function riskLabel(f) {
17
+ if (f.risk === "secret")
18
+ return "Leaked key or password";
19
+ if (f.risk === "weak-now")
20
+ return "Weak today";
21
+ if (f.risk === "exposed")
22
+ return "Exposed setting";
23
+ return "Quantum-vulnerable";
24
+ }
25
+ function esc(s) {
26
+ return s.replace(/\|/g, "\\|").replace(/`/g, "'");
27
+ }
28
+ /** Conclusion for the GitHub check run. Secrets and weak crypto fail; quantum-only is neutral. */
29
+ export function checkConclusion(fs, blockOnQuantum = false) {
30
+ const c = counts(fs);
31
+ if (c.secrets || c.weak || c.exposed)
32
+ return "failure";
33
+ if (c.quantum)
34
+ return blockOnQuantum ? "failure" : "neutral";
35
+ return "success";
36
+ }
37
+ export function prSummaryLine(fs) {
38
+ const c = counts(fs);
39
+ if (!fs.length)
40
+ return "No leaked keys or passwords, weak encryption, exposed infrastructure settings, or encryption quantum computers will break in this change.";
41
+ const parts = [];
42
+ if (c.secrets)
43
+ parts.push(`${c.secrets} leaked key${c.secrets > 1 ? "s or passwords" : " or password"}`);
44
+ if (c.weak)
45
+ parts.push(`${c.weak} use${c.weak > 1 ? "s" : ""} of weak encryption`);
46
+ if (c.exposed)
47
+ parts.push(`${c.exposed} exposed infrastructure setting${c.exposed > 1 ? "s" : ""}`);
48
+ if (c.quantum)
49
+ parts.push(`${c.quantum} use${c.quantum > 1 ? "s" : ""} of encryption quantum computers will break`);
50
+ return `This change adds ${parts.length > 1 ? parts.slice(0, -1).join(", ") + " and " + parts[parts.length - 1] : parts[0]}.`;
51
+ }
52
+ const LOGO = "https://avatars.githubusercontent.com/in/5838578?s=64";
53
+ /** Short name for a finding, like "MD5 hash" or "RSA-1024 key". */
54
+ export function shortLabel(f) {
55
+ const a = f.algorithm;
56
+ if (f.kind === "config" && a === "Open to the internet")
57
+ return f.title; // names the ports, like "SSH (22) open to the whole internet"
58
+ if (f.risk === "secret" || f.kind === "config")
59
+ return a;
60
+ if (a.startsWith("RSA") && f.keySize !== undefined && f.keySize < 2048)
61
+ return `RSA-${f.keySize} key`;
62
+ if (a === "RSA")
63
+ return "RSA key";
64
+ if (a === "EC")
65
+ return "Elliptic-curve key";
66
+ if (/(mode|signature|encryption)$/.test(a) || a.startsWith("TLS"))
67
+ return a;
68
+ const noun = {
69
+ hash: "hash",
70
+ "block-cipher": "cipher",
71
+ "stream-cipher": "cipher",
72
+ signature: "signature",
73
+ "key-agreement": "key exchange",
74
+ "public-key-encryption": "encryption",
75
+ };
76
+ return noun[f.primitive] ? `${a} ${noun[f.primitive]}` : a;
77
+ }
78
+ function plural(n, one, many) {
79
+ return `${n} ${n === 1 ? one : many}`;
80
+ }
81
+ /** The comment's bold first line. */
82
+ export function prHeadline(fs) {
83
+ const now = fs.filter((f) => f.risk !== "quantum-vulnerable").length;
84
+ const later = fs.length - now;
85
+ if (!fs.length)
86
+ return "**Nothing to fix.** No leaked keys, weak or quantum-breakable encryption, or exposed infrastructure settings in this change.";
87
+ if (!now)
88
+ return `**Nothing blocks this merge.** ${plural(later, "item", "items")} to plan for, below.`;
89
+ return `**${plural(now, "problem", "problems")} to fix before merging.**` + (later ? ` ${plural(later, "more item", "more items")} to plan for.` : "");
90
+ }
91
+ export function prComment(fs, opts = {}) {
92
+ const max = opts.maxRows ?? 25;
93
+ const sorted = sortFindings(fs).slice(0, max);
94
+ const where = (f) => {
95
+ const label = `\`${esc(f.file)}:${f.line}\``;
96
+ return opts.repo && opts.sha ? `[${label}](https://github.com/${opts.repo}/blob/${opts.sha}/${encodeURI(f.file)}#L${f.line})` : label;
97
+ };
98
+ const table = (rows) => [
99
+ "| Where | Issue | Fix |",
100
+ "| --- | --- | --- |",
101
+ ...rows.map((f) => `| ${where(f)} | ${esc(shortLabel(f))} | ${esc(f.fix)} |`),
102
+ ];
103
+ const now = sorted.filter((f) => f.risk !== "quantum-vulnerable");
104
+ const later = sorted.filter((f) => f.risk === "quantum-vulnerable");
105
+ const lines = [
106
+ COMMENT_MARKER,
107
+ `### <img src="${LOGO}" width="20" height="20" alt=""> Hard Keel Quantum Scan`,
108
+ "",
109
+ prHeadline(fs),
110
+ ];
111
+ if (now.length)
112
+ lines.push("", "#### Fix before merging", "", ...table(now));
113
+ if (later.length) {
114
+ lines.push("", "#### Plan for later", "", "Safe today, but quantum computers will be able to break these. NIST plans to phase them out between 2030 and 2035.", "", ...table(later));
115
+ }
116
+ if (fs.length > max)
117
+ lines.push("", `${fs.length - max} more are listed in the check results.`);
118
+ if (opts.reportUrl) {
119
+ lines.push("", `**[Open the full report](${opts.reportUrl})** to see every use of encryption in this repository and the order to fix them in.`);
120
+ }
121
+ lines.push("", "<sub>Hard Keel · hardkeel.com · Questions: contact@hardkeel.com</sub>");
122
+ return lines.join("\n");
123
+ }
124
+ export function annotations(fs) {
125
+ return sortFindings(fs).map((f) => ({
126
+ path: f.file,
127
+ start_line: f.line,
128
+ end_line: f.line,
129
+ annotation_level: f.risk === "quantum-vulnerable" ? "warning" : "failure",
130
+ title: `${riskLabel(f)}: ${f.title}`,
131
+ message: f.fix,
132
+ }));
133
+ }
134
+ /** Group a full-repo scan by algorithm and rank by what to migrate first. */
135
+ export function migrationPlan(fs) {
136
+ const map = new Map();
137
+ for (const f of fs)
138
+ map.set(`${f.risk}|${f.algorithm}`, [...(map.get(`${f.risk}|${f.algorithm}`) ?? []), f]);
139
+ const groups = [...map.values()].map((g) => {
140
+ const f = g[0];
141
+ let priority = 4;
142
+ let when = "Before 2035";
143
+ if (f.risk === "secret")
144
+ [priority, when] = [0, "Now"];
145
+ else if (f.risk === "exposed")
146
+ [priority, when] = [1, "Now"];
147
+ else if (f.risk === "weak-now")
148
+ [priority, when] = [1, "Now"];
149
+ else if (f.primitive === "key-agreement" || f.primitive === "public-key-encryption")
150
+ [priority, when] = [2, "By 2030"];
151
+ else
152
+ [priority, when] = [3, "By 2030 to 2035"];
153
+ return { algorithm: f.algorithm, risk: f.risk, count: g.length, files: [...new Set(g.map((x) => x.file))], fix: f.fix, priority, when };
154
+ });
155
+ return groups.sort((a, b) => a.priority - b.priority || b.count - a.count);
156
+ }
157
+ export function migrationReportMarkdown(repo, fs, scannedAt, score) {
158
+ const plan = migrationPlan(fs);
159
+ const c = counts(fs);
160
+ const out = [
161
+ `# Quantum readiness report: ${repo}`,
162
+ "",
163
+ ...(score ? [`**${gradeSentence(score)}** How the score works: https://hardkeel.com/learn/quantum-readiness-score/`, ""] : []),
164
+ `Scanned ${scannedAt}. ${c.quantum} use${c.quantum === 1 ? "" : "s"} of encryption quantum computers will break, ${c.weak} of weak encryption, ${c.exposed} exposed infrastructure setting${c.exposed === 1 ? "" : "s"}, and ${c.secrets} leaked key${c.secrets === 1 ? "" : "s"} or password${c.secrets === 1 ? "" : "s"}.`,
165
+ "",
166
+ "NIST's final transition plan (IR 8547, October 2026) deprecates today's public-key algorithms (RSA, elliptic curve, Diffie-Hellman) after 2030 and disallows them after 2035. Key exchange comes first, because encrypted traffic recorded today can be decrypted once a large quantum computer exists.",
167
+ "",
168
+ "| Order | What | Uses | Files | When | Move to |",
169
+ "| --- | --- | --- | --- | --- | --- |",
170
+ ];
171
+ plan.forEach((g, i) => {
172
+ const files = g.files.slice(0, 3).map((f) => `\`${esc(f)}\``).join(", ") + (g.files.length > 3 ? ` +${g.files.length - 3}` : "");
173
+ out.push(`| ${i + 1} | ${esc(g.algorithm)} | ${g.count} | ${files} | ${g.when} | ${esc(g.fix)} |`);
174
+ });
175
+ if (!plan.length)
176
+ out.push("| | Nothing found | | | | |");
177
+ out.push("", "This report lists what the scanner found in source code and infrastructure config in the repository. It does not cover compiled dependencies, running services or certificates in use. Hard Keel can assess those separately.");
178
+ return out.join("\n");
179
+ }