CWE-326

Inadequate Encryption Strength. [Protection-Mechanism-Failure]

Required inputs: IR

The product stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required. A weak encryption scheme can be subjected to brute force attacks that have a reasonable chance of succeeding using current attack methods and resources.Excerpts from CWE [https://cwe.mitre.org], Copyright (C) 2006-2026, the MITRE Corporation. See 9.4 3rd-Party Licenses in the documentation for full details.

Possible Messages

Key

Text

Severity

Disabled

key_generation

Generating an asymmetric key that is shorter than the required minimum.

None

False

key_size_constant

Defining an asymmetric key size that is shorter than the required minimum.

None

False

missing_blinding

Missing blinding for the RSA algorithm.

None

False

repeated_key

Using the same key for more than one Triple DES key slot reduces the effective key strength.

None

False

Options

blinded_functions

blinded_functions : set[bauhaus.analysis.config.QualifiedName] = {'RSA_private_decrypt', 'RSA_private_encrypt', 'RSA_sign'}

RSA operations on a private key, which have to be preceded by a call enabling blinding.
 

blinding_functions

blinding_functions : set[bauhaus.analysis.config.QualifiedName] = {'RSA_blinding_on'}

Functions that turn on blinding for an RSA key.
 

key_arguments

key_arguments

Type: dict[bauhaus.analysis.config.QualifiedName, list[int]]

Default:

{
   'DES_ecb3_encrypt': [2, 3, 4],
   'DES_ede3_cbc_encrypt': [3, 4, 5],
   'DES_ede3_cfb64_encrypt': [3, 4, 5],
   'DES_ede3_cfb_encrypt': [4, 5, 6],
   'DES_ede3_ofb64_encrypt': [3, 4, 5],
   'Des3Cbc_Init': [1, 2, 3],
   'Des3Ecb_Init': [1, 2, 3]
}
Triple DES setup functions, mapped to the indices of the arguments that take the three individual keys.
 

key_size_arguments

key_size_arguments

Type: dict[bauhaus.analysis.config.QualifiedName, int]

Default:

{
   'DH_generate_parameters': 0,
   'DH_generate_parameters_ex': 1,
   'DSA_generate_parameters_ex': 1,
   'EVP_PKEY_CTX_set_dh_paramgen_prime_len': 1,
   'EVP_PKEY_CTX_set_dsa_paramgen_bits': 1,
   'EVP_PKEY_CTX_set_rsa_keygen_bits': 1,
   'RSA_generate_key': 0,
   'RSA_generate_key_ex': 1,
   'gnutls_x509_privkey_generate': 2,
   'mbedtls_rsa_gen_key': 3,
   'wc_MakeRsaKey': 1
}
Key generation functions, mapped to the index of the argument that gives the key size in bits.
 

key_size_in_bits_pattern

key_size_in_bits_pattern : bauhaus.analysis.config.SearchPattern = '(?i)(?:RSA|(?<!EC)DSA|(?<!EC)DH)\w*KEY_?(?:LEN(?:GTH)?_?)?BITS?\Z'

Constants whose name matches this pattern hold an asymmetric key size in bits.
 

key_size_in_bytes_pattern

key_size_in_bytes_pattern : bauhaus.analysis.config.SearchPattern = '(?i)(?:RSA|(?<!EC)DSA|(?<!EC)DH)\w*KEY_?(?:LEN(?:GTH)?_?)?BYTES?\Z'

Constants whose name matches this pattern hold an asymmetric key size in bytes.
 

minimum_key_bits

minimum_key_bits : int = 2048

Smallest modulus or prime size, in bits, that is accepted for RSA, DSA and Diffie-Hellman keys.