Use cryptographic zeroization for complete local byte arrays

Proprietary

Replace exact Array.Clear(local, 0, local.Length) calls for byte-array locals/parameters with CryptographicOperations.ZeroMemory over the same full range. Retain both original reads and the null Length failure. Opt-in: leave fields, properties, slices, named arguments, comments and unresolved symbols unchanged; require explicit vector declarations and skip conditional, closure, ref, unsafe, async or iterator syntax.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net6.UseZeroMemoryForLocalByteArrays
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net6.UseZeroMemoryForLocalByteArrays

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.