ecdat 0.2.0__py3-none-any.whl

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.
Files changed (51) hide show
  1. ecdat/__init__.py +10 -0
  2. ecdat/__main__.py +5 -0
  3. ecdat/cli/__init__.py +203 -0
  4. ecdat/cli/commands/__init__.py +0 -0
  5. ecdat/cli/commands/about.py +130 -0
  6. ecdat/cli/commands/demo.py +116 -0
  7. ecdat/cli/commands/doctor.py +296 -0
  8. ecdat/cli/commands/help_cmd.py +205 -0
  9. ecdat/cli/commands/scan.py +228 -0
  10. ecdat/cli/commands/version_cmd.py +48 -0
  11. ecdat/cli/parser.py +87 -0
  12. ecdat/demo_project/auth/login.py +75 -0
  13. ecdat/demo_project/certs/cert_verify.go +81 -0
  14. ecdat/demo_project/keyexchange/channel.go +48 -0
  15. ecdat/demo_project/legacy/LegacyCrypto.java +78 -0
  16. ecdat/demo_project/payments/payment.py +64 -0
  17. ecdat/demo_project/quantum/pqc_utils.py +67 -0
  18. ecdat/demo_project/quantum/slh_signer.py +40 -0
  19. ecdat/demo_project/tokens/signing.js +54 -0
  20. ecdat/py.typed +0 -0
  21. ecdat/services/__init__.py +1 -0
  22. ecdat/services/crashlog.py +109 -0
  23. ecdat/services/demo.py +85 -0
  24. ecdat/services/paths.py +52 -0
  25. ecdat/services/scanner.py +248 -0
  26. ecdat/services/viewmodel.py +326 -0
  27. ecdat/ui/__init__.py +1 -0
  28. ecdat/ui/art3d.py +136 -0
  29. ecdat/ui/art_static.py +65 -0
  30. ecdat/ui/art_text.py +81 -0
  31. ecdat/ui/banner.py +148 -0
  32. ecdat/ui/console.py +119 -0
  33. ecdat/ui/motion.py +64 -0
  34. ecdat/ui/render.py +486 -0
  35. ecdat/ui/theme.py +173 -0
  36. ecdat-0.2.0.dist-info/METADATA +142 -0
  37. ecdat-0.2.0.dist-info/RECORD +51 -0
  38. ecdat-0.2.0.dist-info/WHEEL +5 -0
  39. ecdat-0.2.0.dist-info/entry_points.txt +2 -0
  40. ecdat-0.2.0.dist-info/licenses/LICENSE +21 -0
  41. ecdat-0.2.0.dist-info/top_level.txt +2 -0
  42. ecdat_core/__init__.py +6 -0
  43. ecdat_core/cbom_export.py +287 -0
  44. ecdat_core/cli.py +202 -0
  45. ecdat_core/detector.py +273 -0
  46. ecdat_core/ingestion.py +581 -0
  47. ecdat_core/models.py +145 -0
  48. ecdat_core/recommender.py +74 -0
  49. ecdat_core/risk_engine.py +264 -0
  50. ecdat_core/signature_loader.py +204 -0
  51. ecdat_core/signatures.json +692 -0
@@ -0,0 +1,692 @@
1
+ [
2
+ {
3
+ "name": "RSA",
4
+ "family": "asymmetric-encryption",
5
+ "quantum_vulnerable": true,
6
+ "classically_broken": false,
7
+ "threat_horizon_years_default": 15,
8
+ "patterns": {
9
+ "python": [
10
+ "RSA\\.generate\\s*\\(",
11
+ "RSA\\.import_key\\s*\\(",
12
+ "RSA\\.construct\\s*\\(",
13
+ "from\\s+cryptography\\.hazmat\\.primitives\\.asymmetric\\s+import\\s+.*\\bRSA\\b",
14
+ "from\\s+Crypto\\.PublicKey\\s+import\\s+.*\\bRSA\\b",
15
+ "rsa\\.newkeys\\s*\\("
16
+ ],
17
+ "javascript": [
18
+ "crypto\\.generateKeyPairSync\\([^)]*['\"](rsa|rsa-pss)['\"]",
19
+ "crypto\\.generateKeyPair\\([^)]*['\"](rsa|rsa-pss)['\"]",
20
+ "new\\s+JSEncrypt\\s*\\("
21
+ ],
22
+ "java": [
23
+ "KeyPairGenerator\\.getInstance\\s*\\(\\s*[\"']RSA[\"']\\s*\\)",
24
+ "Cipher\\.getInstance\\s*\\(\\s*[\"']RSA/",
25
+ "AlgorithmParameterGenerator\\.getInstance\\s*\\(\\s*[\"']RSA[\"']\\s*\\)"
26
+ ],
27
+ "go": [
28
+ "rsa\\.GenerateKey\\s*\\(",
29
+ "rsa\\.GenerateMultiPrimeKey\\s*\\(",
30
+ "x509\\.ParsePKCS1PublicKey\\s*\\(",
31
+ "x509\\.ParsePKCS1PrivateKey\\s*\\("
32
+ ],
33
+ "c_cpp": [
34
+ "RSA_generate_key\\s*\\(",
35
+ "RSA_new\\s*\\(",
36
+ "EVP_PKEY_RSA\\b",
37
+ "RSA_generate_key_ex\\s*\\("
38
+ ]
39
+ },
40
+ "key_size_pattern": "(?:RSA\\.generate\\s*\\(\\s*|rsa\\.newkeys\\s*\\(\\s*|rsa\\.GenerateKey\\(rand,\\s*|RSA_generate_key\\s*\\(\\s*|RSA_generate_key_ex\\s*\\([^,]+,\\s*)(\\d{3,4})",
41
+ "pqc_recommendation": {
42
+ "algorithm": "ML-KEM (FIPS 203)",
43
+ "fips_reference": "FIPS 203",
44
+ "rationale": "RSA key exchange and encryption are broken by Shor's algorithm on a sufficiently large quantum computer. ML-KEM is the NIST-selected KEM for post-quantum key establishment. For RSA signatures, migrate to ML-DSA (FIPS 204), with SLH-DSA (FIPS 205) as the conservative hash-based alternative.",
45
+ "latency_note": "ML-KEM key generation and encapsulation are typically faster than RSA but produce larger ciphertexts and keys.",
46
+ "migration_note": "Replace RSA key generation/encryption with ML-KEM key encapsulation; update certificate formats and TLS configuration."
47
+ }
48
+ },
49
+ {
50
+ "name": "DH",
51
+ "family": "asymmetric-encryption",
52
+ "quantum_vulnerable": true,
53
+ "classically_broken": false,
54
+ "threat_horizon_years_default": 15,
55
+ "patterns": {
56
+ "python": [
57
+ "DH\\.generate_parameters\\s*\\(",
58
+ "from\\s+cryptography\\.hazmat\\.primitives\\.asymmetric\\s+import\\s+.*\\bDH\\b",
59
+ "DiffieHellman\\b"
60
+ ],
61
+ "javascript": [
62
+ "crypto\\.createDiffieHellman\\s*\\(",
63
+ "crypto\\.getDiffieHellman\\s*\\("
64
+ ],
65
+ "java": [
66
+ "KeyPairGenerator\\.getInstance\\s*\\(\\s*[\"']DH[\"']\\s*\\)",
67
+ "AlgorithmParameterGenerator\\.getInstance\\s*\\(\\s*[\"']DH[\"']\\s*\\)"
68
+ ],
69
+ "go": [
70
+ "dh\\.GenerateKey\\b",
71
+ "DH\\b"
72
+ ],
73
+ "c_cpp": [
74
+ "DH_new\\s*\\(",
75
+ "DH_generate_key\\s*\\(",
76
+ "EVP_PKEY_DH\\b"
77
+ ]
78
+ },
79
+ "key_size_pattern": null,
80
+ "pqc_recommendation": {
81
+ "algorithm": "ML-KEM (FIPS 203)",
82
+ "fips_reference": "FIPS 203",
83
+ "rationale": "Classic Diffie-Hellman key exchange is vulnerable to Shor's algorithm. ML-KEM is the NIST-selected KEM for post-quantum key establishment and the recommended replacement.",
84
+ "latency_note": "ML-KEM offers efficient encapsulation with modest performance overhead versus classic DH.",
85
+ "migration_note": "Adopt hybrid key exchange (classic DH + ML-KEM) during transition, then drop classic DH."
86
+ }
87
+ },
88
+ {
89
+ "name": "ECDH",
90
+ "family": "asymmetric-encryption",
91
+ "quantum_vulnerable": true,
92
+ "classically_broken": false,
93
+ "threat_horizon_years_default": 15,
94
+ "patterns": {
95
+ "python": [
96
+ "ECDH\\.generate\\s*\\(",
97
+ "from\\s+cryptography\\.hazmat\\.primitives\\.asymmetric\\.ec\\s+import\\s+.*\\bECDH\\b",
98
+ "ec\\.generate_private_key\\s*\\([^)]*SECP"
99
+ ],
100
+ "javascript": [
101
+ "crypto\\.createECDH\\s*\\(",
102
+ "ecdh\\.generateKeys\\s*\\(",
103
+ "generateKeyPairSync\\([^)]*['\"]ec['\"]"
104
+ ],
105
+ "java": [
106
+ "KeyAgreement\\.getInstance\\s*\\(\\s*[\"']ECDH[\"']\\s*\\)",
107
+ "KeyPairGenerator\\.getInstance\\s*\\(\\s*[\"']EC[\"']\\s*\\)"
108
+ ],
109
+ "go": [
110
+ "ecdh\\.P256\\s*\\(",
111
+ "ecdh\\.P384\\s*\\(",
112
+ "ecdh\\.P521\\s*\\(",
113
+ "elliptic\\.P256\\(\\)",
114
+ "ecdsa\\.GenerateKey\\b"
115
+ ],
116
+ "c_cpp": [
117
+ "EVP_PKEY_EC\\b",
118
+ "EC_KEY_new\\s*\\(",
119
+ "ECDH_compute_key\\s*\\("
120
+ ]
121
+ },
122
+ "key_size_pattern": null,
123
+ "pqc_recommendation": {
124
+ "algorithm": "ML-KEM (FIPS 203)",
125
+ "fips_reference": "FIPS 203",
126
+ "rationale": "Elliptic-curve Diffie-Hellman key exchange is broken by Shor's algorithm. ML-KEM is the NIST-selected KEM for post-quantum key establishment and the recommended replacement.",
127
+ "latency_note": "ML-KEM has comparable or better CPU performance than ECDH but larger public keys and ciphertexts.",
128
+ "migration_note": "Use hybrid ECDH+ML-KEM key exchange during migration to preserve forward secrecy against harvest-now-decrypt-later."
129
+ }
130
+ },
131
+ {
132
+ "name": "ECDSA",
133
+ "family": "signature",
134
+ "quantum_vulnerable": true,
135
+ "classically_broken": false,
136
+ "threat_horizon_years_default": 15,
137
+ "patterns": {
138
+ "python": [
139
+ "ECDSA\\.generate\\s*\\(",
140
+ "from\\s+cryptography\\.hazmat\\.primitives\\.asymmetric\\.ec\\s+import\\s+.*\\bECDSA\\b",
141
+ "ec\\.generate_private_key\\s*\\(",
142
+ "from\\s+Crypto\\.PublicKey\\s+import\\s+.*\\bECC\\b",
143
+ "from\\s+Crypto\\.Signature\\s+import\\s+.*\\bDSS\\b",
144
+ "DSS\\.new\\s*\\(",
145
+ "\\becdsa\\b"
146
+ ],
147
+ "javascript": [
148
+ "crypto\\.sign\\s*\\([^)]*['\"](sha256|sha384)['\"][^)]*ecdsa",
149
+ "generateKeyPairSync\\([^)]*['\"]ec['\"]",
150
+ "\\bECDSA\\b",
151
+ "elliptic\\.\\s*ec\\s*\\("
152
+ ],
153
+ "java": [
154
+ "Signature\\.getInstance\\s*\\(\\s*[\"'](?:SHA\\d+with|NONEwith)ECDSA[\"']\\s*\\)",
155
+ "KeyPairGenerator\\.getInstance\\s*\\(\\s*[\"']EC[\"']\\s*\\)"
156
+ ],
157
+ "go": [
158
+ "ecdsa\\.GenerateKey\\s*\\(",
159
+ "ecdsa\\.Sign\\s*\\(",
160
+ "ecdsa\\.Verify\\s*\\(",
161
+ "elliptic\\.P256\\(\\)"
162
+ ],
163
+ "c_cpp": [
164
+ "ECDSA_sign\\s*\\(",
165
+ "ECDSA_verify\\s*\\(",
166
+ "ECDSA_do_sign\\s*\\(",
167
+ "EVP_PKEY_EC\\b"
168
+ ]
169
+ },
170
+ "key_size_pattern": null,
171
+ "pqc_recommendation": {
172
+ "algorithm": "ML-DSA (FIPS 204)",
173
+ "fips_reference": "FIPS 204",
174
+ "rationale": "ECDSA signatures are broken by Shor's algorithm. ML-DSA is the NIST-selected lattice-based signature scheme. For a conservative hash-based alternative, consider SLH-DSA (FIPS 205).",
175
+ "latency_note": "ML-DSA signing is fast; verification is slower and signatures are larger (2.4-4.6 KB) than ECDSA.",
176
+ "migration_note": "Update certificate and signature verification stacks to accept ML-DSA; consider SLH-DSA where hash-based assurance is preferred."
177
+ }
178
+ },
179
+ {
180
+ "name": "DSA",
181
+ "family": "signature",
182
+ "quantum_vulnerable": true,
183
+ "classically_broken": false,
184
+ "threat_horizon_years_default": 15,
185
+ "patterns": {
186
+ "python": [
187
+ "DSA\\.generate\\s*\\(",
188
+ "DSA\\.import_key\\s*\\(",
189
+ "from\\s+cryptography\\.hazmat\\.primitives\\.asymmetric\\s+import\\s+.*\\bDSA\\b",
190
+ "from\\s+Crypto\\.PublicKey\\s+import\\s+.*\\bDSA\\b",
191
+ "from\\s+Crypto\\.Signature\\s+import\\s+.*\\bDSS\\b",
192
+ "DSS\\.new\\s*\\(",
193
+ "dsa\\.generate_private_key\\s*\\("
194
+ ],
195
+ "javascript": [
196
+ "crypto\\.generateKeyPairSync\\([^)]*['\"]dsa['\"]",
197
+ "crypto\\.sign\\s*\\([^)]*['\"]dsa['\"]"
198
+ ],
199
+ "java": [
200
+ "Signature\\.getInstance\\s*\\(\\s*[\"'](?:SHA\\d+with|NONEwith)DSA[\"']\\s*\\)",
201
+ "KeyPairGenerator\\.getInstance\\s*\\(\\s*[\"']DSA[\"']\\s*\\)"
202
+ ],
203
+ "go": [
204
+ "dsa\\.GenerateKey\\s*\\(",
205
+ "dsa\\.Sign\\b",
206
+ "dsa\\.Verify\\b"
207
+ ],
208
+ "c_cpp": [
209
+ "DSA_generate_key\\s*\\(",
210
+ "DSA_new\\s*\\(",
211
+ "DSA_sign\\s*\\(",
212
+ "EVP_PKEY_DSA\\b"
213
+ ]
214
+ },
215
+ "key_size_pattern": "(?:DSA\\.generate\\s*\\(\\s*|dsa\\.generate_private_key\\s*\\(\\s*key_size=\\s*|dsa\\.GenerateKey\\(\\s*params.*key_size|DSA_generate_key\\s*\\()[\\w.]*(\\d{3,4})",
216
+ "pqc_recommendation": {
217
+ "algorithm": "ML-DSA (FIPS 204)",
218
+ "fips_reference": "FIPS 204",
219
+ "rationale": "DSA signatures are broken by Shor's algorithm. ML-DSA is the NIST-selected lattice-based signature scheme. For a conservative hash-based alternative, consider SLH-DSA (FIPS 205).",
220
+ "latency_note": "ML-DSA signatures are larger than DSA but verification is generally acceptable for most workloads.",
221
+ "migration_note": "Migrate signature verification to ML-DSA; DSA is deprecated in most toolchains and should be phased out."
222
+ }
223
+ },
224
+ {
225
+ "name": "ECC generic key generation",
226
+ "family": "asymmetric-encryption",
227
+ "quantum_vulnerable": true,
228
+ "classically_broken": false,
229
+ "threat_horizon_years_default": 15,
230
+ "patterns": {
231
+ "python": [
232
+ "ec\\.generate_private_key\\s*\\(",
233
+ "from\\s+cryptography\\.hazmat\\.primitives\\.asymmetric\\s+import\\s+.*\\bEC\\b",
234
+ "ECC\\.generate\\s*\\(",
235
+ "ECC\\.import_key\\s*\\(",
236
+ "from\\s+Crypto\\.PublicKey\\s+import\\s+.*\\bECC\\b",
237
+ "SECP256R1\\b",
238
+ "SECP384R1\\b",
239
+ "SECP521R1\\b"
240
+ ],
241
+ "javascript": [
242
+ "generateKeyPairSync\\([^)]*['\"]ec['\"]",
243
+ "crypto\\.createECDH\\s*\\(",
244
+ "\\bsecp256k1\\b"
245
+ ],
246
+ "java": [
247
+ "KeyPairGenerator\\.getInstance\\s*\\(\\s*[\"']EC[\"']\\s*\\)",
248
+ "ECGenParameterSpec\\s*\\(",
249
+ "\\bsecp256r1\\b",
250
+ "\\bsecp256k1\\b"
251
+ ],
252
+ "go": [
253
+ "elliptic\\.(P224|P256|P384|P521)\\s*\\(\\s*\\)",
254
+ "ecdh\\.P256\\s*\\(",
255
+ "ecdsa\\.GenerateKey\\s*\\("
256
+ ],
257
+ "c_cpp": [
258
+ "EC_KEY_new_by_curve_name\\s*\\(",
259
+ "EVP_PKEY_EC\\b",
260
+ "NID_X9_62_prime256v1\\b",
261
+ "NID_secp384r1\\b"
262
+ ]
263
+ },
264
+ "key_size_pattern": "(?:elliptic\\.P(\\d{3})\\s*\\(\\s*\\)|generate_private_key\\s*\\([^)]*curve\\s*\\([^)]*(R|r)(\\d{3,4}))",
265
+ "pqc_recommendation": {
266
+ "algorithm": "ML-KEM (FIPS 203) / ML-DSA (FIPS 204)",
267
+ "fips_reference": "FIPS 203",
268
+ "rationale": "Generic elliptic-curve key generation underpins ECDH/ECDSA, both broken by Shor's algorithm. Replace key exchange with ML-KEM (FIPS 203) and signatures with ML-DSA (FIPS 204); SLH-DSA (FIPS 205) is a conservative hash-based alternative for signatures.",
269
+ "latency_note": "ML-KEM and ML-DSA have acceptable latency but produce larger keys and signatures than ECC.",
270
+ "migration_note": "Audit all uses of generic EC key generation to determine whether they feed key exchange or signatures, then migrate accordingly."
271
+ }
272
+ },
273
+ {
274
+ "name": "MD5",
275
+ "family": "hash",
276
+ "quantum_vulnerable": false,
277
+ "classically_broken": true,
278
+ "threat_horizon_years_default": 1,
279
+ "patterns": {
280
+ "python": [
281
+ "hashlib\\.md5\\s*\\(",
282
+ "from\\s+Crypto\\.Hash\\s+import\\s+.*\\bMD5\\b",
283
+ "MD5\\.new\\s*\\(",
284
+ "md5\\s*\\(",
285
+ "\\bMD5\\b"
286
+ ],
287
+ "javascript": [
288
+ "crypto\\.createHash\\s*\\(\\s*['\"]md5['\"]\\s*\\)",
289
+ "\\bmd5\\b",
290
+ "from\\s+['\"](?:crypto-js/md5|md5)['\"]"
291
+ ],
292
+ "java": [
293
+ "MessageDigest\\.getInstance\\s*\\(\\s*[\"']MD5[\"']\\s*\\)",
294
+ "\\bMD5\\b"
295
+ ],
296
+ "go": [
297
+ "crypto/md5\"",
298
+ "md5\\.New\\s*\\(",
299
+ "md5\\.Sum\\s*\\("
300
+ ],
301
+ "c_cpp": [
302
+ "EVP_md5\\s*\\(",
303
+ "MD5_Init\\s*\\(",
304
+ "MD5_Update\\s*\\(",
305
+ "MD5_Final\\s*\\(",
306
+ "\\bMD5\\b"
307
+ ]
308
+ },
309
+ "key_size_pattern": null,
310
+ "pqc_recommendation": {
311
+ "algorithm": "SHA-256 / SHA-3",
312
+ "fips_reference": "N/A (classical collision weakness, not quantum-specific)",
313
+ "rationale": "MD5 has broken collision resistance and is unsuitable for any security-sensitive use, independent of quantum computing. Replace with a modern collision-resistant hash such as SHA-256 or SHA-3.",
314
+ "latency_note": "SHA-256 and SHA-3 are computationally comparable to MD5 in most workloads.",
315
+ "migration_note": "Replace all MD5 usage (checksums, HMAC, signatures) with SHA-256 or SHA-3; do not use MD5 even in non-security contexts."
316
+ }
317
+ },
318
+ {
319
+ "name": "SHA-1",
320
+ "family": "hash",
321
+ "quantum_vulnerable": false,
322
+ "classically_broken": true,
323
+ "threat_horizon_years_default": 1,
324
+ "patterns": {
325
+ "python": [
326
+ "hashlib\\.sha1\\s*\\(",
327
+ "from\\s+Crypto\\.Hash\\s+import\\s+.*\\bSHA1\\b",
328
+ "SHA1\\.new\\s*\\(",
329
+ "sha1\\s*\\(",
330
+ "\\bSHA1\\b",
331
+ "\\bSHA-1\\b"
332
+ ],
333
+ "javascript": [
334
+ "crypto\\.createHash\\s*\\(\\s*['\"]sha1['\"]\\s*\\)",
335
+ "\\bsha1\\b",
336
+ "\\bSHA-1\\b"
337
+ ],
338
+ "java": [
339
+ "MessageDigest\\.getInstance\\s*\\(\\s*[\"']SHA-1[\"']\\s*\\)",
340
+ "\\bSHA-1\\b",
341
+ "\\bSHA1\\b"
342
+ ],
343
+ "go": [
344
+ "crypto/sha1\"",
345
+ "sha1\\.New\\s*\\(",
346
+ "sha1\\.Sum\\s*\\("
347
+ ],
348
+ "c_cpp": [
349
+ "EVP_sha1\\s*\\(",
350
+ "SHA1_Init\\s*\\(",
351
+ "SHA1_Update\\s*\\(",
352
+ "SHA1_Final\\s*\\(",
353
+ "\\bSHA-1\\b",
354
+ "\\bSHA1\\b"
355
+ ]
356
+ },
357
+ "key_size_pattern": null,
358
+ "pqc_recommendation": {
359
+ "algorithm": "SHA-256 / SHA-3",
360
+ "fips_reference": "N/A (classical collision weakness, not quantum-specific)",
361
+ "rationale": "SHA-1 has demonstrated collision attacks and is deprecated across major toolchains, independent of quantum computing. Replace with SHA-256 or SHA-3.",
362
+ "latency_note": "SHA-256 is a direct drop-in with negligible performance difference.",
363
+ "migration_note": "Replace SHA-1 in signatures, certificates, and hashing with SHA-256 or SHA-3; move immediately due to collision attacks."
364
+ }
365
+ },
366
+ {
367
+ "name": "DES",
368
+ "family": "symmetric-encryption",
369
+ "quantum_vulnerable": false,
370
+ "classically_broken": true,
371
+ "threat_horizon_years_default": 1,
372
+ "patterns": {
373
+ "python": [
374
+ "DES\\.new\\s*\\(",
375
+ "from\\s+Crypto\\.Cipher\\s+import\\s+.*\\bDES\\b",
376
+ "\\bDES\\b(?![-_])"
377
+ ],
378
+ "javascript": [
379
+ "crypto\\.createCipheriv\\s*\\(\\s*['\"]des-",
380
+ "des-ecb\\b",
381
+ "des-cbc\\b"
382
+ ],
383
+ "java": [
384
+ "Cipher\\.getInstance\\s*\\(\\s*[\"']DES[\"']\\s*\\)",
385
+ "Cipher\\.getInstance\\s*\\(\\s*[\"']DES/",
386
+ "SecretKeyFactory\\.getInstance\\s*\\(\\s*[\"']DES[\"']\\s*\\)"
387
+ ],
388
+ "go": [
389
+ "des\\.NewCipher\\s*\\(",
390
+ "crypto/des\""
391
+ ],
392
+ "c_cpp": [
393
+ "DES_set_key\\s*\\(",
394
+ "DES_ecb_encrypt\\s*\\(",
395
+ "DES_ncbc_encrypt\\s*\\(",
396
+ "EVP_des_cbc\\s*\\("
397
+ ]
398
+ },
399
+ "key_size_pattern": null,
400
+ "pqc_recommendation": {
401
+ "algorithm": "AES-256-GCM",
402
+ "fips_reference": "N/A",
403
+ "rationale": "DES uses a 56-bit key that is trivially brute-forceable and is considered broken in classical computing. Replace with an authenticated modern cipher: AES-256-GCM.",
404
+ "latency_note": "AES-256-GCM is hardware-accelerated and faster than DES on modern CPUs.",
405
+ "migration_note": "Replace DES encryption with AES-256-GCM, adding authentication and nonce management."
406
+ }
407
+ },
408
+ {
409
+ "name": "3DES",
410
+ "family": "symmetric-encryption",
411
+ "quantum_vulnerable": false,
412
+ "classically_broken": true,
413
+ "threat_horizon_years_default": 1,
414
+ "patterns": {
415
+ "python": [
416
+ "DES3\\.new\\s*\\(",
417
+ "from\\s+Crypto\\.Cipher\\s+import\\s+.*\\bDES3\\b",
418
+ "\\b3DES\\b",
419
+ "\\bTripleDES\\b"
420
+ ],
421
+ "javascript": [
422
+ "crypto\\.createCipheriv\\s*\\(\\s*['\"]des-ede3",
423
+ "des-ede3-cbc\\b",
424
+ "\\btripledes\\b"
425
+ ],
426
+ "java": [
427
+ "Cipher\\.getInstance\\s*\\(\\s*[\"']DESede[\"']\\s*\\)",
428
+ "Cipher\\.getInstance\\s*\\(\\s*[\"']DESede/",
429
+ "SecretKeyFactory\\.getInstance\\s*\\(\\s*[\"']DESede[\"']\\s*\\)"
430
+ ],
431
+ "go": [
432
+ "des\\.NewTripleDESCipher\\s*\\(",
433
+ "\\bTripleDES\\b"
434
+ ],
435
+ "c_cpp": [
436
+ "DES_ecb3_encrypt\\s*\\(",
437
+ "DES_ede3_cbc_encrypt\\s*\\(",
438
+ "EVP_des_ede3_cbc\\s*\\("
439
+ ]
440
+ },
441
+ "key_size_pattern": null,
442
+ "pqc_recommendation": {
443
+ "algorithm": "AES-256-GCM",
444
+ "fips_reference": "N/A",
445
+ "rationale": "Triple DES, while offering a 112-bit effective key, is slow, dated, and being deprecated (NIST retires 3DES in 2023-2024). Replace with AES-256-GCM.",
446
+ "latency_note": "3DES is significantly slower than AES-256, which is hardware-accelerated.",
447
+ "migration_note": "Replace 3DES with AES-256-GCM; plan retirement before NIST deprecation deadlines."
448
+ }
449
+ },
450
+ {
451
+ "name": "RC4",
452
+ "family": "symmetric-encryption",
453
+ "quantum_vulnerable": false,
454
+ "classically_broken": true,
455
+ "threat_horizon_years_default": 1,
456
+ "patterns": {
457
+ "python": [
458
+ "ARC4\\.new\\s*\\(",
459
+ "RC4\\.new\\s*\\(",
460
+ "from\\s+Crypto\\.Cipher\\s+import\\s+.*\\bARC4\\b",
461
+ "\\bARC4\\b",
462
+ "\\bRC4\\b"
463
+ ],
464
+ "javascript": [
465
+ "rc4\\b",
466
+ "crypto\\.createCipheriv\\s*\\(\\s*['\"]rc4"
467
+ ],
468
+ "java": [
469
+ "Cipher\\.getInstance\\s*\\(\\s*[\"']RC4[\"']\\s*\\)",
470
+ "Cipher\\.getInstance\\s*\\(\\s*[\"']ARCFOUR",
471
+ "\\bRC4\\b"
472
+ ],
473
+ "go": [
474
+ "rc4\\.NewCipher\\s*\\(",
475
+ "crypto/rc4\""
476
+ ],
477
+ "c_cpp": [
478
+ "RC4\\s*\\(",
479
+ "EVP_rc4\\s*\\("
480
+ ]
481
+ },
482
+ "key_size_pattern": null,
483
+ "pqc_recommendation": {
484
+ "algorithm": "AES-256-GCM",
485
+ "fips_reference": "N/A",
486
+ "rationale": "RC4 is cryptographically broken with well-known statistical biases and is banned in TLS. Replace with AES-256-GCM.",
487
+ "latency_note": "AES-256-GCM is faster and hardware-accelerated; RC4 offers no performance justification today.",
488
+ "migration_note": "Remove RC4 entirely; it is prohibited in modern protocols."
489
+ }
490
+ },
491
+ {
492
+ "name": "AES",
493
+ "family": "symmetric-encryption",
494
+ "quantum_vulnerable": true,
495
+ "classically_broken": false,
496
+ "min_quantum_safe_key_bits": 192,
497
+ "threat_horizon_years_default": 20,
498
+ "patterns": {
499
+ "python": [
500
+ "AES\\.new\\s*\\(",
501
+ "algorithms\\.AES\\s*\\(",
502
+ "from\\s+Crypto\\.Cipher\\s+import\\s+.*\\bAES\\b",
503
+ "from\\s+cryptography\\.hazmat\\.primitives\\.ciphers\\s+import\\s+.*\\bAES\\b",
504
+ "\\bAES-\\d+\\b",
505
+ "\\bAES\\b"
506
+ ],
507
+ "javascript": [
508
+ "crypto\\.createCipheriv?\\s*\\(\\s*['\"]aes-",
509
+ "['\"]aes-(?:128|192|256)-(?:cbc|ctr|gcm|ecb|cfb|ofb|ccm)['\"]",
510
+ "\\baes_(?:128|192|256)_\\w+\\b",
511
+ "(?:CryptoJS\\.)?AES\\.(?:encrypt|decrypt)\\s*\\(",
512
+ "\\bAES\\b"
513
+ ],
514
+ "java": [
515
+ "Cipher\\.getInstance\\s*\\(\\s*[\"']AES",
516
+ "KeyGenerator\\.getInstance\\s*\\(\\s*[\"']AES",
517
+ "[\"']AES/\\w+/\\w+[\"']",
518
+ "SecretKeySpec\\s*\\([^)]*\\bAES\\b",
519
+ "\\bAES-\\d+\\b"
520
+ ],
521
+ "go": [
522
+ "\"crypto/aes\"",
523
+ "aes\\.NewCipher\\s*\\(",
524
+ "aes\\.NewCTR\\s*\\(",
525
+ "aes\\.NewCBCEncrypter\\s*\\(",
526
+ "aes\\.NewCBCDecrypter\\s*\\(",
527
+ "\\baes_\\d+_\\w+\\b"
528
+ ],
529
+ "c_cpp": [
530
+ "AES_set_encrypt_key\\s*\\(",
531
+ "AES_set_decrypt_key\\s*\\(",
532
+ "EVP_aes_\\d+_(?:cbc|cfb|ofb|ctr|gcm|ecb|ccm)\\b",
533
+ "\\bAES_128\\b",
534
+ "\\bAES_192\\b",
535
+ "\\bAES_256\\b",
536
+ "\\baes_\\d+_\\w+\\b"
537
+ ]
538
+ },
539
+ "key_size_pattern": "(?:AES_set_(?:en|de)crypt_key\\s*\\([^,]+,\\s*(\\d{3})\\s*,|(?:aes|AES)[-_](\\d{3})(?:[-_][a-z0-9]+)?)",
540
+ "pqc_recommendation": {
541
+ "algorithm": "AES-256.",
542
+ "fips_reference": "N/A",
543
+ "rationale": "Grover's algorithm halves the effective symmetric security margin: AES-128 (~128-bit classical) offers only ~64-bit post-quantum security, below the 192-bit min_quantum_safe_key_bits threshold and should be flagged. AES-192 retains ~96-bit and AES-256 retains ~128-bit post-quantum security — both above the threshold and acceptable.",
544
+ "latency_note": "AES-256 is only ~40% slower than AES-128 and is hardware-accelerated on modern CPUs.",
545
+ "migration_note": "Upgrade AES-128 to AES-256 across encryption, key wrapping, and authenticated encryption. Note: AES-192 provides ~96-bit post-quantum security and is also below 128-bit; AES-256 is recommended."
546
+ }
547
+ },
548
+ {
549
+ "name": "ML-KEM",
550
+ "family": "pqc-kem",
551
+ "quantum_vulnerable": false,
552
+ "classically_broken": false,
553
+ "threat_horizon_years_default": 0,
554
+ "patterns": {
555
+ "python": [
556
+ "ML-KEM\\b",
557
+ "Kyber\\b",
558
+ "ml_kem\\b",
559
+ "MLKEM768\\b",
560
+ "MLKEM1024\\b"
561
+ ],
562
+ "javascript": [
563
+ "ML-KEM\\b",
564
+ "Kyber\\b",
565
+ "MLKEM768\\b",
566
+ "mlkem\\b"
567
+ ],
568
+ "java": [
569
+ "ML-KEM\\b",
570
+ "Kyber\\b",
571
+ "MLKEM768\\b",
572
+ "ML\\-KEM\\b",
573
+ "\\bKyberKeyPairGenerator\\b"
574
+ ],
575
+ "go": [
576
+ "ML-KEM\\b",
577
+ "mlkem\\b",
578
+ "MLKEM768\\b",
579
+ "Kyber\\b"
580
+ ],
581
+ "c_cpp": [
582
+ "ML-KEM\\b",
583
+ "MLKEM768\\b",
584
+ "kyber\\b",
585
+ "Kyber\\b",
586
+ "crypto_kem\\b"
587
+ ]
588
+ },
589
+ "key_size_pattern": null,
590
+ "pqc_recommendation": {
591
+ "algorithm": "ML-KEM (FIPS 203)",
592
+ "fips_reference": "FIPS 203",
593
+ "rationale": "Already a NIST-standardized post-quantum KEM. Keep using ML-KEM (preferred parameter set ML-KEM-768 for 'future' security).",
594
+ "latency_note": "ML-KEM is efficient; no latency concern.",
595
+ "migration_note": "No migration required. Standardize on ML-KEM-768 or ML-KEM-1024 parameter sets."
596
+ }
597
+ },
598
+ {
599
+ "name": "ML-DSA",
600
+ "family": "pqc-signature",
601
+ "quantum_vulnerable": false,
602
+ "classically_broken": false,
603
+ "threat_horizon_years_default": 0,
604
+ "patterns": {
605
+ "python": [
606
+ "ML-DSA\\b",
607
+ "Dilithium\\b",
608
+ "ml_dsa\\b",
609
+ "MLDSA44\\b",
610
+ "MLDSA65\\b",
611
+ "MLDSA87\\b"
612
+ ],
613
+ "javascript": [
614
+ "ML-DSA\\b",
615
+ "Dilithium\\b",
616
+ "MLDSA44\\b",
617
+ "mldsa\\b"
618
+ ],
619
+ "java": [
620
+ "ML-DSA\\b",
621
+ "Dilithium\\b",
622
+ "MLDSA44\\b",
623
+ "\\bDilithiumSignature\\b"
624
+ ],
625
+ "go": [
626
+ "ML-DSA\\b",
627
+ "mldsa\\b",
628
+ "MLDSA44\\b",
629
+ "Dilithium\\b"
630
+ ],
631
+ "c_cpp": [
632
+ "ML-DSA\\b",
633
+ "MLDSA44\\b",
634
+ "dilithium\\b",
635
+ "Dilithium\\b"
636
+ ]
637
+ },
638
+ "key_size_pattern": null,
639
+ "pqc_recommendation": {
640
+ "algorithm": "ML-DSA (FIPS 204)",
641
+ "fips_reference": "FIPS 204",
642
+ "rationale": "Already a NIST-standardized post-quantum signature scheme. Keep using ML-DSA; SLH-DSA (FIPS 205) is available as a conservative hash-based alternative if desired.",
643
+ "latency_note": "ML-DSA signing is fast; verification is slower and signatures are large (~2.4-4.6 KB).",
644
+ "migration_note": "No migration required. Standardize on ML-DSA-44/65/87 depending on security level."
645
+ }
646
+ },
647
+ {
648
+ "name": "SLH-DSA",
649
+ "family": "pqc-signature",
650
+ "quantum_vulnerable": false,
651
+ "classically_broken": false,
652
+ "threat_horizon_years_default": 0,
653
+ "patterns": {
654
+ "python": [
655
+ "SLH-DSA\\b",
656
+ "SPHINCS\\+\\b",
657
+ "sphincs\\b",
658
+ "SLHDSA\\b"
659
+ ],
660
+ "javascript": [
661
+ "SLH-DSA\\b",
662
+ "SPHINCS\\+\\b",
663
+ "sphincs\\b",
664
+ "SLHDSA\\b"
665
+ ],
666
+ "java": [
667
+ "SLH-DSA\\b",
668
+ "SPHINCS\\+\\b",
669
+ "sphincs\\b"
670
+ ],
671
+ "go": [
672
+ "SLH-DSA\\b",
673
+ "sphincs\\b",
674
+ "SLHDSA\\b"
675
+ ],
676
+ "c_cpp": [
677
+ "SLH-DSA\\b",
678
+ "SPHINCS\\+\\b",
679
+ "sphincs\\b",
680
+ "crypto_sign\\b"
681
+ ]
682
+ },
683
+ "key_size_pattern": null,
684
+ "pqc_recommendation": {
685
+ "algorithm": "SLH-DSA (FIPS 205)",
686
+ "fips_reference": "FIPS 205",
687
+ "rationale": "Already a NIST-standardized stateless hash-based post-quantum signature scheme. Keep using SLH-DSA where conservative hash-based assurance is preferred.",
688
+ "latency_note": "SLH-DSA has larger signatures and slower signing than ML-DSA; acceptable where long-term conservative security is required.",
689
+ "migration_note": "No migration required. Use SLH-DSA where hash-based cryptographic assurance is a design requirement."
690
+ }
691
+ }
692
+ ]