Use the AES factory for scoped key generation

Proprietary

Replace a parameterless AesCryptoServiceProvider using resource whose entire body generates and returns its key with Aes.Create(). Preserve the disposal boundary and rebind the inferred local and its members. Exclude encryption, settings, escapes, comments inside construction and conditional snapshots. Opt-in modern-.NET provider modernization; no historical Framework CSP/FIPS equivalence assertion.

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

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