Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

CS.RCA

Risky cryptographic algorithm used

If a program operates by sensitive data or protects a communication channel, you may use cryptography to prevent attackers from reading it. There are several obsolete cryptographic algorithms which have proven to create weaknesses against attack.

The CS.RCA checker is a specialized checker that looks for usage of known broken or risky cryptographic algorithms in a program.

Vulnerability and risk

If a program uses broken or risky algorithms in data processing, it could lead to security weaknesses within a program. CWE-327 lists MD4, MD5, SHA1, DES and other algorithms as broken or risky for use. There are several algorithms in the System.Security.Cryptography namespace of .Net Framework supposed for compatibility, but are not recommended for use:

Obsolete algorithm Replacement algorithm(s)
DES AES
TripleDES AES
MD5 SHA256, SHA512
RC2 AES
DSA RSA, ECDSA, ECDiffeHellman
RIPEMD160 SHA256, SHA512
Rijndael AES
SHA1 SHA256, SHA512

Example 1

An instance of a class which represents a risky algorithm is created with the new operator.

1  using System.Security.Cryptography;
2  
3  namespace Program
4  {
5      class Program
6      {
7          public static void Main()
8          {
9              var desEncryptor = new DESCryptoServiceProvider(); // CS.RCA reported
10         }
11     }
12 }

Example 2

Create method of a class which represents a risky algorithm is invoked.

1  using System.Security.Cryptography;
2  
3  namespace Program
4  {
5      class Program
6      {
7          public static void Main()
8          {
9              var desEncryptor = DES.Create(); // CS.RCA reported
10         }
11     }
12 }                            

Example 3

A custom class is inherited from a class which represents a risky algorithm.

1  using System.Security.Cryptography;
2 
3  namespace Program
4  {
5      class MyDESEcryptWrapper : DES // CS.RCA reported
6      {
7          ...
8      }
9  }