Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

Tunnel Bound KAPA (Snif authentication)

================================================================================
 Tunnel Bound KAPA  -  StreamSec.Snif.KAPA
 A KEM-based, Augmented (asymmetric) Password Authentication (KAPA)
 Protocol outline and integration guide
================================================================================

Updated: 2026-11-03

Audience: application developers integrating the StreamSec Snif/Snip remoting
password-authentication layer, and reviewers who want a quick orientation.

For depth, read the DESIGN SPEC comment block at the top of
StreamSec.Snif.AkeAuthentication.pas.

STATUS: KAPA is a bespoke, tunnel-bound password authentication protocol. A
Tamarin analysis (2026-11-03) has machine-checked conditional symbolic properties
of its login exchange. It assumes the outer channel's server authentication,
confidentiality, integrity, and unique channel binding; it does not prove their
implementation or a standalone PAKE. An independent cryptographic review and a
computational proof with password-guessing bounds remain outstanding.

The central MITM claim is about acceptance AT THE AUTHENTIC SERVER: compromising
the transport server identity alone does not let a MITM use a legitimate client's
response on another connection to complete KAPA as that client. Password guessing
and credential compromise are explicit exceptions. Verifier theft alone does not
directly enable client impersonation; a successful dictionary guess can do so.
KAPA relies on the transport for server identity authentication.

The lemma historically named server_authentication means authentication
ENFORCED BY the server (same-channel client-response agreement); it is not a
proof of transport server identity.
It verified with host-identity compromise allowed. Removing response channel
binding produced the expected two-connection relay counterexample.

Passwords are fresh, unguessable atoms in the main symbolic model. A separate
dictionary configuration exhibits candidate tests and login after a correct guess;
it establishes no numerical guessing probability or Argon2id work factor.
One rogue-server sample can support many offline guesses: fail-closed/no-retry
limits samples per login invocation, not guesses against a captured sample.

KAPA never sends the plaintext password. iLoginPlain sends it inside the tunnel
and remains an explicit opt-out for interop or bootstrap.

Notation used below:
  ||        concatenation (all hash/KDF/MAC inputs are length-prefixed)
  ->        message direction
  H(x)      = SHAKE256(x, 32)
  KDF(K,label[,ctx]) = SHAKE256(dom || K || label || ctx)
  MAC(k,m)  = SHAKE256(dom || k || m)
  ek, dk    composite-KEM public / private key
  K         composite-KEM shared secret


--------------------------------------------------------------------------------
 1. WHAT IT IS (one paragraph)
--------------------------------------------------------------------------------
An augmented (asymmetric) password authentication built on a post-quantum
composite KEM. The server stores, per user, a PUBLIC key derived deterministically
from the password (a one-way verifier) - never a password-equivalent. Login is a
KEM challenge-response: the server encapsulates to the stored public key and sends
an unauthenticated, untagged challenge; the client can answer only by regenerating
its private key from the typed password, deriving the same KEM shared secret, and
decrypting the challenge. The server's own authenticator is DEFERRED until after
the client has committed its answer. The whole exchange runs INSIDE an already
server-authenticated, confidential, integrity-protected transport and is bound
to that channel. SSH uses its session id; TLS uses a tls-exporter binding.
It is NOT a standalone PAKE; it deliberately leans on the tunnel.


--------------------------------------------------------------------------------
 2. PROTOCOL OUTLINE
--------------------------------------------------------------------------------
Primitives (see section 5 for the standards):
  - composite KEM cmkMLKEM768_X25519 = ML-KEM-768 + X25519, with combiner
        K = SHA3-256( ssML || ssX || ctX || pkX || Label )
  - Argon2id            password-to-seed memory-hard KDF
  - SHAKE256            length-prefixed keyed XOF used for H / KDF / MAC / transcript
  - AES-256-CTR         (no authentication tag) for the challenge
  - a CSPRNG

REGISTRATION (performed once, over an already-authenticated channel):

    seed     = Argon2id( H(user) || H(pw), salt, secret, params, 96 )
               # 96 bytes = 64-byte ML-KEM seed || 32-byte X25519 scalar
    (ek, dk) = CompositeKEM.KeyGen(seed)          # deterministic
    store PwFile{ salt, params, PubKey = ek, hostKeyId }   # ek is PUBLIC; dk is discarded

LOGIN (runs inside the tunnel):

    1. C -> S : AuthInit(user)

    2. S      : load PwFile for user (or a synthetic dummy - see 4.4)
                (c, K) = Encaps(ek)               # randomized
                s1     = random(32)               # UNSTRUCTURED, no redundancy
                kEnc   = KDF(K, "ctr")
                ct     = AES-CTR(kEnc, s1)         # NO tag
       S -> C : salt || params || c || ct

    3. C      : seed = Argon2id(...) ; dk = KeyGen(seed)
                K    = Decaps(dk, c)              # implicit-reject; result NOT branched on
                kEnc = KDF(K, "ctr")
                s2   = AES-CTR-decrypt(kEnc, ct)
                binding = channel binding          # FAIL CLOSED if absent
                r2   = MAC( KDF(K, "resp", binding), s2 )   # CHANNEL-BOUND, one-way tag
       C -> S : AuthStep(r2)                        # client commits FIRST; sends the TAG, not s2

    4. S      : binding = channel binding          # FAIL CLOSED if absent
                ok      = constant-time-equal( r2, MAC( KDF(K, "resp", binding), s1 ) )
                          # one compare proves BOTH s1=s2 (password) AND same channel
                T       = H(user, salt, params, c, ct, s1, hostkey=(none), binding)
                confirm = MAC( KDF(K, "cfm"), T )   # s1 == the client's s2 on success
                release confirm ONLY if (known-user AND ok AND binding present);
                otherwise return "unauthenticated" and bump the per-user throttle
       S -> C : confirm                            # server authenticator, DEFERRED

    5. C      : if not constant-time-equal(confirm, MAC(KDF(K,"cfm"), T)):
                    FAIL CLOSED, drop the connection, DO NOT auto-retry
                SK = KDF(K, "sk" || T)             # optional derived session key

Why the shape matters:
  - The challenge is AES-CTR with NO tag, so an attacker who guesses a wrong K'
    cannot LOCALLY confirm the guess (s1 is uniform random, nothing is verifiable).
  - The server's authenticator (confirm) is DEFERRED to step 4, after the client
    has already committed its response. Together these turn what would be an offline
    guessing oracle into at most ONE online, throttled guess per login attempt.
  - The client's committed value is a CHANNEL-BOUND MAC r2 = MAC(KDF(K,"resp",
    binding), s2), NOT raw s2. Raw s2 would be an unbound bearer token: a MITM that
    holds the host key could relay the real server's challenge to the client,
    collect s2, and replay it to the real server to authenticate AS the client -
    before the client can even check confirm. Keying r2 to the SSH session id makes
    the server's ACCEPT decision channel-dependent, so a relayed response (formed
    under a different session id) is rejected AT THE SERVER; the MITM cannot repair
    it because it never learns K. This MUST replace raw s2, never be offered
    alongside it (a raw-s2 fallback reopens the relay by downgrade).
  - "hostkey=(none)" in the transcript is intentional: for SSH the channel binding
    (the first key-exchange hash / session id) already commits to the host key.
  - The per-user throttle is bumped on a FAILED AuthStep guess (for a known user),
    not on AuthInit - it charges an attacker per actual guess, not per free challenge
    request. CAVEAT: it is a guessing rate-limiter, not lockout-proof - KAPA
    cannot tell a legitimate user who mistyped from an impersonator, so anyone who
    knows a username can loop AuthInit -> AuthStep(garbage) to lock the account out.
    The remedy is OTP account recovery (see 7): its LoginOTP step is throttle-INDEPENDENT
    (it works even while the account is locked out), and the counter is reset only when
    the ensuing password change rotates the verifier - NOT by LoginOTP itself, so recovery
    never un-throttles a concurrent guesser against the still-current verifier. Transport /
    per-source rate-limiting (4.7) blunts the flood.


--------------------------------------------------------------------------------
 3. SECURITY GOALS
--------------------------------------------------------------------------------
G1 - No directly usable client password-equivalent in the server file.
     The stored verifier supports an Argon2id-gated offline dictionary. It does
     not by itself let a thief authenticate AS THE CLIENT to the authentic server.
     A successful password guess reconstructs the private KEM key and does enable
     that login. "No direct impersonation" does not mean "never after guessing".

G2 - MITM resistance at the authentic server after server-identity compromise.
     A MITM holding the transport server identity but lacking the password and
     per-user verifier cannot relay a legitimate client's response from its rogue
     connection to complete KAPA as that client on a separate connection to the
     authentic server. The server checks the response under its OWN binding.
     This is a conditional claim; successful guessing and credential compromise
     must be considered separately. Tamarin verified same-channel response
     agreement with host compromise allowed and the password unguessed.

     Direction matters: with the host identity AND verifier, an attacker can
     encapsulate to that verifier and make a CLIENT accept its confirmation.
     This does not make the verifier a client password-equivalent: logging in
     to the AUTHENTIC SERVER still requires the private key, e.g. via a correct
     password guess. KAPA confirmation is checked inside the authenticated
     transport; it does not establish the transport server identity itself.

G3 - Stateless client.
     The client stores nothing but the application software (and its host-key trust
     anchor). All secret material is the typed user+password, regenerated at login
     and discarded.

Goals that are explicitly NOT claimed:
  - NOT OPAQUE-grade, transcript-confidentiality-independent protection: resistance to
    an offline dictionary run on a full transcript observed OUTSIDE the tunnel (only an
    OPRF-based scheme such as OPAQUE gives that). This is an ACCEPTED trade, not a
    defect - the scheme deliberately borrows the confidentiality, integrity and server
    authentication of a secure outer transport, so this residual arises only if that
    transport's confidentiality itself fails, and even then degrades only to the
    scheme's ordinary Argon2id-gated dictionary floor (see 4.10).
  - NOT a computational PAKE proof or numerical password-guessing bound. The
    Tamarin results apply to the stated symbolic model and assumptions.
  - NOT that the server learns nothing on a rogue-server interaction (see 4.3).


--------------------------------------------------------------------------------
 4. NOTES TO CONSUMERS / APPLICATION DEVELOPERS
    (how this must fit into a larger security context for the goals to hold)
--------------------------------------------------------------------------------
This layer is NOT self-contained. Its goals hold only if the surrounding system
provides the following. Treat these as REQUIREMENTS, not recommendations.

4.1 Run it ONLY inside a server-authenticated, confidential, integrity-protected
    channel with a cryptographic binding (SSH session id or TLS exporter). It borrows the
    tunnel's confidentiality (to bound the transcript-dictionary residual, see 4.10)
    and its server authentication for reaching the intended endpoint. The MITM
    analysis explicitly allows identity compromise but still requires distinct
    bindings on the two connections. Bare cleartext operation is outside scope.

4.2 Manage the host-key trust anchor properly. The normal channel model requires
    authenticating the server's host key (pinned key, a CA, or a disciplined
    TOFU policy). If a client will accept any host key, an active attacker becomes
    "the server" and can obtain rogue-server password-test samples. Same-channel
    response binding is still required against relays. Provision and pin host
    keys deliberately; do not ship an accept-anything client.

4.3 Client MUST fail closed and MUST NOT auto-retry on authentication failure.
    A rogue server (one that has the host key) that presents a chosen challenge can
    turn each completed client run into one offline password-guess sample. The
    library's AkeClientLogin enforces fail-closed + no-retry; any custom client or
    wrapper MUST preserve this. Do not build an automatic "wrong password, try
    again" loop around it.

4.4 Channel binding must be present, unique, and unforgeable per channel. The
    server REFUSES to release its authenticator if the binding is absent (fail
    closed), and - since the client's AuthStep response is a MAC KEYED by the
    binding - the server's ACCEPT decision itself depends on it, not merely the
    authenticator release. A weak, guessable, or forgeable binding therefore reopens
    the relay defence. For SSH the binding is the session id (first key-exchange
    hash), whose exchange hash mixes both ends' fresh ephemerals and the shared
    secret (the host key only signs it), so two distinct transports - including the
    two legs of a MITM relay - never share a session id. The TLS path uses the
    RFC 9266 tls-exporter. If you port the layer to another transport,
    supply an equivalent cryptographic per-channel binding or the protocol will not
    complete (and MUST NOT fall back to an unbound accept).

4.5 Set Argon2id parameters for your threat model. The default is m = 64 MiB,
    t = 3, p = 1. G1 is exactly "Argon2id-gated offline dictionary", so the work
    factor of a file-compromise attack is whatever Argon2id cost you choose,
    against whatever password entropy your users have. Raise the cost for
    low-entropy passwords; pin a SINGLE params policy across users (a per-user
    params difference is a user-enumeration signal).

4.6 The "secret" / pepper is a CLIENT-side input, not a server secret. Because the
    client computes the verifier, this value only helps if it is embedded in the
    client software and kept secret there. It does NOT behave like OPAQUE's
    server-held OPRF key and does NOT add protection against server-file compromise
    unless the client binary itself stays confidential.

4.7 Rate-limit at the transport / per-source level too. The per-user throttle stops
    online password GUESSING, but it is not a DoS defence, and two DoS vectors need the
    transport layer: (a) an account-LOCKOUT DoS - anyone who knows a username can loop
    AuthInit -> AuthStep(garbage) to drive that user's failure counter up and lock them
    out (the server cannot tell a mistyping user from an attacker); (b) AuthInit floods
    cost the server one Encaps each with no per-user accounting (a CPU-amplification
    DoS). Add per-source connection / request-rate limiting at the transport layer; for
    (a) consider a SOFT throttle (delay rather than hard-block) so a spoofed-username
    flood cannot fully deny a legitimate user. Note (a) is also recoverable IN-scheme:
    OTP account recovery (7) is throttle-independent (LoginOTP works even while locked
    out) and the counter is reset only when the follow-up password change rotates the
    verifier - not by LoginOTP - so a locked-out user with OTP configured can always
    recover without ever handing a concurrent guesser an un-throttled window.

4.8 Registration and password change must happen over an already-authenticated
    channel (the verifier is uploaded by the client). Treat enrolment with the same
    care as any credential bootstrap.

4.9 Understand the composite-KEM hybrid asymmetry. The
    composite ML-KEM+X25519 gives full hybrid ("survive a break of either
    component") protection for the LIVE KEM EXCHANGE, but only weakest-component
    protection for the AT-REST goal G1: a future break of either component exposes
    that component's password-derived private half from the stored public verifier.
    The offline password search stays Argon2id-gated regardless, but the
    defence-in-depth the hybrid is meant to give the stored credential is only
    partly achieved.

4.10 The transcript-dictionary residual (accepted). Because this is a non-OPRF
    challenge-response, the AuthStep response r2 = MAC(KDF(K,"resp",binding), s2) is a
    per-guess verifier: an observer who holds the full transcript (ct, r2) and the
    channel binding can, for each candidate password, recompute K' -> s2' -> r2' and
    compare - one Argon2id per guess. That cost is the scheme's ORDINARY residual
    floor: it is the SAME Argon2id-gated dictionary a server-file compromise (G1)
    already accepts, it is reachable only if the outer transport's confidentiality
    fails, and it degrades no further - a broken-tunnel transcript still yields only
    a dictionary predicate rather than transmitting the plaintext password. A
    correct guess recovers the password and enables login; iLoginPlain transmits
    the cleartext password outright. This is accepted precisely because the scheme leans on the
    outer transport for confidentiality (and on its integrity and server
    authentication for the normal online threat model); only an OPRF such as OPAQUE would
    make the dictionary infeasible even with the transcript in hand. NOTE that
    only the one-way MAC r2 ever goes on the wire - never s2 itself - so there
    is no zero-work leak: the CTR keystream = ct XOR s2 is not disclosed
    directly, leaving only this guess-and-check predicate, which the binding
    also shields from a bare app-layer transcript logger that lacks the SSH
    session id.
    (Tamarin exhibits this candidate-test mechanism. The following numerical
    bound is only a draft game-based argument, not a machine-checked result: given the plaintext (c, ct, r2) and
    the session id of one honest successful session, an attacker making q_A
    Argon2id queries obtains an offline dictionary at success <= q_A/|D|.)


--------------------------------------------------------------------------------
 5. STANDARDS USED IN THE CURRENT DESIGN
--------------------------------------------------------------------------------
These are the standards the implementation actually relies on:

  Post-quantum KEM
    - FIPS 203                 ML-KEM-768 (the PQ component)
  Traditional KEM/DH
    - RFC 7748                 X25519 (the classical component)
  Hybrid construction
    - draft-ietf-lamps-pq-composite-kem
                               composite KEM cmkMLKEM768_X25519 and its
                               SHA3-256 combiner. NOTE: an IETF DRAFT, not yet an
                               RFC; OIDs/labels track the draft.
  Password hashing
    - RFC 9106                 Argon2id (password -> 96-byte seed)
  Hashing / KDF / MAC
    - FIPS 202                 SHA-3: SHA3-256 (KEM combiner) and SHAKE256 (used as
                               a length-prefixed keyed XOF for H, KDF, MAC and the
                               login transcript)
  Symmetric challenge
    - FIPS 197 + NIST SP 800-38A
                               AES-256 in CTR mode (untagged) for the challenge;
                               the CTR key is single-use (K is fresh per Encaps)
  Transport / channel binding (provided by the surrounding tunnel)
    - RFC 4251 / 4252 / 4253   SSH; the channel binding is the SSH session id
                               (the first key-exchange exchange hash)

TLS transport (implemented; its realization is assumed by the symbolic model):
    - RFC 8446                 TLS 1.3
    - RFC 9266                 tls-exporter channel binding

Deliberately NOT used (and why it matters - see section 6):
    - No OPRF (e.g. RFC 9497 / the CFRG OPAQUE OPRF). This is the single biggest
      difference from a strong aPAKE: without a server-held OPRF key the scheme
      cannot remove the transcript-dictionary leak and instead borrows the tunnel's
      confidentiality for it.
    - No standardized PAKE wire format (not RFC 9382 SPAKE2, not the CFRG
      CPace/OPAQUE drafts). This is a bespoke KEM challenge-response.


--------------------------------------------------------------------------------
 6. RELATION TO OTHER PAKE SCHEMES
--------------------------------------------------------------------------------
Vocabulary: a "balanced" PAKE has both parties derive a key from the password and
the server stores a password-equivalent; an "augmented" / "asymmetric" PAKE has the
server store only a one-way verifier so that file theft does not immediately yield
login. A "strong" aPAKE additionally resists pre-computation and the
offline-dictionary-from-a-transcript leak (OPAQUE is the reference).

  vs. balanced PAKEs - EKE, SPAKE2 (RFC 9382), CPace, and the KEM-based
      OCAKE / CAKE:
        DIFFERENT in the property that matters most here. All of these store a
        password-equivalent KDF(pw), so a stolen server database yields immediate
        impersonation - they fail this scheme's goal G1. CAKE/OCAKE are, like this
        scheme, KEM-BASED, but they are balanced; this scheme is augmented (stores a
        password-derived PUBLIC key, not a shared secret).

  vs. SRP (RFC 2945 / 5054):
        SIMILAR in spirit - SRP is an augmented PAKE whose server stores a one-way
        verifier (v = g^x). DIFFERENT in that SRP is built on a classical
        discrete-log group (not post-quantum), has a multiplicative structure with
        a long history of caveats, and is a true PAKE that does not assume an outer
        tunnel. This scheme replaces the group verifier with a KEM public key, is
        post-quantum, and explicitly relies on the tunnel.

  vs. AuCPace:
        SIMILAR - both are augmented. AuCPace builds on the balanced CPace core
        plus an augmentation layer and is a standalone (tunnel-independent) PAKE on
        a classical group. This scheme is KEM/PQ-based and tunnel-assisted.

  vs. OPAQUE (CFRG):
        OPAQUE is the gold-standard STRONG aPAKE and the closest "ideal" reference.
        DIFFERENT and weaker in one specific way: OPAQUE uses an OPRF whose
        server-held key gates the dictionary even against an attacker who observes a
        full transcript, and OPAQUE is a true PAKE that needs no outer tunnel. This
        scheme has NO OPRF, so (a) it leans on the SSH/TLS tunnel for transcript
        confidentiality, and (b) a host-key-plus-rogue-server attacker gets a
        bounded offline-guessing oracle that OPAQUE would deny. In exchange this
        scheme is simpler and is fully post-quantum in the credential layer today.

  Net positioning:
        A "tunnel-assisted, post-quantum, augmented KEM-based password
        authentication" - NOT an aPAKE: there is no key exchange to claim, since
        the session key is an optional by-product. It trades OPAQUE's strongest
        (OPRF-derived) property for simplicity and an entirely
        post-quantum credential layer, and bounds the resulting leaks behind the
        transport's host-key authentication and confidentiality. It is augmented
        like SRP/OPAQUE (no password-equivalent at rest), KEM-based like CAKE/OCAKE
        (but asymmetric rather than balanced), and post-quantum unlike essentially
        all widely deployed PAKEs.

--------------------------------------------------------------------------------
 7. UNIT LAYOUT (choosing a scheme) AND OTP ACCOUNT RECOVERY
--------------------------------------------------------------------------------
The server-side login classes are split across three units so an application picks a
scheme simply by INCLUDING the matching unit (each unit self-registers its classes):

  StreamSec.Snif.CustomAuthentication  - common base + the AKE-precedence flag
                                         (no server classes; used by both below).
  StreamSec.Snif.Authentication        - LEGACY verifier login: Login / LoginPlain /
                                         ChangePassword.
  StreamSec.Snif.AkeAuthentication     - THIS scheme: AkeLogin / AkeChangeAuth, plus
                                         the OTP login. Its initialization calls
                                         SnifActivateAkeLogin.

If BOTH login units are linked, AKE TAKES PRECEDENCE: the legacy Login / LoginPlain /
ChangePassword methods fail closed (return their error sentinel) so a client cannot
fall back to the weaker scheme. (When the library is used as one runtime package that
contains both units, AKE is therefore always active - the safe default; an app that
wants legacy-only must compile without the AKE unit.)

The client proxies live in StreamSec.Snic.Authentication (iAkeLogin / iAkeChangeAuth);
create them with TsnicClassClient.MakeInstance using the published contract constants
cAkeLoginClassName / cAkeChangeAuthClassName.

OTP ACCOUNT RECOVERY (a lost-password path; it does NOT use the KEM verifier):
  1. C -> S : RequestOTP(user). If the account exists, the server generates a random,
              time-limited base32 code, stores ONLY its hash + an expiry in the user
              item, and fires the OnRequestOTP application event carrying the PLAINTEXT
              code. The application delivers it over a SECONDARY channel (email / SMS).
              The code is never returned on the login channel; the result is uniform
              (it does not reveal whether the account exists).
  2. C -> S : LoginOTP(code) on the SAME connection. The server verifies the code
              (constant-time) against the stored hash and the expiry, and on success
              PURGES the code (single-use) and authenticates the connection RESTRICTED
              TO cRoleChangePassword ONLY. The user then calls AkeChangeAuth.Commit to
              set a fresh verifier. LoginOTP is deliberately NOT subject to the failure
              throttle (and does not bump it): it is the recovery path, so a locked-out
              user must be able to use it. Crucially, LoginOTP does NOT reset the counter:
              an OTP proves only the code, not the password, and the verifier is still the
              old (possibly-attacked) one, so the throttle stays closed until the verifier
              is actually rotated. The reset happens in AkeChangeAuth.Commit, atomically
              with the rotation (under the user-item write lock), so a concurrent guesser
              on another connection is never handed an un-throttled window against the old
              verifier while recovery is in flight.
  Tuning: AkeOtpChars (code length, default 8 base32 chars ~= 40 bits) and
  AkeOtpLifetimeMinutes (default 10). Requirements/residuals:
    - Account-lockout CAVEAT: because KAPA cannot tell a mistyping user from an
      impersonator, anyone who knows a username can loop AuthInit -> AuthStep(garbage) to
      drive the failure counter up and lock the account out (a throttled account's
      AuthInit yields only the dummy challenge, so login can neither succeed nor reset
      the counter). This OTP recovery is the intended remedy - LoginOTP is throttle-
      independent, and the counter is reset only by the follow-up password change
      (AkeChangeAuth.Commit rotates the verifier and clears fFailures atomically), so a
      locked-out user with OTP configured always recovers - and recovery never re-opens
      the throttle before the vulnerable verifier is replaced; also rate-limit per source
      at the transport (see 4.7).
    - The OnRequestOTP handler MUST be NON-BLOCKING (enqueue the message and return): a
      synchronous email/SMS send makes RequestOTP's latency depend on account existence,
      a username-enumeration oracle.
    - RequestOTP rate-limits issuance (it never overwrites a still-valid code), so at
      most one message is sent per lifetime window per user (no flood / provider-cost
      abuse, and a pending code the user is typing is never invalidated).
    - The "change-password only" limit is enforced against role-gated classes and (via
      RestrictToRoles) by forbidding the OTP connection from minting a session. The Snif
      class server DENIES BY DEFAULT any class that has neither a Roles nor an
      Anonymous attribute (a fail-safe against a forgotten Roles attribute), so an OTP
      connection can reach only cRoleChangePassword classes plus any explicitly
      [Anonymous] ones. Mark deliberately-public classes [Anonymous]; give every other
      class a [Roles] attribute.

  CLIENT SIDE, BY HAND: create the iAkeLogin proxy (cAkeLoginClassName, cRoleLogin),
  then AkeClientRequestOTP -> AkeClientLoginOTP on the SAME connection, then create
  iAkeChangeAuth (cAkeChangeAuthClassName, cRoleChangePassword) and
  AkeClientChangeAuth to upload the new verifier; drop the connection and log in
  normally. CLIENT SIDE, PACKAGED: TsnipTLSClient.RecoverAccount performs the whole
  flow in one call, collecting the code and the replacement password through its
  OnOTPCode / OnNewPassword events, and keeps the connection alive across the user's
  out-of-band wait with a heartbeat of empty TLS records (RecoveryHeartbeatInterval).

================================================================================
 End.
================================================================================