ClrPlus.Core.Extensions.StringExtensions.ProtectBinaryForUser C# (CSharp) Method

ProtectBinaryForUser() public static method

encrypts the given collection of bytes with the user key and salt (defaults to "CoAppToolkit")
public static ProtectBinaryForUser ( this binaryData, string salt = "CoAppToolkit" ) : IEnumerable
binaryData this The binary data.
salt string The salt.
return IEnumerable
        public static IEnumerable<byte> ProtectBinaryForUser(this IEnumerable<byte> binaryData, string salt = "CoAppToolkit") {
            return ProtectedData.Protect(binaryData.ToArray(), salt.ToByteArray(), DataProtectionScope.CurrentUser);
        }