Add crypto-inventory: a cryptographic inventory of source code as a CycloneDX 1.6 CBOM, with linear cost on hostile input; PKI DER messages in English
This commit is contained in:
1 parent
7d814d1bb8
commit
0f081f0847
49 files changed
+4342
-33
No files matched your search
Binary file not shown.
@@ -0,0 +1,30 @@
|
||||
// Fixtura: Go. In Go un import nefolosit nu compileaza, deci importul e dovada de folosire.
|
||||
package fixturi
|
||||
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"crypto/elliptic"
|
||||
"crypto/hmac"
|
||||
"crypto/md5"
|
||||
"crypto/mlkem"
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/sha1"
|
||||
"crypto/sha256" // EXPECT: SHA-256 | quantum-safe
|
||||
"crypto/tls"
|
||||
_ "crypto/sha512" // EXPECT: SHA-512 | quantum-safe
|
||||
)
|
||||
|
||||
func Exemple(data []byte) {
|
||||
k, _ := rsa.GenerateKey(rand.Reader, 3072) // EXPECT: RSA-3072 | quantum-vulnerable
|
||||
e, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) // EXPECT: ECDSA-secp256r1 | quantum-vulnerable
|
||||
s := md5.Sum(data) // EXPECT: MD5 | weak-now
|
||||
m := hmac.New(sha1.New, data) // EXPECT: HMAC-SHA-1 | weak-now
|
||||
dk, _ := mlkem.GenerateKey768() // EXPECT: ML-KEM-768 | quantum-safe
|
||||
cfg := &tls.Config{
|
||||
MinVersion: tls.VersionTLS12, // EXPECT: TLSv1.2 | quantum-vulnerable
|
||||
CurvePreferences: []tls.CurveID{tls.X25519MLKEM768, tls.CurveP256}, // EXPECT: X25519MLKEM768 | quantum-safe ; ECDH-secp256r1 | quantum-vulnerable
|
||||
}
|
||||
f := sha256.New
|
||||
_, _, _, _, _, _, _ = k, e, s, m, dk, cfg, f
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// Fixtura: JCA, JSSE si Bouncy Castle. Fisierul nu se compileaza; e doar text pentru scaner.
|
||||
package fixturi;
|
||||
|
||||
import java.security.KeyPairGenerator;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.Signature;
|
||||
import java.security.spec.ECGenParameterSpec;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.KeyAgreement;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import org.bouncycastle.crypto.engines.RC4Engine; // EXPECT: RC4 | weak-now
|
||||
import org.bouncycastle.pqc.crypto.mlkem.MLKEMParameters;
|
||||
|
||||
public class Crypto {
|
||||
private static final String DIGEST = "SHA-256";
|
||||
|
||||
public void exemple(String algDinParametru) throws Exception {
|
||||
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); // EXPECT: RSA-4096 | quantum-vulnerable
|
||||
kpg.initialize(4096);
|
||||
KeyPairGenerator ec = KeyPairGenerator.getInstance("EC"); // EXPECT: EC-secp256r1 | quantum-vulnerable
|
||||
ec.initialize(new ECGenParameterSpec("secp256r1"));
|
||||
Signature s1 = Signature.getInstance("SHA256withECDSA"); // EXPECT: ECDSA | quantum-vulnerable
|
||||
Signature s2 = Signature.getInstance("SHA1withRSA"); // EXPECT: RSA | weak-now
|
||||
Signature s3 = Signature.getInstance("ML-DSA-65"); // EXPECT: ML-DSA-65 | quantum-safe
|
||||
Cipher c1 = Cipher.getInstance("AES"); // EXPECT: AES-ECB | weak-now
|
||||
Cipher c2 = Cipher.getInstance("AES/GCM/NoPadding"); // EXPECT: AES-GCM | quantum-safe
|
||||
Cipher c3 = Cipher.getInstance("RSA/ECB/OAEPWithSHA-256AndMGF1Padding"); // EXPECT: RSA | quantum-vulnerable
|
||||
Cipher c4 = Cipher.getInstance("DESede/CBC/PKCS5Padding"); // EXPECT: 3DES-CBC | weak-now
|
||||
KeyAgreement ka = KeyAgreement.getInstance("X25519"); // EXPECT: X25519 | quantum-vulnerable
|
||||
MessageDigest md = MessageDigest.getInstance("MD5"); // EXPECT: MD5 | weak-now
|
||||
MessageDigest md2 = MessageDigest.getInstance(DIGEST); // EXPECT: SHA-256 | quantum-safe
|
||||
MessageDigest md3 = MessageDigest.getInstance(algDinParametru); // EXPECT: MessageDigest.getInstance | unknown
|
||||
SSLContext tls = SSLContext.getInstance("TLSv1.1"); // EXPECT: TLSv1.1 | weak-now
|
||||
Object p = MLKEMParameters.ml_kem_768; // EXPECT: ML-KEM-768 | quantum-safe
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// Fixtura: biblioteci recunoscute din importuri (TypeScript).
|
||||
import { Wallet, verifyMessage } from 'ethers';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { secp256k1 } from '@noble/curves/secp256k1'; // EXPECT: ECDSA-secp256k1 | quantum-vulnerable
|
||||
import { ml_dsa65 } from '@noble/post-quantum/ml-dsa'; // EXPECT: ML-DSA-65 | quantum-safe
|
||||
import { ml_kem768 } from '@noble/post-quantum/ml-kem'; // EXPECT: ML-KEM-768 | quantum-safe
|
||||
import elliptic from 'elliptic';
|
||||
import { sha1 } from '../vendor/node_modules/@noble/hashes/legacy.js'; // EXPECT: SHA-1 | weak-now
|
||||
|
||||
const ec = new elliptic.ec('p256'); // EXPECT: EC-secp256r1 | quantum-vulnerable
|
||||
|
||||
export async function semneaza(privateKey: string, payload: object) {
|
||||
const w = new Wallet(privateKey); // EXPECT: ECDSA-secp256k1 | quantum-vulnerable
|
||||
const sig = await w.signMessage('hello'); // EXPECT: ECDSA-secp256k1 | quantum-vulnerable
|
||||
const ok = verifyMessage('hello', sig); // EXPECT: ECDSA-secp256k1 | quantum-vulnerable
|
||||
const t1 = jwt.sign(payload, privateKey, { algorithm: 'RS256' }); // EXPECT: JWS RS256 | quantum-vulnerable
|
||||
const t2 = jwt.verify(t1, privateKey, { algorithms: ['ES256', 'HS256'] }); // EXPECT: JWS ES256 | quantum-vulnerable ; JWS HS256 | quantum-safe
|
||||
return { ec, ok, t2, secp256k1, ml_dsa65, ml_kem768, sha1 };
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Fixtura: node:crypto. Fiecare rand cu o folosire poarta marcajul EXPECT al gasirii asteptate.
|
||||
// Fisierul nu se executa niciodata; e doar text pentru scaner.
|
||||
import crypto from 'node:crypto';
|
||||
import { createHash, generateKeyPairSync } from 'crypto';
|
||||
|
||||
const HASH_ALG = 'sha256';
|
||||
|
||||
export function exemple(data, key, iv, algDinParametru, pemDinConfig) {
|
||||
const a = createHash('md5').update(data).digest('hex'); // EXPECT: MD5 | weak-now
|
||||
const b = crypto.createHash('sha1'); // EXPECT: SHA-1 | weak-now
|
||||
const c = crypto.createHash(HASH_ALG); // EXPECT: SHA-256 | quantum-safe
|
||||
const d = crypto.createHash(algDinParametru); // EXPECT: createHash | unknown
|
||||
const { publicKey } = generateKeyPairSync('rsa', { modulusLength: 2048 }); // EXPECT: RSA-2048 | quantum-vulnerable
|
||||
const k2 = crypto.generateKeyPairSync('ec', { namedCurve: 'secp256k1' }); // EXPECT: EC-secp256k1 | quantum-vulnerable
|
||||
const k3 = crypto.generateKeyPairSync('ed25519'); // EXPECT: Ed25519 | quantum-vulnerable
|
||||
const k4 = crypto.generateKeyPairSync('ml-dsa-65'); // EXPECT: ML-DSA-65 | quantum-safe
|
||||
const k5 = crypto.generateKeyPairSync('ml-kem-768'); // EXPECT: ML-KEM-768 | quantum-safe
|
||||
const s = crypto.createSign('RSA-SHA256'); // EXPECT: RSA | quantum-vulnerable
|
||||
const v = crypto.createVerify('SHA1'); // EXPECT: signature-with-SHA-1 | weak-now
|
||||
const e = crypto.createECDH('prime256v1'); // EXPECT: ECDH-secp256r1 | quantum-vulnerable
|
||||
const c1 = crypto.createCipheriv('aes-256-gcm', key, iv); // EXPECT: AES-256-GCM | quantum-safe
|
||||
const c2 = crypto.createCipheriv('des-ede3-cbc', key, iv); // EXPECT: 3DES-CBC | weak-now
|
||||
const c3 = crypto.createCipheriv('aes-128-ecb', key, null); // EXPECT: AES-128-ECB | weak-now
|
||||
const c4 = crypto.createDecipheriv('aes-128-cbc', key, iv); // EXPECT: AES-128-CBC | quantum-safe
|
||||
const enc = crypto.publicEncrypt(publicKey, data); // EXPECT: RSA | quantum-vulnerable
|
||||
const h = crypto.createHmac('sha256', key); // EXPECT: HMAC-SHA-256 | quantum-safe
|
||||
const dh = crypto.getDiffieHellman('modp2'); // EXPECT: DH-1024 | weak-now
|
||||
const sig = crypto.sign(null, data, key); // EXPECT: crypto.sign | unknown
|
||||
const pk = crypto.createPrivateKey(pemDinConfig); // EXPECT: createPrivateKey | unknown
|
||||
return [a, b, c, d, k2, k3, k4, k5, s, v, e, c1, c2, c3, c4, enc, h, dh, sig, pk];
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Fixtura: optiuni TLS in Node.
|
||||
const tls = require('node:tls');
|
||||
const https = require('https');
|
||||
|
||||
const server = tls.createServer({
|
||||
minVersion: 'TLSv1', // EXPECT: TLSv1.0 | weak-now
|
||||
ecdhCurve: 'X25519MLKEM768:X25519:prime256v1', // EXPECT: X25519MLKEM768 | quantum-safe ; X25519 | quantum-vulnerable ; ECDH-secp256r1 | quantum-vulnerable
|
||||
});
|
||||
|
||||
const agent = new https.Agent({ minVersion: 'TLSv1.2', maxVersion: 'TLSv1.3' }); // EXPECT: TLSv1.2 | quantum-vulnerable ; TLSv1.3 | unknown
|
||||
|
||||
const PQ = 'X25519MLKEM768';
|
||||
const GRUPURI = { hibrid: 'X25519MLKEM768' };
|
||||
const a2 = tls.connect({ ecdhCurve: PQ }); // EXPECT: X25519MLKEM768 | quantum-safe
|
||||
const a3 = tls.connect({ ecdhCurve: `${PQ}:X25519` }); // EXPECT: X25519MLKEM768 | quantum-safe ; X25519 | quantum-vulnerable
|
||||
const a4 = tls.connect({ ecdhCurve: GRUPURI[process.env.MOD] }); // EXPECT: tls ecdhCurve | unknown
|
||||
|
||||
module.exports = { server, agent, a2, a3, a4 };
|
||||
@@ -0,0 +1,15 @@
|
||||
// Fixtura: WebCrypto (browser sau globalThis.crypto in Node).
|
||||
const subtle = globalThis.crypto.subtle;
|
||||
|
||||
export async function webcrypto(data) {
|
||||
const rsa = await subtle.generateKey(
|
||||
{ name: 'RSA-OAEP', modulusLength: 3072, publicExponent: new Uint8Array([1, 0, 1]), hash: 'SHA-256' }, // EXPECT: RSA-3072 | quantum-vulnerable
|
||||
true, ['encrypt', 'decrypt']);
|
||||
const ec = await subtle.generateKey({ name: 'ECDSA', namedCurve: 'P-384' }, true, ['sign', 'verify']); // EXPECT: ECDSA-secp384r1 | quantum-vulnerable
|
||||
const ed = await subtle.generateKey('Ed25519', true, ['sign', 'verify']); // EXPECT: Ed25519 | quantum-vulnerable
|
||||
const x = await subtle.generateKey({ name: 'X25519' }, true, ['deriveBits']); // EXPECT: X25519 | quantum-vulnerable
|
||||
const aes = await subtle.generateKey({ name: 'AES-GCM', length: 256 }, true, ['encrypt']); // EXPECT: AES-256-GCM | quantum-safe
|
||||
const d1 = await subtle.digest('SHA-1', data); // EXPECT: SHA-1 | weak-now
|
||||
const d2 = await subtle.digest({ name: 'SHA-384' }, data); // EXPECT: SHA-384 | quantum-safe
|
||||
return [rsa, ec, ed, x, aes, d1, d2];
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import crypto from 'node:crypto';
|
||||
export const h = crypto.createHash('md5');
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
// umplutura pentru limita de marime
|
||||
@@ -0,0 +1,2 @@
|
||||
import crypto from 'node:crypto';
|
||||
export const h = crypto.createHash('sha256');
|
||||
@@ -0,0 +1,9 @@
|
||||
module example.com/fixtura
|
||||
|
||||
go 1.24
|
||||
|
||||
require (
|
||||
github.com/cloudflare/circl v1.6.1
|
||||
golang.org/x/crypto v0.36.0
|
||||
golang.org/x/text v0.23.0
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "fixtura-manifest",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"ethers": "^6.13.0",
|
||||
"lodash": "^4.17.21",
|
||||
"jsonwebtoken": "9.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@noble/post-quantum": "0.4.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<project>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk18on</artifactId>
|
||||
<version>1.78.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,3 @@
|
||||
requests==2.32.3
|
||||
cryptography==43.0.1
|
||||
PyJWT[crypto]>=2.8
|
||||
@@ -0,0 +1,11 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIBmzCCAUGgAwIBAgIUSB9o0oiJeX65E+oyUE6ukzrvT2MwCgYIKoZIzj0EAwIw
|
||||
IzEhMB8GA1UEAwwYY3J5cHRvLWludmVudG9yeS1maXh0dXJlMB4XDTI2MDkyNTA4
|
||||
NTAwM1oXDTM2MDkyMjA4NTAwM1owIzEhMB8GA1UEAwwYY3J5cHRvLWludmVudG9y
|
||||
eS1maXh0dXJlMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPwYXPWSiw0/Y4M2Q
|
||||
zkQHHXLNkRJv0W0Ml7C3vN9HyKl1C9LrNB5evAruKJVTTh+J5KJaxfjDLFldkczR
|
||||
2IKBEaNTMFEwHQYDVR0OBBYEFPE/ChbrkN4O/z7KgfHWZR/+XBBmMB8GA1UdIwQY
|
||||
MBaAFPE/ChbrkN4O/z7KgfHWZR/+XBBmMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZI
|
||||
zj0EAwIDSAAwRQIhAMAK5Uxt090TnPPp5xn3cG1vD1BSNEc+ZJBI0JPPeCl1AiAM
|
||||
egBkNslxucBd5XhFrWbvxCIRBedHr0dZGJYrHIZqrg==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,10 @@
|
||||
Test-only public key generated for the crypto-inventory fixtures.
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvhFbgeI5qpI+99IZBwOt
|
||||
nuwndPRr+gpT5oLNlXVqjOhWSJZWPGgt4cNGw7XgeSujl91Wl8TGCoRAgq4xOxmw
|
||||
d+WVycVlCMKK7Peaepe/wL+DMEABVDuqlkiFEe90/6Kk6sIge555qBGBa/tsvkxX
|
||||
trU1khKI9A7g1YAkSkmUiCAPTktvZ/ED8r6P61j5u8lXnbGeNU7a7vivgWF4CaF4
|
||||
a4m4oAVHUxWLKmeSLN8CeIn6AZSmqc5e/0DMEMGuzqC/XBKWz55bhkzq/CAMdPcI
|
||||
1zbFcXkUM7tWJzLbgAW4R3Bpe1GUD8+h0fG9v8xnJOf1vQ1M4veJ1OQrEhFwuI4+
|
||||
TQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
@@ -0,0 +1,14 @@
|
||||
// MessageDigest.getInstance("MD5") intr-un comentariu nu e o folosire.
|
||||
package fixturi;
|
||||
|
||||
public class Comentarii {
|
||||
/* Cipher.getInstance("DES") intr-un comentariu bloc */
|
||||
/**
|
||||
* Signature.getInstance("SHA1withRSA") in Javadoc.
|
||||
*/
|
||||
private final String doc = "KeyPairGenerator.getInstance(\"RSA\") in a string";
|
||||
|
||||
public String doc() {
|
||||
return doc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Fixtura negativa Go: niciun import criptografic.
|
||||
package fixturi
|
||||
|
||||
/*
|
||||
import "crypto/md5"
|
||||
*/
|
||||
|
||||
// md5.Sum(data) intr-un comentariu nu e o folosire.
|
||||
func Nimic() string {
|
||||
return "crypto/rsa rsa.GenerateKey(rand.Reader, 1024)"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Fixtura negativa: fisierul importa node:crypto doar pentru UUID-uri. Comentariile pomenesc
|
||||
// API-uri reale; niciunul nu e o folosire si scanerul trebuie sa dea ZERO gasiri.
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
// crypto.createHash('md5') intr-un comentariu nu e o folosire.
|
||||
// const k = crypto.generateKeyPairSync('rsa', { modulusLength: 1024 });
|
||||
/* crypto.createCipheriv('des-ede3-cbc', key, iv) intr-un comentariu bloc */
|
||||
/**
|
||||
* Exemplu din documentatie: crypto.createSign('RSA-SHA1').
|
||||
* RSA, ECDSA, secp256k1 si X25519 sunt aici doar cuvinte.
|
||||
*/
|
||||
export function id() {
|
||||
return crypto.randomUUID(); // crypto.createHmac('sha1', k) tot comentariu
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
"""Modul fara criptografie.
|
||||
|
||||
Documentatia pomeneste rsa.generate_private_key(public_exponent=65537, key_size=1024)
|
||||
si hashlib.md5(data), dar nu le cheama.
|
||||
"""
|
||||
import hashlib
|
||||
|
||||
|
||||
def f(x):
|
||||
"""Returneaza x. Nu foloseste hashlib.sha1(x)."""
|
||||
# hashlib.md5(x) intr-un comentariu nu e o folosire
|
||||
text = "hashlib.md5 apare aici doar ca text"
|
||||
return x, text, hashlib
|
||||
@@ -0,0 +1,9 @@
|
||||
export function sign(x) {
|
||||
return Math.sign(x);
|
||||
}
|
||||
|
||||
export function createHash(n) {
|
||||
return { n, hash: n * 31 };
|
||||
}
|
||||
|
||||
export const rezultat = [sign(-3), createHash(7)].map((v) => JSON.stringify(v));
|
||||
@@ -0,0 +1,9 @@
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
export const doc = "Call crypto.createHash('md5') to hash (documentation string).";
|
||||
export const tpl = `Use crypto.createCipheriv('des-ede3-cbc', key, iv) at ${Date.now()}`;
|
||||
export const eticheta = 'crypto.generateKeyPairSync("rsa", { modulusLength: 1024 })';
|
||||
export const re = /createHash\('sha1'\)/;
|
||||
export function id() {
|
||||
return crypto.randomUUID();
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Fixtura: algoritmi dati prin variabile care NU se pot rezolva static. Trebuie "unknown", nu ghicit.
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
let alg = 'md5';
|
||||
alg = 'sha256';
|
||||
|
||||
export function h(data, algDinApel, opts) {
|
||||
const a = crypto.createHash(alg); // EXPECT: createHash | unknown
|
||||
const b = crypto.createHash(algDinApel); // EXPECT: createHash | unknown
|
||||
const c = crypto.createCipheriv(opts.cipher, opts.key, opts.iv); // EXPECT: createCipheriv | unknown
|
||||
return [a, b, c, data];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
"""Fixtura: criptografie in Python. Fisierul nu se executa; e doar text pentru scaner."""
|
||||
import hashlib
|
||||
import hmac
|
||||
import ssl
|
||||
from cryptography.hazmat.primitives.asymmetric import rsa, ec, ed25519, padding
|
||||
from cryptography.hazmat.primitives import hashes
|
||||
from Crypto.Cipher import AES, DES3
|
||||
from ecdsa import SigningKey, SECP256k1
|
||||
import jwt
|
||||
import oqs
|
||||
|
||||
DIGEST = "sha256"
|
||||
|
||||
|
||||
def exemple(data, key, alg_din_parametru):
|
||||
k1 = rsa.generate_private_key(public_exponent=65537, key_size=1024) # EXPECT: RSA-1024 | weak-now
|
||||
k2 = ec.generate_private_key(ec.SECP384R1()) # EXPECT: EC-secp384r1 | quantum-vulnerable
|
||||
k3 = ed25519.Ed25519PrivateKey.generate() # EXPECT: Ed25519 | quantum-vulnerable
|
||||
sig = k2.sign(data, ec.ECDSA(hashes.SHA256())) # EXPECT: ECDSA | quantum-vulnerable ; SHA-256 | quantum-safe
|
||||
ct = k1.public_key().encrypt(data, padding.OAEP(mgf=padding.MGF1(hashes.SHA256()), algorithm=hashes.SHA256(), label=None)) # EXPECT: RSA | quantum-vulnerable ; SHA-256 | quantum-safe
|
||||
h1 = hashlib.md5(data).hexdigest() # EXPECT: MD5 | weak-now
|
||||
h2 = hashlib.new(DIGEST) # EXPECT: SHA-256 | quantum-safe
|
||||
h3 = hashlib.new(alg_din_parametru) # EXPECT: hashlib.new | unknown
|
||||
mac = hmac.new(key, data, digestmod="sha1") # EXPECT: HMAC-SHA-1 | weak-now
|
||||
c1 = AES.new(key, AES.MODE_ECB) # EXPECT: AES-ECB | weak-now
|
||||
c2 = DES3.new(key, DES3.MODE_CBC) # EXPECT: 3DES-CBC | weak-now
|
||||
sk = SigningKey.generate(curve=SECP256k1) # EXPECT: ECDSA-secp256k1 | quantum-vulnerable
|
||||
tok = jwt.encode({"a": 1}, key, algorithm="ES256K") # EXPECT: JWS ES256K | quantum-vulnerable
|
||||
kem = oqs.KeyEncapsulation("ML-KEM-768") # EXPECT: ML-KEM-768 | quantum-safe
|
||||
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) # EXPECT: TLS (negotiated) | unknown
|
||||
ctx.minimum_version = ssl.TLSVersion.TLSv1_2 # EXPECT: TLSv1.2 | quantum-vulnerable
|
||||
return [k3, sig, ct, h1, h2, h3, mac, c1, c2, sk, tok, kem]
|
||||
Reference in new issue
Block a user