logo

Database

C Sharp Insecure Cipher Algorithm

Description

Detects the usage of cryptographically insecure cipher algorithms in C# code. Using weak or deprecated encryption algorithms can make encrypted data vulnerable to attacks and compromise data confidentiality.

Weakness:

052 - Insecure encryption algorithm

Category: Information Collection

Detection Strategy

    Scans C# code for member access expressions that reference known insecure cipher algorithms

    Triggers when code references deprecated ciphers like DES, RC2, or other weak encryption algorithms

    Reports a vulnerability when the code attempts to use any cryptographically insecure cipher for encryption operations

Vulnerable code example

using System;
using System.Security.Cryptography;

class InsecureCrypto
{
    public static void Main()
    {
        // Vulnerable: Using weak/deprecated cryptographic algorithms...

✅ Secure code example

using System;
using System.Security.Cryptography;

class SecureCrypto
{
    public static void Main()
    {
        // Using strong cryptographic algorithms...