TopSecret.ProtectedString.Configuration
2.1.1
dotnet add package TopSecret.ProtectedString.Configuration --version 2.1.1
NuGet\Install-Package TopSecret.ProtectedString.Configuration -Version 2.1.1
<PackageReference Include="TopSecret.ProtectedString.Configuration" Version="2.1.1" />
<PackageVersion Include="TopSecret.ProtectedString.Configuration" Version="2.1.1" />
<PackageReference Include="TopSecret.ProtectedString.Configuration" />
paket add TopSecret.ProtectedString.Configuration --version 2.1.1
#r "nuget: TopSecret.ProtectedString.Configuration, 2.1.1"
#:package TopSecret.ProtectedString.Configuration@2.1.1
#addin nuget:?package=TopSecret.ProtectedString.Configuration&version=2.1.1
#tool nuget:?package=TopSecret.ProtectedString.Configuration&version=2.1.1
TopSecret
A small suite of .NET packages for keeping secrets safe in memory. It exists because SecureString never got a cross-platform story — its encryption is Windows-only and Microsoft advises against it for new code — yet real applications still hold passwords, API tokens, and cryptographic key material in plain strings and arrays that any heap dump, swap file, crash report, or memory scan can read. With TopSecret, secrets live AES-GCM-256-encrypted under a per-process (optionally hardware-backed) key, plaintext surfaces only briefly inside escape-resistant span callbacks, and every scratch buffer is pinned, locked, and wiped on exit.
Packages
- TopSecret.ProtectedString — the core: a cross-platform
SecureStringreplacement for text secrets, with constant-time equality, Argon2id credential hashing (OWASP defaults), opt-in hardware-backed key wrapping (Apple Secure Enclave / Android Keystore built in), and a bundled Roslyn analyzer that flags plaintext escaping the access callbacks. - TopSecret.ProtectedBlob — multi-megabyte binary secrets (key stores, sealed assets, model shards): write-once, chunked AES-GCM-256, streamed chunk-at-a-time reads that fail closed on tampering.
- TopSecret.ProtectedString.WindowsTpm — opt-in Windows TPM 2.0 wrapping of the process master key.
- TopSecret.ProtectedString.LinuxTpm — the same for Linux TPM 2.0 (
/dev/tpmrm0). - TopSecret.ProtectedString.Configuration — binds
appsettings.json/IConfigurationvalues straight intoProtectedString, with no plaintextstringdetour.
Documentation & threat model · Live browser demo · Changelog · MIT
The threat model defends secrets at rest in memory (dumps, swap, scraping) — not an attacker already executing code inside your process. Read it before relying on any in-memory protection.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.9)
- TopSecret.ProtectedString (>= 2.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
## [2.1.1](https://github.com/Alpaq92/TopSecret.ProtectedString/compare/v2.1.0...v2.1.1) (2026-07-05)
### Bug Fixes
* **demo:** drop the loading-dot animation, use a static ellipsis ([57594da](https://github.com/Alpaq92/TopSecret.ProtectedString/commit/57594dab48b9d116362339ade10ed82fd948a4fa))