2028
hardware, which can be more difficult to upgrade quickly than software; design the hardware at a
replaceable block level.
Effectiveness = Defense in Depth
Phase: Architecture and Design
Do not use outdated or non-compliant cryptography algorithms. Some older algorithms, once
thought to require a billion years of computing time, can now be broken in days or hours. This
includes MD4, MD5, SHA1, DES, and other algorithms that were once regarded as strong
[REF-267].
Effectiveness = Discouraged Common Practice
Phase: Architecture and Design
Phase: Implementation
Do not use a linear-feedback shift register (LFSR) or other legacy methods as a substitute for an
accepted and standard Random Number Generator.
Effectiveness = Discouraged Common Practice
Phase: Architecture and Design
Phase: Implementation
Do not use a checksum as a substitute for a cryptographically generated hash.
Effectiveness = Discouraged Common Practice
Phase: Architecture and Design
Strategy = Libraries or Frameworks
Use a vetted cryptographic library or framework. Industry-standard implementations will save
development time and are more likely to avoid errors that can occur during implementation
of cryptographic algorithms. However, the library/framework could be used incorrectly during
implementation.
Effectiveness = High
Phase: Architecture and Design
Phase: Implementation
When using industry-approved techniques, use them correctly. Don't cut corners by skipping
resource-intensive steps (CWE-325). These steps are often essential for the prevention of
common attacks.
Effectiveness = Moderate
Phase: Architecture and Design
Phase: Implementation
Do not store keys in areas accessible to untrusted agents. Carefully manage and protect the
cryptographic keys (see CWE-320). If the keys can be guessed or stolen, then the strength of the
cryptography algorithm is irrelevant.
Effectiveness = Moderate
Demonstrative Examples
Example 1:
Re-using random values may compromise security.
CWE Version 4.14
CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation
CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation