Eigenverft.NetLib.Transformations 1.0.0.5-g17613f8942

This is a prerelease version of Eigenverft.NetLib.Transformations.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Eigenverft.NetLib.Transformations --version 1.0.0.5-g17613f8942
                    
NuGet\Install-Package Eigenverft.NetLib.Transformations -Version 1.0.0.5-g17613f8942
                    
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="Eigenverft.NetLib.Transformations" Version="1.0.0.5-g17613f8942" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eigenverft.NetLib.Transformations" Version="1.0.0.5-g17613f8942" />
                    
Directory.Packages.props
<PackageReference Include="Eigenverft.NetLib.Transformations" />
                    
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 Eigenverft.NetLib.Transformations --version 1.0.0.5-g17613f8942
                    
#r "nuget: Eigenverft.NetLib.Transformations, 1.0.0.5-g17613f8942"
                    
#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 Eigenverft.NetLib.Transformations@1.0.0.5-g17613f8942
                    
#: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=Eigenverft.NetLib.Transformations&version=1.0.0.5-g17613f8942&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Eigenverft.NetLib.Transformations&version=1.0.0.5-g17613f8942&prerelease
                    
Install as a Cake Tool

Eigenverft.NetLib.Transformations

NuGet Version NuGet Downloads Repository CI Targets License

Compose reusable reversible string transformations, from simple representations and obfuscation to password-based AES-GCM and machine-scoped protection.

✨ At a glance

Capability What it does Starting point
Reversible transforms Apply and attempt to reverse a transform; failed reversal preserves the input ReversibleStringTransform
Built-in transforms Use Base64, Base92JsonSafe, ROT13, Caesar, DPAPI LocalMachine, password AES-GCM, or machine-bound AES ReversibleStringTransforms
Composition Apply transforms in order and reverse them in the opposite order ReversibleStringTransforms.Compose(...)
Base92 encoding Encode arbitrary bytes into a canonical JSON-string-safe representation Base92JsonSafeEncoder

The package also references Eigenverft.NetLib.Security.MachineBinding for the machine-bound transform. For self-describing persisted configuration values, use Eigenverft.NetLib.Configuration.Values.

📦 Installation

dotnet add package Eigenverft.NetLib.Transformations

🚀 Quick start

Compose transforms in forward order. This example changes representation; it does not encrypt the text. For persisted configuration values that need a self-describing codec, see Configuration.Values; raw transforms do not frame values or choose configuration keys.

using System;
using System.IO;
using Eigenverft.NetLib.Transformations;

ReversibleStringTransform pipeline = ReversibleStringTransforms.Compose(
    ReversibleStringTransforms.Rot13,
    ReversibleStringTransforms.Base64);

string payload = pipeline.Apply("Hello");
if (!pipeline.TryReverse(payload, out string original))
{
    throw new InvalidDataException("The payload could not be reversed.");
}

Console.WriteLine(original);

Compose(...) applies first-to-last and reverses last-to-first. TryReverse(...) returns false and the original transformed value if any stage fails; no partial reversal is returned.

🔁 Available transforms and behavior

ReversibleStringTransforms provides Base64, Base92JsonSafe, Rot13, Caesar(shift), DpapiMachine, DpapiMachineBase64Url, AesPassword(password), AesPassword(passwordAsciiBytes), PhysicalMachineBoundAes(), and Compose(...). You can also construct a ReversibleStringTransform with custom apply/reverse delegates.

Transforms operate on string values only. They do not add persisted enc: wrappers, identify the transform during reversal, select configuration keys, or migrate stored values. For persisted configuration, Configuration.Values supplies self-describing codecs on top of these transforms.

🔐 Security and platform notes

  • Base64 and Base92 are representations; ROT13 and Caesar are reversible obfuscation. None provides confidentiality.
  • Base92JsonSafe avoids JSON-string escaping, but is not HTML/XML escaping; its alphabet includes characters such as <, >, &, apostrophe, and slash.
  • AesPassword(...) uses AES-GCM with a password-derived key. Security depends on how the application obtains and protects the password. The transform retains the password for its lifetime; embedding it in an application is not a secrecy boundary. The byte-array overload only makes simple static inspection less direct.
  • DpapiMachine and DpapiMachineBase64Url require Windows DPAPI LocalMachine and throw PlatformNotSupportedException on other platforms. They bind to the machine, not to a user or administrator boundary; another user on that Windows machine may unprotect the value.
  • PhysicalMachineBoundAes() derives its password material from a platform fingerprint. It is lightweight resistance to copying application files to another machine, not a hardware-backed secret; source-machine access can reproduce the fingerprint.

🎯 Target frameworks

  • net8.0
  • net10.0

A .NET 9 consumer can use the compatible net8.0 asset.

📄 License

MIT License

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 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 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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.5-gdfdd996480 0 9/29/2026
1.0.0.5-g17613f8942 0 9/29/2026
1.0.0.3-g28e841270d 0 9/28/2026
1.0.0.2-gbac57d8b97 0 9/11/2026
1.0.0.2-g9537b96514 0 9/11/2026

Initial capability package extracted from Eigenverft.NetLib.Infrastructure.