ABPPack 0.0.1

dotnet add package ABPPack --version 0.0.1
                    
NuGet\Install-Package ABPPack -Version 0.0.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="ABPPack" Version="0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ABPPack" Version="0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="ABPPack" />
                    
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 ABPPack --version 0.0.1
                    
#r "nuget: ABPPack, 0.0.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.
#:package ABPPack@0.0.1
                    
#: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=ABPPack&version=0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=ABPPack&version=0.0.1
                    
Install as a Cake Tool

ABPPack.cs

ABPPack C# implementation.

Install

  • Package Manager: Install-Package ABPPack
  • .NET CLI: dotnet add package ABPPack
  • PackageReference: <PackageReference Include="ABPPack" Version="0.0.1" />
  • Paket CLI: paket add ABPPack

Usage

using System; // Console
using System.Text; // Encoding
using System.IO; // File
using Org.BouncyCastle.Crypto.Parameters; // RsaKeyParameters

void Example()
{
#region Keys
    // Generate AES key
    var aesKey = ABPAES.MakeKey();

    // Import RSA keypair from .pem file
    var rsaKeypair = ABPRSA.MakeKeys(File.ReadAllText("keypair.pem"));
    var rsaKeyprv = (RsaKeyParameters)rsaKeypair.Private;
    var rsaKeypub = (RsaKeyParameters)rsaKeypair.Public;
#endregion

#region Selftest
    // These will complain on stderr and return false if something goes wrong.
    ABPRSA.SelfTest(rsaKeypair);
    ABPAES.SelfTest(aesKey);
    ABPHPack.SelfTest(rsaKeypair);
    ABPPack.SelfTest(aesKey);
#endregion

    var testBuffer = Encoding.UTF8.GetBytes("Hello World!"); // Test buffer for test message

#region ABPHPack
    var hPack = new ABPHPack { data = testBuffer }; // Create a Handshake Pack
    var hBytes = hPack.Pack(rsaKeypub); // Encrypt & Assemble a Handshake Pack
    var hPack2 = new ABPHPack(hBytes, rsaKeyprv); // Take apart & Decrypt a Handshake Pack
    Console.WriteLine($"ABPHPack: {Encoding.UTF8.GetString(hPack2.data)}"); // "Hello World!"
#endregion

#region ABPHPack
    var pack = new ABPPack { data = testBuffer }; // Create a Handshake Pack
    var bytes = pack.Pack(aesKey); // Encrypt & Assemble a Handshake Pack
    var pack2 = new ABPPack(bytes, aesKey); // Take apart & Decrypt a Handshake Pack
    Console.WriteLine($"ABPPack: {Encoding.UTF8.GetString(pack2.data)}"); // "Hello World!"
#endregion
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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.  net9.0 was computed.  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 was computed.  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.

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
0.0.1 729 12/20/2020