Breach-resistant passwords
Argon2id (64 MiB, 3 passes, 4 lanes) over a peppered HMAC-SHA256, stored as self-describing PHC strings. The pepper rotates by key id, so a stolen table alone is not enough to crack anything.
Hardened sign-in for ASP.NET Core, in one package.
MindAttic.Authentication is a Razor Class Library that gives an ASP.NET Core app Argon2id passwords, TOTP two-step sign-in, secure reset, organizations, invitations and an audit trail, built to OWASP ASVS L2 and NIST SP 800-63B AAL2.
What it is
Every web app needs sign-in, and every hand-rolled one gets something wrong: a fast hash, a reset link that never expires, a login page that tells an attacker which emails exist. MindAttic.Authentication is one engine that gets those details right once, so each app references a package instead of reinventing security.
It was designed adversarially. Seven independent attack lenses (crypto, sessions, lockout and enumeration, MFA, secrets, policy and recovery, Blazor and packaging) fed one specification, which then went through a red-team pass. The threat model assumes a skilled attacker today and a full database breach tomorrow.
Wiring it in takes three calls in Program.cs, one interface on your own DbContext, and components like <MaLogin> and <MaMfaChallenge> dropped into your pages. Your app keeps its database, its connection and its branding; the library owns an isolated auth schema and the endpoints that actually sign people in.
It fails closed. A missing secret or a production app without a Data Protection key ring stops startup instead of running insecurely.
Who it's for
Features
Argon2id (64 MiB, 3 passes, 4 lanes) over a peppered HMAC-SHA256, stored as self-describing PHC strings. The pepper rotates by key id, so a stolen table alone is not enough to crack anything.
Legacy bcrypt and SHA-256 hashes verify once with their original algorithm, then re-hash to Argon2id on the next sign-in.
Login, MFA and reset answer with the same content and timing whether or not an account exists, backed by a decoy hash and a timing floor.
Exponential backoff per account and per IP lives in the database, so it holds across restarts and every instance shares it.
TOTP (RFC 6238) with replay protection, verify-before-enable enrollment and single-use hashed recovery codes. The Admin role, and any role you list, is forced through enrollment.
A __Host- cookie with 8-hour absolute and 30-minute idle limits, a security stamp rechecked every minute on HTTP and Blazor circuits, and per-session or global sign-out.
At least 12 characters, any Unicode, no composition rules, no forced rotation, a k-anonymity breach check and password history. Reset tokens are single-use, hashed and expire within 15 minutes.
Password changed or reset, two-step turned on, recovery code used, repeated failures, new device, email changed and account deactivated. Alerts never carry a password, token, code or raw IP.
Opt-in memberships with app-defined roles, owner protection, an ma:org claim per membership, and single-use expiring email invitations with resend, revoke and bulk CSV.
How it works
Add MindAttic.Authentication, pinned to an exact whole-number version.
AddMindAtticAuthentication<AppDbContext>(...), UseMindAtticAuthentication() and MapMindAtticAuthEndpoints() in Program.cs.
Implement IAuthDataContext on your DbContext, call ApplyMindAtticAuthConfiguration() and run your own migration.
Place <MaLogin>, <MaMfaChallenge> and <MaLogout> in your markup and supply the secrets under MindAttic:Vault:Security.
Quick start
The package targets .NET 10. Production must supply a Data Protection key ring or startup refuses to continue.
The full setup guide lives in the documentation.
builder.Services.AddMindAtticAuthentication<AppDbContext>(builder.Configuration, o =>
{
o.AppName = "MyApp"; // per-app trust boundary
o.IsProduction = builder.Environment.IsProduction();
o.ConfigureDataProtection = dp => { /* your key ring: required in production */ };
});
var app = builder.Build();
app.UseForwardedHeaders();
app.UseMindAtticAuthentication();
app.MapMindAtticAuthEndpoints(group => group.RequireRateLimiting("auth"));Part of MindAttic
Authentication is the shared sign-in for MindAttic's web apps, among them Gadfly, IdeaCms, IdiotProof, Prose and Tutor. Each references the package and keeps its own database and branding.
Its secrets and its SMTP settings come through IConfiguration in the MindAttic.Vault schema, so a key set once in Vault reaches the sign-in of every app.
Status
MFA, reset, organizations and email invitations are built, and November 2026 hardened the MFA throttle, TOTP replay handling and options validation. The milestone closes the remaining test gaps on MFA enrollment, password change, revalidation and the HTTP endpoints, adds one invitation hook a consumer needs, and brings the docs up to date.
Current milestone: Authentication proven and stable: every security-critical path under failure-case tests, and docs with no 'partial' row left.
Next step
Guides, reference and design notes are in the searchable MindAttic documentation. The source, issues and history are on GitHub.