CA.Blocks.Security 1.1.19-prerelease

This is a prerelease version of CA.Blocks.Security.
dotnet add package CA.Blocks.Security --version 1.1.19-prerelease
                    
NuGet\Install-Package CA.Blocks.Security -Version 1.1.19-prerelease
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CA.Blocks.Security" Version="1.1.19-prerelease" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CA.Blocks.Security" Version="1.1.19-prerelease" />
                    
Directory.Packages.props
<PackageReference Include="CA.Blocks.Security" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CA.Blocks.Security --version 1.1.19-prerelease
                    
#r "nuget: CA.Blocks.Security, 1.1.19-prerelease"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CA.Blocks.Security@1.1.19-prerelease
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CA.Blocks.Security&version=1.1.19-prerelease&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CA.Blocks.Security&version=1.1.19-prerelease&prerelease
                    
Install as a Cake Tool

NuGet version (CA.Blocks.Security) Build Status

The Blocks will produce Random Text, Hashs and implement Encryption / Decryption

HASH Example

    public void SHA256HashExample()    
    {
        var input = "test";
        var base64hasHResult = SHA256Hash.Instance.GenerateHashAsBase64(input);
        Console.WriteLine(base64hasHResult);
        // will produce n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg= 
        var Hexadecimal = SHA256Hash.Instance.GenerateHashAsHexadecimal(input);
        Console.WriteLine(Hexadecimal);
        // will produce 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
    }

Encryption Example

    public void EncryptionExample()
    {
        // Create a new AesCrypto instance seeded with "123" as salt for the initialization vector
        // we use the salt such that the same encrypted value will product a difference cypher text
        // this is allows us to seed each SymmetricEncryption to a different value if needed like 
        // for example each customer can have their own salt value
        ISymmetricEncryption targetEncrypter = new AesCrypto("123");

        Console.WriteLine(targetEncrypter.Encrypt("OriginalText", "secret"));
        // output will be   "1vHyXdWtrigZm5S5Kbksm/A0UyJ7Z4mERnZiFjypQNA="
        Console.WriteLine(targetEncrypter.Decrypt("1cdFBg67qpr6XKgDXJlf4Y7GbUZv5DiMV6ynjQ2PwKU=", "secret"));
        // output will be  OriginalText
        ISymmetricEncryption targetEncrypter2 = new AesCrypto("1234");
        Console.WriteLine(targetEncrypter2.Encrypt("OriginalText", "secret"));
        // output will be   "FpEv1Eh9qj0c7qeHmBOz4xABCbLGz5ljLgvgNVQOLBo="
        Console.WriteLine(targetEncrypter2.Decrypt("FpEv1Eh9qj0c7qeHmBOz4xABCbLGz5ljLgvgNVQOLBo=", "secret"));
        // output will be OriginalText 
    }

Random Text Example

    public void PasswordGeneratorExample()
    {
        var passwordGenerator = new RandomTextGenerator(new RandomTextGeneratorSettings { AllowedChars = RandomTextGeneratorSettings.ASCIIPass });
        string example = passwordGenerator.Generate(12);
        Console.WriteLine(example);
        // exmaple output:  |NAQr%gpyVb2
        // Will Producte Randon password of 12 charchers useing the CharSet
        //  ASCIIPass = " !\"#$%&()*+-/2345679:;<=>?@ACDEFGHJLKLMNPQRSTUVXYZ[\\]^_abcdefghklmnopqrstuvxyz{|}~"
        // This exludes ambigious characters like '1' and 'l' or '0' and 'O' from the generated password
    }
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.19-prerelease 90 4/18/2026
1.1.18 293 12/15/2025
1.1.17-prerelease 280 12/15/2025
1.1.16-prerelease 229 12/14/2025
1.1.15-prerelease 238 12/14/2025
1.1.14-prerelease 140 12/13/2025
1.1.1 700 9/22/2022
1.0.1 1,863 4/13/2016