Carubbi.Security 1.0.0

Security Components

Install-Package Carubbi.Security -Version 1.0.0
dotnet add package Carubbi.Security --version 1.0.0
<PackageReference Include="Carubbi.Security" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Carubbi.Security --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Carubbi.Security

A simple symmetric cryptography helper

1. Symmetrict Cryptography

Example:

 var crypt = new SymmetricCrypt(SymmetricCryptProvider.TripleDES) { Key = "Your Salt Key" };
 var encrypedData = crypt.Encrypt("plain text");
 var decrypedData = crypt.Encrypt(encrypedData);

2. Protect a config section

Example:

2.1 To allow your app read a protected section, declare the provider in your config file

<?xml version="1.0"?>
<configuration>
  <configProtectedData >
    <providers>
      <clear />
      <add keyContainerName="KeyContainerName.txt"
      name="CarubbiEncryptionProvider"
      type="Carubbi.Security.TripleDESProtectedConfigurationProvider, Carubbi.Security" />
      </providers>
  </configProtectedData >
</configuration>

2.2 To protect your section by the first time, run this code in an app with the same configuration above:

TripleDESProtectedConfigurationProvider provider = new TripleDESProtectedConfigurationProvider();
provider.CreateKey(keyName);

if (ConfigurationManager.GetSection("connectionStrings") is ConfigurationSection section)
{
    section.SectionInformation.ProtectSection("CarubbiEncryptionProvider");
}

Carubbi.Security

A simple symmetric cryptography helper

1. Symmetrict Cryptography

Example:

 var crypt = new SymmetricCrypt(SymmetricCryptProvider.TripleDES) { Key = "Your Salt Key" };
 var encrypedData = crypt.Encrypt("plain text");
 var decrypedData = crypt.Encrypt(encrypedData);

2. Protect a config section

Example:

2.1 To allow your app read a protected section, declare the provider in your config file

<?xml version="1.0"?>
<configuration>
  <configProtectedData >
    <providers>
      <clear />
      <add keyContainerName="KeyContainerName.txt"
      name="CarubbiEncryptionProvider"
      type="Carubbi.Security.TripleDESProtectedConfigurationProvider, Carubbi.Security" />
      </providers>
  </configProtectedData >
</configuration>

2.2 To protect your section by the first time, run this code in an app with the same configuration above:

TripleDESProtectedConfigurationProvider provider = new TripleDESProtectedConfigurationProvider();
provider.CreateKey(keyName);

if (ConfigurationManager.GetSection("connectionStrings") is ConfigurationSection section)
{
    section.SectionInformation.ProtectSection("CarubbiEncryptionProvider");
}

Dependencies

This package has 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 History

Version Downloads Last updated
1.0.0 356 8/20/2018