// [CRUCIBLE-SEED] // category: hardcoded_secret // severity: critical // language: csharp // expected: Hardcoded encryption key and IV stored as byte array constants using System.Security.Cryptography; namespace App.Security { public class DataEncryptor { // Vulnerable: hardcoded AES key and IV in source code private static readonly byte[] AesKey = new byte[] { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; private static readonly byte[] AesIv = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; public static byte[] Encrypt(byte[] data) { using var aes = Aes.Create(); aes.Key = AesKey; aes.IV = AesIv; using var enc = aes.CreateEncryptor(); return enc.TransformFinalBlock(data, 0, data.Length); } } }