HybridCrypting 1.1.1

dotnet add package HybridCrypting --version 1.1.1
NuGet\Install-Package HybridCrypting -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="HybridCrypting" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HybridCrypting --version 1.1.1
#r "nuget: HybridCrypting, 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 HybridCrypting as a Cake Addin
#addin nuget:?package=HybridCrypting&version=1.1.1

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

HybridCrypting

Encrypt/decrypt text with asymmetric and symmetric hybrid way.

Actions Status

Getting Started

  1. Prepare RSA private/public keys. You could generate one if you don't have. e.g. $ openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048 $ openssl rsa -pubout -in private_key.pem -out public_key.pem
  2. Encrypt the text with public key.
    var cipher = HybridCryptor.Encrypt(publicKeyPath, text);
    
  3. Decrypt the cipher with private key.
    var decrypted = HybridCryptor.Decrypt(privateKeyPath, cipher);
    

Overview

The idea of HybridCrypting is inspired by TLS/SSL handshake. Use asymmetric way to encrypt/decrypt the key cipher and symmetric way to encrypt/decrypt the real content. The benifit is to keep the process both secure(only public key needed for encrypt and the key is totally new generated every time) and efficiant(the key length is only 256, and the real long content is encrypted with symmetric way).

Steps of encrypting

  1. Generate a totally new key (length 256) for encrypting the real content later.
  2. Use asymmetric encrypting (public key encrypting) to encrypt the key and get a key cipher.
  3. Use the key to encrypt the real content with symmetric encrypting.
  4. Combine the key cipher and the encrypted content together and output the encrypted bytes

Steps of decrypting

  1. Split the encrypted bytes, get the key cipher and encrypted content.
  2. Use asymmetric decrypting (private key decrypting) to decrypt the cipher and get the key.
  3. Use the key to decrypt the encrypted content with symmetric decrypting. Then you get the real content back.

Prerequisites

  • Dotnet Core Framework

Installing

Install-Package HybridCrypting

Built With

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1 529 4/28/2020
1.1.0 481 3/5/2020
1.0.0 501 2/25/2020