Find hardcoded key lengths
ProprietaryFind key sizes written in source, directly or through a constant, where keys are generated or derived: RSA.Create(2048), DSA.Create(...), the key size constructors of RSACryptoServiceProvider, RSACng, ECDsaCng and the other algorithm implementations, assignments to KeySize on symmetric and asymmetric algorithms, and the output length of Rfc2898DeriveBytes and HKDF key derivation. Hardcoded key lengths prevent the move to the larger keys post-quantum cryptography requires.
OpenRewrite. CSharp. Recipes. Cryptography. FindHardcodedKeyLengthmod run . --recipe= OpenRewrite. CSharp. Recipes. Cryptography. FindHardcodedKeyLengthInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.