CWE-326¶
Inadequate Encryption Strength. [Protection-Mechanism-Failure]
Required inputs: IR
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¶
This rule shares the following common options: confidence, exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
blinded_functions¶
blinded_functions : set[bauhaus.analysis.config.QualifiedName] = {'RSA_private_decrypt', 'RSA_private_encrypt', 'RSA_sign'}
blinding_functions¶
blinding_functions : set[bauhaus.analysis.config.QualifiedName] = {'RSA_blinding_on'}
key_arguments¶
key_arguments
Triple DES setup functions, mapped to the indices of the arguments that take the three individual keys.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] }
key_size_arguments¶
key_size_arguments
Key generation functions, mapped to the index of the argument that gives the key size in bits.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_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'
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'
minimum_key_bits¶
minimum_key_bits : int = 2048