Eigenverft.NetLib.Transformations
1.0.0.5
dotnet add package Eigenverft.NetLib.Transformations --version 1.0.0.5
NuGet\Install-Package Eigenverft.NetLib.Transformations -Version 1.0.0.5
<PackageReference Include="Eigenverft.NetLib.Transformations" Version="1.0.0.5" />
<PackageVersion Include="Eigenverft.NetLib.Transformations" Version="1.0.0.5" />
<PackageReference Include="Eigenverft.NetLib.Transformations" />
paket add Eigenverft.NetLib.Transformations --version 1.0.0.5
#r "nuget: Eigenverft.NetLib.Transformations, 1.0.0.5"
#:package Eigenverft.NetLib.Transformations@1.0.0.5
#addin nuget:?package=Eigenverft.NetLib.Transformations&version=1.0.0.5
#tool nuget:?package=Eigenverft.NetLib.Transformations&version=1.0.0.5
Eigenverft.NetLib.Transformations
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.
Base92JsonSafeavoids 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.DpapiMachineandDpapiMachineBase64Urlrequire Windows DPAPI LocalMachine and throwPlatformNotSupportedExceptionon 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.0net10.0
A .NET 9 consumer can use the compatible net8.0 asset.
🔗 Project links
📄 License
| Product | Versions 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. |
-
net10.0
- Eigenverft.NetLib.Security.MachineBinding (>= 1.0.0.5)
-
net8.0
- Eigenverft.NetLib.Security.MachineBinding (>= 1.0.0.5)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Eigenverft.NetLib.Transformations:
| Package | Downloads |
|---|---|
|
Eigenverft.NetLib.Configuration.Values
Configuration value codecs and in-place JSON value encoding built on reversible transforms. |
|
|
Eigenverft.NetLib.Security.DataProtection
ASP.NET Core Data Protection adapters for the NetLib reversible-transform and configuration-value capabilities. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial capability package extracted from Eigenverft.NetLib.Infrastructure.