Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
V5315. OWASP. Use of an outdated crypto…
menu mobile close menu
Analyzer diagnostics
General Analysis (C++)
General Analysis (C#)
General Analysis (Java)
Micro-Optimizations (C++)
Diagnosis of 64-bit errors (Viva64, C++)
Customer specific requests (C++)
MISRA errors
AUTOSAR errors
OWASP errors (C++)
OWASP errors (C#)
OWASP errors (Java)
Problems related to code analyzer
Additional information
toggle menu Contents

V5315. OWASP. Use of an outdated cryptographic algorithm is not recommended.

Feb 04 2025

The analyzer has detected that the application uses an outdated cryptographic algorithm. The use of such algorithms can lead to sensitive data exposure, key leakage, broken authentication, etc.

Vulnerabilities related to the use of weak cryptographic algorithms can be categorized under the OWASP Top 10 2021 as follows:

Look at the following example:

public void encryptData(String data, SecretKey secretKey) {
    Cipher cipher = null;
    try {
        cipher = Cipher.getInstance("DES");         // <=
    } catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
        // ....
    }

    try {
        cipher.init(Cipher.ENCRYPT_MODE, secretKey);
    } catch (InvalidKeyException e) {
        // ....
    }

    try {
        byte[] encryptedData = cipher.doFinal(data.getBytes());
    } catch (IllegalBlockSizeException | BadPaddingException e) {
        // ....
    }

    // ....
}

When analyzing the code fragment, the analyzer will warn against using DES.

It is better to use modern algorithms instead of outdated ones. In the example above, one possible solution is to replace DES with AES:

public void encryptData(String data, SecretKey secretKey) {
    Cipher cipher = null;
    try {
        cipher = Cipher.getInstance("AES/CBC/NoPadding");
    } catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
        // ....
    }

    try {
        cipher.init(Cipher.ENCRYPT_MODE, secretKey);
    } catch (InvalidKeyException e) {
        // ....
    }

    try {
        byte[] encryptedData = cipher.doFinal(data.getBytes());
    } catch (IllegalBlockSizeException | BadPaddingException e) {
        // ....
    }

    // ....
}

Oracle's website provides documentation on standard implementations of various cryptographic algorithms. The following is a list of some algorithms that are not recommended for use:

  • DES
  • DESede
  • RC2
  • RC4
  • RC5
  • Blowfish

For example, the recommendation to use the aforementioned Data Encryption Standard (DES) was withdrawn in 2005 and replaced with the Advanced Encryption Standard (AES).

The official OWASP website provides various techniques for testing applications for potential vulnerabilities caused by the use of weak cryptographic algorithms.

close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you do not see the email in your inbox, please check if it is filtered to one of the following folders:

  • Promotion
  • Updates
  • Spam