Pandatech.Crypto 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Pandatech.Crypto --version 1.1.1
NuGet\Install-Package Pandatech.Crypto -Version 1.1.1
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="Pandatech.Crypto" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pandatech.Crypto --version 1.1.1
#r "nuget: Pandatech.Crypto, 1.1.1"
#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.
// Install Pandatech.Crypto as a Cake Addin
#addin nuget:?package=Pandatech.Crypto&version=1.1.1

// Install Pandatech.Crypto as a Cake Tool
#tool nuget:?package=Pandatech.Crypto&version=1.1.1

PandaTech.Crypto

Introduction

Pandatech.Crypto is a powerful cryptographic utility library backed by 99% test coverage through unit tests. The library offers an array of static methods for secure data operations, including AES256 encryption and decryption, Argon2Id password hashing and verification, as well as utilities for generating cryptographic random bytes and passwords.

Designed to work efficiently in containerized environments, the library performs effectively even with limited resources—hash generation takes under 500ms on a container with 1 vCore and 1GB of RAM.

Features

  • AES 256-bit Encryption/Decryption: Encrypt your data and get the IV and encrypted bytes in one array. Decrypt it back to its original form, seamlessly handling the IV.
  • Argon2Id Hashing: Hash and verify passwords securely with an immutable configuration that's optimized for performance.
  • Random Number/Password Generation: Generate cryptographic random bytes, AES256 keys, or strong passwords with specific character sets.
  • Performance Optimized: Tested to run efficiently in resource-constrained environments.
  • High Test Coverage: Confidence backed by 99% unit test coverage.

Installation

To use PandaTech.Crypto in your project, install the NuGet package using the following command in the Package Manager Console: Install-Package PandaTech.Crypto or, search for "PandaTech.Crypto" in the NuGet Package Manager and install it from there.

How to Use

1. AES256 Class

Configurations
  1. IV: A random IV is generated for each Encryption, enhancing security.
  2. PaddingMode: PKCS7

Encryption and decryption with environment variable key

Environment.SetEnvironmentVariable("AES_KEY", Random.GenerateAes256KeyString());

// Example usage for encryption
var encryptedData = Aes256.Encrypt("yourPlainText");

// Example usage for decryption
var decryptedData = Aes256.Decrypt(encryptedData);

2. Argon2id Class

Configurations
  1. Salt: A random salt is generated for each password hash, enhancing security.
  2. DegreeOfParallelism: 8
  3. Iterations: 5
  4. MemorySize: 128 MB

Hash password and verify hash

// Example usage for hashing
var hashedPassword = Argon2Id.HashPassword("yourPassword");

// Example usage for verifying a hash
var isPasswordValid = Argon2Id.VerifyHash("yourPassword", hashedPassword);

3. Random Class

var randomBytes = Random.GenerateBytes(16);
var aesKey = Random.GenerateAes256KeyString();

4. RandomPassword Class

var includeUppercase = true;
var includeLowercase = true;
var includeDigits = true;
var includeSpecialChars = true;
string password = RandomPassword.Generate(16, includeUppercase, includeLowercase, includeDigits, includeSpecialChars);

License

PandaTech.Crypto is licensed under the MIT License.

PandaTech.Crypto - Simplifying AES256 Encryption, Decryption, and Argon2id Hashing.

Your Security, Our Priority.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Pandatech.Crypto:

Package Downloads
PandaTech.IEnumerableFilters

This NuGet helps with filtering tables.

Pandatech.EFCoreQueryMagic

Unlock the full potential of your Entity Framework Core applications with Pandatech.EFCoreQueryMagic. This innovative package empowers developers to seamlessly create dynamic, complex queries and filters for SQL tables without diving deep into the intricacies of LINQ or manual query construction. Designed to enhance productivity and maintainability, EFCoreQueryMagic automates the translation of front-end filter requests into optimized, ready-to-execute EF Core queries. Embrace the magic of streamlined data retrieval and manipulation, and elevate your applications to new heights of efficiency and performance.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.3.2 60 5/9/2024
2.3.1 395 3/6/2024
2.3.0 88 3/6/2024
2.2.11 87 3/6/2024
2.2.10 90 3/1/2024
2.2.9 93 2/17/2024
2.2.8 69 2/17/2024
2.2.7 94 2/12/2024
2.2.6 109 1/23/2024
2.2.5 81 1/23/2024
2.2.4 89 1/19/2024
2.2.3 356 11/29/2023
2.2.2 90 11/29/2023
2.2.1 160 11/23/2023
2.2.0 120 11/21/2023
2.1.10 112 11/11/2023
2.1.9 101 11/9/2023
2.1.8 163 11/7/2023
2.1.7 143 11/6/2023
2.1.6 97 11/3/2023
2.1.5 113 11/2/2023
2.1.4 96 11/1/2023
2.1.3 110 11/1/2023
2.1.2 102 10/31/2023
2.1.1 108 10/31/2023
2.1.0 104 10/31/2023
2.0.0 223 10/30/2023
1.1.6 118 10/30/2023
1.1.5 115 10/27/2023
1.1.4 98 10/27/2023
1.1.3 108 10/27/2023
1.1.2 132 10/16/2023
1.1.1 129 10/14/2023
1.1.0 126 10/14/2023
1.0.0 124 10/13/2023

Refactoring project