Independent Submission E. A. Rigopoulos Internet-Draft YPS Services LLC Intended status: Experimental 1 December 2026 Expires: 4 June 2027 TOTP with an Offline Time Source and a Prover-Side Viewed Record draft-rigopoulos-totp-offline-audit-02 Abstract This document builds on RFC 6238 and does not update or replace it. It specifies two optional mechanisms, compatible with RFC 6238, for use with the Time-Based One-Time Password (TOTP) algorithm. It specifies an Offline Time Source profile in which the prover derives Unix time from a local clock that has no network dependency, together with a declared maximum drift rate and a method for measuring that rate against a trusted reference. It also specifies an append-only viewed record written on the prover when a TOTP value is displayed or copied, and optional verifier behaviour that uses that record to reject or flag an OTP accepted at a time- step the device never recorded as viewed. This document also describes an optional Reference Device role, guidance for new hardware including offline crypto wallets, an optional binding of a viewed record to the action or transaction for which the code was displayed, and test results from a local simulation of verifier behaviour. The TOTP value itself is computed exactly as in RFC 6238. A viewed record detects unviewed or wrong-step OTPs; it does not prevent acceptance unless the verifier checks the record. This document is Experimental. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on 4 June 2027. Rigopoulos Expires 4 June 2027 [Page 1] Internet-Draft TOTP Offline Time and Viewed Records December 2026 Copyright Notice Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Conventions and Definitions . . . . . . . . . . . . . . . . . 4 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 4. Offline Time Source . . . . . . . . . . . . . . . . . . . . . 6 4.1. Maximum Drift Rate . . . . . . . . . . . . . . . . . . . 6 4.2. Setting and Resynchronisation . . . . . . . . . . . . . . 7 4.3. Measurement Method . . . . . . . . . . . . . . . . . . . 7 4.4. Applicability to New Hardware and Existing Devices . . . 8 4.5. Battery Status . . . . . . . . . . . . . . . . . . . . . 8 4.6. Reference Device . . . . . . . . . . . . . . . . . . . . 9 4.6.1. Role and Clock Quality . . . . . . . . . . . . . . . 9 4.6.2. Signed Time Message . . . . . . . . . . . . . . . . . 9 4.6.3. Measuring and Applying an Offset . . . . . . . . . . 10 4.6.4. Ranking References . . . . . . . . . . . . . . . . . 10 4.6.5. Software Sync Path . . . . . . . . . . . . . . . . . 11 5. The Viewed Record . . . . . . . . . . . . . . . . . . . . . . 11 5.1. Record Fields . . . . . . . . . . . . . . . . . . . . . . 11 5.2. JSON Representation . . . . . . . . . . . . . . . . . . . 13 5.3. CBOR Representation . . . . . . . . . . . . . . . . . . . 13 5.4. Transaction Binding . . . . . . . . . . . . . . . . . . . 14 6. Verifier Check . . . . . . . . . . . . . . . . . . . . . . . 15 6.1. Audit Mode . . . . . . . . . . . . . . . . . . . . . . . 15 6.2. Enforce Mode . . . . . . . . . . . . . . . . . . . . . . 15 6.3. Obtaining Records . . . . . . . . . . . . . . . . . . . . 16 6.4. Atomic One-Time-Use Check . . . . . . . . . . . . . . . . 16 7. Interoperability with RFC 6238 . . . . . . . . . . . . . . . 17 7.1. Relationship to RFC 6238 . . . . . . . . . . . . . . . . 17 8. Test Vectors . . . . . . . . . . . . . . . . . . . . . . . . 17 9. Measured Results . . . . . . . . . . . . . . . . . . . . . . 19 10. Implementation and Test Results . . . . . . . . . . . . . . . 21 11. Live and Pressure Test Results . . . . . . . . . . . . . . . 24 12. Implementation Status . . . . . . . . . . . . . . . . . . . . 27 12.1. Example Hardware for Laboratory Evaluation . . . . . . . 28 13. Security Considerations . . . . . . . . . . . . . . . . . . . 30 14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 31 Rigopoulos Expires 4 June 2027 [Page 2] Internet-Draft TOTP Offline Time and Viewed Records December 2026 15. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 32 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 32 16.1. Normative References . . . . . . . . . . . . . . . . . . 32 16.2. Informative References . . . . . . . . . . . . . . . . . 32 Changes from draft-rigopoulos-totp-offline-audit-01 . . . . . . . 33 Changes from draft-rigopoulos-totp-offline-audit-00 . . . . . . . 34 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 35 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 35 1. Introduction This document specifies a method that builds on [RFC6238], which defines TOTP as an extension of the HMAC-based One-Time Password (HOTP) algorithm in [RFC4226]. It does not update, obsolete, or modify RFC 6238 (see Section 7.1). The moving factor in RFC 6238 is a time-step counter T = floor((Current Unix time - T0) / X) with a default time-step size X of 30 seconds and a default origin T0 of 0 (the Unix epoch). Requirement R1 in Section 3 of [RFC6238] says the prover and the verifier MUST know or be able to derive the current Unix time. It does not say how that time is obtained, and it does not require or forbid a network time source. Section 5.2 of [RFC6238] observes that a validation system does not know the client's exact timestamp when an OTP was generated. It says a verifier SHOULD set a policy for an acceptable delay window, RECOMMENDS that at most one time-step is allowed as the network delay, and requires that, after a successful validation, the verifier MUST NOT accept the same OTP again. Section 6 RECOMMENDS a limit on clock drift and a resynchronisation procedure. Neither section specifies a clock implementation, and neither defines a record on the prover of when a code was displayed or copied. In common deployment a verifier accepts the previous, current, and next step (a "+/- 1" window). Under that policy, three different codes can be valid at once and a given code remains acceptable for 90 seconds. The one-time-use rule in Section 5.2 applies only at that verifier and only after it has already accepted that OTP. It does not block a different adjacent-step code, and it cannot show whether a code in the window was ever viewed on the device. This document specifies the following optional mechanisms, which are used together with [RFC6238] and do not change it: Rigopoulos Expires 4 June 2027 [Page 3] Internet-Draft TOTP Offline Time and Viewed Records December 2026 * an Offline Time Source profile, in which the prover derives Unix time from a local clock with no network dependency, a declared maximum drift rate D_max, a resynchronisation procedure, and a measurement method; * applicability of that profile to devices built or upgraded with a qualifying local real-time clock, including new hardware and offline crypto wallets, together with battery-status reporting (Section 4.4); * an optional Reference Device role that provides signed time messages as a trusted local reference (Section 4.6); * a prover-side viewed record, written when a TOTP value is displayed or copied, containing the time-step T, a truncated keyed digest of the code (not the plaintext OTP), a local viewed timestamp, and a monotonic sequence number; * an optional binding of that record to an identifier or digest of the action or transaction for which the code was displayed (Section 5.4); * an optional verifier check that uses the record to reject or flag an OTP associated with a step the device never recorded as viewed, which narrows the effective +/- 1 window for unviewed neighbour steps; and * a requirement that a verifier that implements this document apply the one-time-use rule that already exists in Section 5.2 of [RFC6238] atomically (Section 6.4). The TOTP calculation is unchanged. Provers and verifiers that implement only [RFC6238] remain interoperable with implementations of this document. This document is Experimental because the time-source profile, the record format, the optional verifier check, the Reference Device role, and the optional transaction binding need implementation and operational experience, including privacy and deployment practice, before any later revision is considered. 2. Conventions and Definitions The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. Rigopoulos Expires 4 June 2027 [Page 4] Internet-Draft TOTP Offline Time and Viewed Records December 2026 3. Terminology Prover The token or application that computes a TOTP value, as in [RFC6238]. Verifier The validation system that accepts or rejects a TOTP value. Time-step T The integer moving factor defined in Section 4.2 of [RFC6238]. D_max The maximum allowed fractional frequency error of a local clock, in parts per million (ppm), declared by an implementation of the Offline Time Source profile. A declaration of D_max MUST state the temperature range over which it applies. Viewed record An append-only entry written by the prover when a TOTP value for a given T is displayed or copied to the user. Audit mode Optional verifier behaviour that accepts TOTP values as in [RFC6238] and later compares them with viewed records, flagging mismatches. Enforce mode Optional verifier behaviour that, at validation time, requires a viewed record for the accepted time-step and rejects the OTP if no such record is provided. Reference Device An optional standalone device that keeps a higher-quality local clock and issues signed time messages that a prover may use as a trusted reference under Section 4.2. Action identifier An optional identifier or digest, carried in a viewed record, of the action or transaction for which a TOTP value was displayed, as specified in Section 5.4. Rigopoulos Expires 4 June 2027 [Page 5] Internet-Draft TOTP Offline Time and Viewed Records December 2026 4. Offline Time Source An implementation that claims the Offline Time Source profile defined here MUST derive the "Current Unix time" used in Section 4.2 of [RFC6238] from a local clock, with no network protocol required to compute T or the TOTP value. The profile does not change X, T0, the hash function, the digit count, or the truncation of [RFC6238]. This document does not specify a particular clock part or product. Any local real-time clock, including a temperature-compensated crystal oscillator or a similar time source, may be used if it meets the declared D_max and the measurement method in Section 4.3. 4.1. Maximum Drift Rate An implementation of this profile MUST declare a maximum drift rate D_max in ppm. D_max is a bound on the absolute fractional frequency error of the local clock relative to a trusted reference after the clock has been set. The declaration MUST state the temperature range over which D_max applies. A figure quoted for a narrower range (for example 0 degrees C to +40 degrees C) MUST NOT be used as D_max outside that range. Under a constant-rate model, the time in days for the accumulated offset to reach a threshold of S seconds is t_days = S / (|D_max| * 10^-6) / 86400 Implementations SHOULD NOT declare a D_max greater than 20 ppm. A tighter class (for example 2 ppm) MAY be declared if the measurement method supports it. The values 2 ppm and 20 ppm are model classes for illustration and default policy; they are not measurements of any particular device. A declared class of 2 ppm does not mean that the clock has no drift. Even at 2 ppm, under the constant-rate model, the accumulated offset reaches one default time-step (30 seconds) in about 174 days, as calculated below. At 20 ppm, the model reaches a 15-second offset in 8.681 days and a 30-second offset (one default time-step) in 17.361 days. At 2 ppm those intervals are 86.806 days and 173.611 days. Any nonzero offset of at most one time-step already requires a verifier window of +/- 1 if the prover's current code is to be accepted at every phase of the step. The moment the offset exceeds X seconds, a window of +/- 2 is required. Implementations SHOULD set or compare the local clock against a trusted reference often enough that the expected offset remains at most one time-step, given the declared D_max. Rigopoulos Expires 4 June 2027 [Page 6] Internet-Draft TOTP Offline Time and Viewed Records December 2026 4.2. Setting and Resynchronisation When the local clock is first set, and whenever the measured offset exceeds a configured threshold, the clock MUST be set from a trusted reference. That threshold SHOULD be no greater than one time-step X. The trusted reference MAY be a network time protocol, a satellite time source, or another local reference of known quality, including a Reference Device as specified in Section 4.6. Use of a network protocol to set the clock does not remove the requirement that ordinary TOTP generation under this profile proceed without a network dependency. Re-synchronisation means that the device's Unix time is checked against a trusted reference and, if required, set from that reference. It does not generate, rotate, or replace the shared TOTP secret. A new shared secret is obtained only by a separate enrolment or re-enrolment procedure. If the accumulated offset is larger than the verifier's accepted window, automatic resynchronisation as described in Section 6 of [RFC6238] may not be sufficient. In that case an additional authentication measure SHOULD be used before the clock is set, as already recommended in that section. 4.3. Measurement Method An implementation that claims a D_max MUST be able to demonstrate it by the following method, or by a method of equal or greater rigour. 1. Set the local clock from a trusted reference and record the device Unix time and the reference Unix time. 2. Once per day, for at least 14 consecutive days (28 days is RECOMMENDED), record both Unix times again. The reference SHOULD be NTP, a satellite time source, or a Reference Device whose own last trusted sync and D_max are known. 3. Compute the daily offset (device seconds minus reference seconds), the maximum absolute offset, and a least-squares estimate of rate in ppm over the interval. 4. The claim holds if the estimated rate and the projected offset remain within D_max and within one time-step over the intended service interval, for the temperature range stated with D_max. This method is a laboratory or operational check of a clock class. It is not a substitute for a published measurement of a specific shipped device. Rigopoulos Expires 4 June 2027 [Page 7] Internet-Draft TOTP Offline Time and Viewed Records December 2026 4.4. Applicability to New Hardware and Existing Devices The Offline Time Source profile applies to a device that is built, or later upgraded, with a local real-time clock that can keep time without a network, meets a declared D_max over a stated temperature range, and can be measured as in Section 4.3. Typical qualifying clocks include a battery-backed RTC or a crystal oscillator with temperature compensation (for example a TCXO RTC). The profile is a requirement that new designs MAY adopt. This document makes no claim that any existing commercial product already meets it. A device that has no independent local real-time clock, and that obtains Unix time from a host operating system or from the host on each use, MUST NOT claim the Offline Time Source profile. Such a device MAY still implement the viewed record in Section 5, because that record does not depend on the source of time. Offline crypto wallets and similar tokens are a natural application of the profile: a wallet that never touches a network still needs a trustworthy local time-step in order to compute TOTP, and a declared D_max gives a verifier a stated reason to keep a narrow window. Existing wallet models that take time from a host, and that have no qualifying RTC, would not meet the profile unless upgraded. The viewed record, and the optional transaction binding in Section 5.4, can be adopted independently of the clock source and are therefore available to current hardware as well. An example microcontroller and RTC combination that could be used for laboratory evaluation is described in Section 12. That description is an example only. It is not a measurement under Section 4.3, and it is not a statement about any shipping product. 4.5. Battery Status A battery-backed implementation of this profile SHOULD report the status of the clock's backup supply (for example a low-battery indication or a measured backup voltage) to the user or to a managing application. When the backup supply is low, missing, or otherwise indicated as insufficient, the implementation MUST treat the local clock as untrusted until the clock has been set again from a trusted reference as in Section 4.2. Codes MAY still be generated in that state, but an implementation that claims the profile MUST NOT present them as satisfying the declared D_max. Rigopoulos Expires 4 June 2027 [Page 8] Internet-Draft TOTP Offline Time and Viewed Records December 2026 Battery life MAY be estimated from the cell's datasheet capacity and the RTC's timekeeping current, taking into account self-discharge and any additional current drawn by the module. This document does not publish a battery-life figure for any cell or module. An implementer who publishes such a figure MUST cite the capacity and current values used and the conditions under which they apply. Battery life and calendar age are not measures of clock accuracy. They MUST NOT be used to rank a device as a trusted time reference; see Section 4.6.4. 4.6. Reference Device A deployment MAY use a standalone Reference Device as the "local reference of known quality" permitted by Section 4.2. The role is optional. Ordinary TOTP generation under the Offline Time Source profile remains possible without one, provided the prover's own clock has been set from some trusted reference and remains within the configured offset threshold. 4.6.1. Role and Clock Quality A Reference Device keeps a local clock of higher quality than the provers that rely on it and issues signed time messages to those provers over a local link. Suitable clock classes include a GPS- disciplined oscillator, a radio-controlled clock, or a temperature- controlled crystal that is itself periodically checked against a trusted time source. This document does not specify a particular part. The local link MAY be Bluetooth, NFC, USB, or a local network. The profile still requires that generating a TOTP value does not depend on a network protocol; a prover may remain offline between syncs. 4.6.2. Signed Time Message A time message from a Reference Device MUST contain at least the following fields, and the signature or MAC MUST cover all of them: * a format version; * the reference Unix time at the moment of issue; * the Reference Device's declared D_max and the temperature range over which that D_max applies; * the Unix time of the Reference Device's own last sync from a trusted source; and Rigopoulos Expires 4 June 2027 [Page 9] Internet-Draft TOTP Offline Time and Viewed Records December 2026 * an identifier of that last trusted source, if known. The message MUST be authenticated so that a prover can detect forgery or alteration. The authentication key or public key is provisioned to the prover by an authenticated procedure that is out of scope of this document. The concrete encoding and the signature or MAC algorithm are agreed at provisioning. A JSON [RFC8259] object is a suitable illustrative encoding: { "v": 1, "ref_unix": 1764547200, "d_max_ppm": 2, "d_max_temp": "0C..+40C", "last_sync_unix": 1764460800, "last_sync_source": "gnss", "alg": "Ed25519", "sig": "...hex..." } The example is illustrative. It is not a test vector, and the signature value is omitted. 4.6.3. Measuring and Applying an Offset When a prover receives an authentic time message, it MUST compute the offset as device Unix time minus the reference Unix time carried in the message, and it SHOULD log that offset, the reference identifier, and the time of comparison. The prover MUST NOT reset its clock from the message unless the absolute offset exceeds the configured threshold, which SHOULD be no greater than one time-step X, as already required in Section 4.2. If the offset is larger than the verifier's accepted window, the additional authentication measure in Section 4.2 still applies before the clock is set. A prover MUST ignore a message that fails authentication, and SHOULD ignore a message whose claimed last-sync time is older than a configured limit or whose declared D_max is worse than the prover will accept. 4.6.4. Ranking References If more than one candidate reference is available, a prover SHOULD prefer the candidate with the tighter declared D_max and, if those are equal, the more recent authenticated last trusted sync. A prover MUST NOT rank references by battery life, by advertised remaining capacity, or by the age or "newness" of the device. Those properties do not measure frequency error, and a newer or longer-lived clock can Rigopoulos Expires 4 June 2027 [Page 10] Internet-Draft TOTP Offline Time and Viewed Records December 2026 still be unset, poorly characterised, or tampered with. Provers MUST NOT treat one another as trusted references merely because they implement this profile. Unauthenticated peer-to-peer copying of time, including a policy of following whichever peer reports the longest battery life, is a tamper-propagation risk: a single wrong or compromised clock can move the others (see Section 13). 4.6.5. Software Sync Path A software application MAY provide the passage through which a prover obtains a signed time message from a Reference Device or from another trusted reference, for example over USB or another local link, without itself being the clock source. The author's Last Viewed software is one such application that could provide that sync path. This document does not claim that any particular software release already implements the path, and it makes no claim about the clock specifications of any hardware used with that software. 5. The Viewed Record When a TOTP value is displayed or copied, a prover that implements viewed records MUST append a record for the corresponding time-step T. Records MUST be append-only: an implementation MUST NOT alter or delete an earlier record except as part of a documented, integrity- preserving rotation or expiry policy. The plaintext OTP MUST NOT be stored in the record; a truncated keyed digest is stored instead. 5.1. Record Fields Each record contains at least the following fields: v Format version. This document defines version 1. seq A monotonic sequence number. The first record on a prover MUST use seq = 1. Each later record MUST use a seq greater than all earlier records on that prover. T The time-step counter of the viewed TOTP value, as in [RFC6238]. viewed The local time of the view, as an RFC 3339 UTC timestamp with a "Z" suffix and second precision (for example, 1970-01-01T00:00:59Z). Rigopoulos Expires 4 June 2027 [Page 11] Internet-Draft TOTP Offline Time and Viewed Records December 2026 digits The TOTP digit count (typically 6 or 8). alg The TOTP hash algorithm: "SHA1", "SHA256", or "SHA512". digest Lowercase hexadecimal encoding of the leftmost 8 octets of the viewed-code MAC defined below. mac RECOMMENDED when a record is exported or sent to a verifier. Lowercase hexadecimal encoding of the leftmost 16 octets of the covering MAC defined below. action OPTIONAL. Present when the transaction-binding extension of Section 5.4 is used. Lowercase hexadecimal encoding of an identifier or digest of the action or transaction for which the code was displayed, as specified in that section. When this field is absent, the covering MAC is computed exactly as in the preceding revision of this document, so the test vectors in Section 8 remain unchanged. The viewed-code digest is: HMAC-SHA-256(K, "TOTP-VIEWED" || 0x00 || uint64be(T) || ASCII(code)) where K is the shared TOTP secret, uint64be(T) is T as an 8-octet big-endian unsigned integer, and ASCII(code) is the exact decimal digit string of the viewed OTP, including leading zeros. The ASCII label is the 11-octet string %x54.4F.54.50.2D.56.49.45.57.45.44. The covering MAC, when the action field is absent, is: HMAC-SHA-256(K, "TOTP-VIEWED-MAC" || 0x00 || uint64be(seq) || uint64be(T) || ASCII(viewed) || uint8(digits) || ASCII(alg) || digest_octets) The ASCII label is the 15-octet string %x54.4F.54.50.2D.56.49.45.57.45.44.2D.4D.41.43. digest_octets is the 8-octet value encoded by the digest field, not its hexadecimal representation. The mac field MUST NOT be included in its own input. When the action field is present, the covering MAC is the same construction with the action octets appended: Rigopoulos Expires 4 June 2027 [Page 12] Internet-Draft TOTP Offline Time and Viewed Records December 2026 HMAC-SHA-256(K, "TOTP-VIEWED-MAC" || 0x00 || uint64be(seq) || uint64be(T) || ASCII(viewed) || uint8(digits) || ASCII(alg) || digest_octets || 0x00 || action_octets) where action_octets is the raw octet string encoded by the action field, not its hexadecimal representation. The additional 0x00 separator is omitted when the action field is absent, so an unextended record has the same MAC as in version -00. An optional account or issuer label MAY be stored locally; implementations that export records SHOULD consider the privacy implications in Section 14. 5.2. JSON Representation A log MAY be represented as a JSON [RFC8259] array of objects. The following example is the first Appendix B test time (Unix time 59) with the 8-digit SHA-1 TOTP of [RFC6238]: { "v": 1, "seq": 1, "T": 1, "viewed": "1970-01-01T00:00:59Z", "digits": 8, "alg": "SHA1", "digest": "6cd61375889ffa0b", "mac": "44e256b21a8a649325bc0e411e049f45" } 5.3. CBOR Representation The same record MAY be represented in CBOR [RFC8949]. In diagnostic notation: { "v": 1, "seq": 1, "T": 1, "viewed": "1970-01-01T00:00:59Z", "digits": 8, "alg": "SHA1", "digest": h'6CD61375889FFA0B', "mac": h'44E256B21A8A649325BC0E411E049F45' } Rigopoulos Expires 4 June 2027 [Page 13] Internet-Draft TOTP Offline Time and Viewed Records December 2026 Interoperable exchange SHOULD use the JSON representation unless both sides have agreed to CBOR. This document does not register a media type (see Section 15). 5.4. Transaction Binding The viewed record defined above covers a time-step. It does not, by itself, distinguish one use of a viewed code from another use of the same code. The simulation in Section 10 showed that when a code had been recorded as viewed, enforce mode still accepted the first submission of that code, including a submission that beat the user, and that a non-atomic verifier could accept the same viewed code from ten parallel clients. Those cases are the gap that this optional extension is specified to close, under the conditions stated below. A prover and a verifier MAY agree a policy in which each viewed record also carries an action identifier for the action or transaction the code was displayed to authorise. Typical contents are a verifier-supplied challenge or session identifier, or a digest of transaction fields such as the amount and destination. Related challenge-response work, in which transaction details enter the OTP calculation itself, is specified for HOTP in the OATH Challenge- Response Algorithm (OCRA) [RFC6287]. This extension does not change the TOTP value; the identifier is carried in the viewed record, not mixed into the OTP. When a digest is used, it is RECOMMENDED that action be the lowercase hexadecimal encoding of the leftmost 16 octets of SHA-256 over a canonical UTF-8 encoding of the agreed transaction fields. A verifier-supplied challenge is encoded as lowercase hexadecimal of the challenge octets. Plaintext amounts, destinations, or account identifiers SHOULD NOT be placed in an exported record (see Section 14). When this policy is in force, a verifier in enforce mode MUST reject an OTP unless an authenticated viewed record covers the accepted time-step and the action field matches the action being authorised. A record without an action field MUST be treated as not covering that action. The effect is that a code which remains valid across a +/- 1 window cannot authorise a second, different transaction or session. A relay of a viewed code to a different login or payment, and a first use of an intercepted code against a different action than the one that was displayed, are therefore rejected. Rigopoulos Expires 4 June 2027 [Page 14] Internet-Draft TOTP Offline Time and Viewed Records December 2026 This extension does not prevent the first submission of a viewed code against the same action or challenge that was displayed, for example a shoulder-surf of a code already bound to that payment or login. The Section 5.2 rule in [RFC6238], applied atomically as in Section 6.4, remains the control that stops a second acceptance of that same (OTP, action) pair at that verifier. Transaction binding is an explicit, mutually agreed policy, like enforce mode. A verifier that has not agreed the policy MUST ignore a present action field for acceptance, and MUST still recompute the covering MAC with the field included if it is present, so that a bound record is not mistaken for an unbound one. 6. Verifier Check Support for viewed records on the verifier is OPTIONAL. A verifier that does not implement this section MUST continue to validate TOTP values as specified in [RFC6238]. When this section is implemented, two modes are defined. 6.1. Audit Mode In audit mode the verifier validates the OTP as in [RFC6238], including the Section 5.2 rule that the same OTP MUST NOT be accepted a second time after success. Independently, it obtains viewed records (at the time of validation, or later) and MUST flag an accepted OTP whose accepted time-step has no matching viewed record on the prover, or whose accepted time-step differs from the step or steps recorded as viewed for that authentication attempt. Audit mode detects unviewed or wrong-step acceptances after the fact. It does not, by itself, prevent acceptance. 6.2. Enforce Mode In enforce mode the verifier, at validation time, additionally requires one or more viewed records covering the accepted time-step. If it accepts an OTP at step S (including a match in a delay or resynchronisation window), and no viewed record with T = S is presented and authenticated, it MUST reject the OTP. Rigopoulos Expires 4 June 2027 [Page 15] Internet-Draft TOTP Offline Time and Viewed Records December 2026 Under a common +/- 1 window, a user who viewed only step T can still submit the current-step code. Codes for T-1 and T+1, which would otherwise be acceptable as different OTPs, are rejected unless they too were recorded as viewed. This narrows the effective window for unviewed neighbour steps without changing how the TOTP value is computed. It does not detect a copy of a code that was recorded as viewed (for example a shoulder-surf of the displayed OTP), unless the optional transaction-binding policy in Section 5.4 applies and the copy is presented for a different action. 6.3. Obtaining Records How records are carried to the verifier is out of scope of the TOTP calculation. An implementation MAY send records together with the OTP, export them later for audit, or compare them on a local management path. When records are sent, the mac field SHOULD be present, and the verifier MUST recompute the digest and the mac using the shared secret before relying on the record. A record with an invalid mac MUST be ignored for enforcement and MUST be flagged in audit mode. 6.4. Atomic One-Time-Use Check The rule in Section 5.2 of [RFC6238] that the same OTP MUST NOT be accepted a second time after success is effective only if the check that the OTP has not already been used, and the update that records the use, are performed atomically with respect to concurrent validations of the same OTP at that verifier. A verifier that implements this document MUST apply that check and update as a single critical section (for example under a lock, or as an atomic compare-and-set on the stored last-used step). The simulation in Section 10 showed that a check-then-update implementation, under a forced race of ten parallel submissions of a viewed code, accepted all ten, and that enforce mode did not close that race, because the viewed record was authentic for the same step on every attempt. Transaction binding does not remove this requirement for two submissions of the same (OTP, action) pair. Later tests (Section 11) showed that, with a pause between check and update of 0.5 ms or more, a non-atomic verifier accepted the same code more than once in every one of 200 trials with 100 parallel clients, and that enforce mode on a non-atomic verifier still accepted a viewed code up to 100 times. An atomic update accepted exactly one submission in every trial. Rigopoulos Expires 4 June 2027 [Page 16] Internet-Draft TOTP Offline Time and Viewed Records December 2026 7. Interoperability with RFC 6238 For the same secret K, origin T0, time-step X, hash algorithm, digit count, and Unix time, an implementation of this document MUST produce the same TOTP value as [RFC6238]. The Offline Time Source profile and the viewed record do not alter that value. A prover that implements this document can be validated by a verifier that implements only [RFC6238]. A verifier that implements this document can validate a prover that implements only [RFC6238], provided it does not require enforce mode. Enforce mode, and the transaction-binding policy of Section 5.4, are therefore explicit, mutually agreed policies, not a silent change to TOTP. 7.1. Relationship to RFC 6238 This document does not update, obsolete, or modify [RFC6238], and RFC 6238 remains as published. [RFC6238] is a normative reference for the Unix-time basis of the moving factor (Section 4.2 and requirement R1 in Section 3), for the delay window and one-time-use rule (Section 5.2), and for resynchronisation (Section 6). Everything in this document is additional to those rules and applies only to an implementation that chooses to claim it. An implementation of RFC 6238 that does not claim anything in this document is unaffected. This document makes no claim of adoption or endorsement by any standards body, vendor, or other organisation. 8. Test Vectors The following vectors use the Appendix B test token of [RFC6238]: the ASCII shared secret "12345678901234567890", X = 30, T0 = 0, and HMAC- SHA-1. The 8-digit TOTP values MUST match Table 1 of that RFC. The 6-digit values are the same truncated integer reduced modulo 10^6, included because six-digit codes are widely deployed. The digest and mac fields were generated offline from the constructions in Section 5.1. The "viewed" timestamp is the UTC instant equal to the listed Unix time, as if the code were viewed at the moment it was generated. Sequence numbers run from 1 to 6 in table order. These vectors do not include the optional action field. Table 1 lists the TOTP values. Table 2 lists the viewed records for the 8-digit codes. Table 3 lists the digest and mac for the corresponding 6-digit codes, using the same seq, T, and viewed timestamp, with digits = 6. Rigopoulos Expires 4 June 2027 [Page 17] Internet-Draft TOTP Offline Time and Viewed Records December 2026 +===========+====================+================+========+========+ |Unix time |UTC |T (hex) |TOTP (8)| TOTP | | | | | | (6) | +===========+====================+================+========+========+ |59 |1970-01-01T00:00:59Z|0000000000000001|94287082| 287082 | +-----------+--------------------+----------------+--------+--------+ |1111111109 |2005-03-18T01:58:29Z|00000000023523EC|07081804| 081804 | +-----------+--------------------+----------------+--------+--------+ |1111111111 |2005-03-18T01:58:31Z|00000000023523ED|14050471| 050471 | +-----------+--------------------+----------------+--------+--------+ |1234567890 |2009-02-13T23:31:30Z|000000000273EF07|89005924| 005924 | +-----------+--------------------+----------------+--------+--------+ |2000000000 |2033-05-18T03:33:20Z|0000000003F940AA|69279037| 279037 | +-----------+--------------------+----------------+--------+--------+ |20000000000|2603-10-11T11:33:20Z|0000000027BC86AA|65353130| 353130 | +-----------+--------------------+----------------+--------+--------+ Table 1: TOTP values for the Appendix B times (HMAC-SHA-1) +===+=========+================+==================================+ |seq|T |digest | mac | +===+=========+================+==================================+ |1 |1 |6cd61375889ffa0b| 44e256b21a8a649325bc0e411e049f45 | +---+---------+----------------+----------------------------------+ |2 |37037036 |edbcdf5108fb06f7| 260c2e3d63510828b3714e034c9d383a | +---+---------+----------------+----------------------------------+ |3 |37037037 |473efb3fb6e79bec| c1ddec49506f8e556386f0cff4d7ba46 | +---+---------+----------------+----------------------------------+ |4 |41152263 |7da5aebe378d6144| dc673ac6fc03c3ceee2058b029a6a2c5 | +---+---------+----------------+----------------------------------+ |5 |66666666 |b20352a510905140| e3c595af1a3906af6511edbdf0574fde | +---+---------+----------------+----------------------------------+ |6 |666666666|ecbac0e7cbf5f3ec| e19efccee63a8278db61ff4c08b7570c | +---+---------+----------------+----------------------------------+ Table 2: Viewed records for the 8-digit codes (alg = SHA1, digits = 8) Rigopoulos Expires 4 June 2027 [Page 18] Internet-Draft TOTP Offline Time and Viewed Records December 2026 +===+=========+================+==================================+ |seq|T |digest | mac | +===+=========+================+==================================+ |1 |1 |40fdf812c2d8d342| 100b1728be424e2f42a8005fff2b3035 | +---+---------+----------------+----------------------------------+ |2 |37037036 |e85015ba83d941d4| 459e24a8f390cd8352482e4c1ea395f6 | +---+---------+----------------+----------------------------------+ |3 |37037037 |49631a5028eda401| 7335e0efb752ac3c6caf9ecbb52c864a | +---+---------+----------------+----------------------------------+ |4 |41152263 |37577bdb0a361084| 194204acbbcb0ef8b4b3add75b1a9e68 | +---+---------+----------------+----------------------------------+ |5 |66666666 |14be20c848413dc4| 4dcffc240108b425f856c794dd11d9d6 | +---+---------+----------------+----------------------------------+ |6 |666666666|a88648e1600b3dce| 4b636bbe283295ded27b896100e1ec59 | +---+---------+----------------+----------------------------------+ Table 3: Digest and mac for the 6-digit codes (alg = SHA1, digits = 6) 9. Measured Results The figures in this section come from a reproducible model and simulation run offline (networking disabled) on 30 November 2026, with seed 20261130 and 200000 Monte Carlo trials. They are labelled as exact arithmetic, a constant-rate clock model, or a simulation with stated assumptions. They are not measurements of a particular product or of a carrier network. The run also confirmed that all six SHA-1 8-digit Appendix B test values of [RFC6238] matched. A later, separate simulation of verifier behaviour is reported in Section 10. Exact acceptance-window arithmetic, with X = 30 seconds: * Window 0: 1 code valid at once; a given code is accepted for 30 seconds. * Window +/- 1: 3 codes valid at once; a given code is accepted for 90 seconds. * Window +/- 2: 5 codes valid at once; a given code is accepted for 150 seconds. Constant-rate isolated clock model (exact), time to a 15-second and 30-second offset: * 0.5 ppm: 347.222 days / 694.444 days. * 2 ppm: 86.806 days / 173.611 days. Rigopoulos Expires 4 June 2027 [Page 19] Internet-Draft TOTP Offline Time and Viewed Records December 2026 * 5 ppm: 34.722 days / 69.444 days. * 20 ppm: 8.681 days / 17.361 days. * 50 ppm: 3.472 days / 6.944 days. Relative drift between an offline issuer or verifier and an offline device is |r_device - r_verifier| ppm. An NTP-synced server is modelled as 0 ppm against true time. If both offline clocks drift at 2 ppm in the same direction, the relative rate is 0 and they do not force a wider window. If they drift at 2 ppm in opposite directions, the relative rate is 4 ppm and they reach a 15-second offset in 43.403 days, which is sooner than a 2 ppm device against an NTP- synced server (86.806 days). An offline issuer is therefore more accurate only when the two clocks are closely matched. A network-sync simulation assumed a daily healthy residual of Normal(0, 0.020 s) and, independently, bad jumps as a Poisson process with a mean of 2 events per year, each Uniform(15, 90) seconds in magnitude and random in sign, over 2000 traces of 50 years. No healthy-only trace exceeded 15 seconds. With jumps, the median time to the first offset of 15 seconds or more was 121 days (mean 177.81; analytic mean wait for the first jump is 182.62 days). These assumptions are not measured carrier data. Replay simulations used a +/- 1 window and the following delay assumptions, which are not measured user behaviour: the view falls uniformly in the current step; the typist submits after Uniform(2, 12) s; a fast attacker submits after Uniform(0.5, 5) s; a slower attacker after Uniform(5, 25) s. * Shoulder-surf of the viewed code, fast attacker: accepted before the typist in 89.97% of trials. Detectable from the viewed record alone: 0%, because the same step was viewed. * The same scenario, slower attacker: 12.23% accepted before the typist; still 0% detectable from the record alone. * Unviewed adjacent code C_T-1: accepted in 90.80% (fast) and 49.80% (slow) of trials. Unviewed adjacent C_T+1, and a code never viewed on the device: accepted in 100% of trials. In all of those accepted cases, 100% are detectable afterwards if the verifier compares the record. The measurable improvement is therefore detection of unviewed or wrong-step OTPs, and prevention only when the verifier implements enforce mode. The record does not, by itself, prevent acceptance, and it does not identify a copy of a code that was viewed. Rigopoulos Expires 4 June 2027 [Page 20] Internet-Draft TOTP Offline Time and Viewed Records December 2026 10. Implementation and Test Results This section reports a later local simulation of verifier behaviour, run offline on 30 November 2026 against the mechanisms in this document. The TOTP generator was checked first against the SHA-1, SHA-256, and SHA-512 8-digit Appendix B test values of [RFC6238] and against the 6-digit values and viewed-record digest and mac fields in Section 8. All of those vectors matched. The simulation used the Appendix B SHA-1 test token, 6-digit codes, X = 30, T0 = 0, a +/- 1 window, and Unix time 1111111111 (T = 37037037). It compared a plain RFC 6238 verifier, audit mode, and enforce mode. The Section 5.2 one-time-use rule was implemented in two ways: a naive check-then- update path, exercised with real threads and a barrier so that every thread passed the unused-step check before any thread updated (a forced race), and an atomic path in which the check and the update ran under a lock. The code is in the author's possession and can be made public. The run did not contact any live authentication service, and the numbers below are not measurements of a particular deployed verifier. In the first scenario a user viewed C(T) and an attacker who intercepted that code submitted it from 10 parallel clients. The viewed record was authentic and covered T. +==============================+==========+==========+=========+ | Verifier | Accepted | Rejected | Flagged | +==============================+==========+==========+=========+ | RFC 6238 naive (forced race) | 10 | 0 | 0 | +------------------------------+----------+----------+---------+ | RFC 6238 atomic | 1 | 9 | 0 | +------------------------------+----------+----------+---------+ | Audit naive (forced race) | 10 | 0 | 0 | +------------------------------+----------+----------+---------+ | Audit atomic | 1 | 9 | 0 | +------------------------------+----------+----------+---------+ | Enforce naive (forced race) | 10 | 0 | 0 | +------------------------------+----------+----------+---------+ | Enforce atomic | 1 | 9 | 0 | +------------------------------+----------+----------+---------+ Table 4: Ten parallel submissions of an intercepted viewed code C(T) The nine rejections on the atomic rows are the Section 5.2 rule of [RFC6238], not the viewed-record check. Enforce mode did not close the forced race. Rigopoulos Expires 4 June 2027 [Page 21] Internet-Draft TOTP Offline Time and Viewed Records December 2026 In the second scenario the device had viewed only T, and the attacker submitted the computed neighbour codes C(T-1) and C(T+1) in sequence. +=================+==========+==========+=========+ | Verifier | Accepted | Rejected | Flagged | +=================+==========+==========+=========+ | RFC 6238 atomic | 2 | 0 | 0 | +-----------------+----------+----------+---------+ | Audit atomic | 2 | 0 | 2 | +-----------------+----------+----------+---------+ | Enforce atomic | 0 | 2 | 0 | +-----------------+----------+----------+---------+ Table 5: Computed unviewed neighbour codes C(T-1) and C(T+1) The probability that N unique random 6-digit guesses hit at least one of k valid codes, without replacement, is 1 - C(10^6 - k, N) / C(10^6, N). The table below is that exact combinatorics; it is not a live guessing run against a verifier. A Monte Carlo of 20000 trials, N = 1000, seed 20261130, against the two unviewed neighbour codes, observed a hit rate of 0.00195, compared with the exact value 1.999000999001e-3. Because enforce mode rejected computed neighbour codes when those steps were not viewed, a correct guess of only C(T-1) or C(T+1) would also be rejected, and the remaining target, if T was viewed, is C(T) alone. +======+===================+===================+===================+ |N | P(2 unviewed | P(any of 3 window | P(C(T) only, | | | neighbours) | codes) | enforce) | +======+===================+===================+===================+ |1 | 2.000000000000e-6 | 3.000000000000e-6 | 1.000000000000e-6 | +------+-------------------+-------------------+-------------------+ |10 | 1.999990999991e-5 | 2.999973000045e-5 | 1.000000000000e-5 | +------+-------------------+-------------------+-------------------+ |100 | 1.999900999901e-4 | 2.999703009405e-4 | 1.000000000000e-4 | +------+-------------------+-------------------+-------------------+ |1000 | 1.999000999001e-3 | 2.997003994008e-3 | 1.000000000000e-3 | +------+-------------------+-------------------+-------------------+ |10000 | 1.990000990001e-2 | 2.970102940305e-2 | 1.000000000000e-2 | +------+-------------------+-------------------+-------------------+ |100000| 1.900000900001e-1 | 2.710002430004e-1 | 1.000000000000e-1 | +------+-------------------+-------------------+-------------------+ Table 6: Exact P(at least one hit) for N unique 6-digit guesses Rigopoulos Expires 4 June 2027 [Page 22] Internet-Draft TOTP Offline Time and Viewed Records December 2026 In the third scenario the attacker did not have the shared secret and submitted C(T-1) with a viewed record for T-1 whose digest and mac were computed under the wrong key. No authentic record was presented. +=================+==========+==========+=========+ | Verifier | Accepted | Rejected | Flagged | +=================+==========+==========+=========+ | RFC 6238 atomic | 1 | 0 | 0 | +-----------------+----------+----------+---------+ | Audit atomic | 1 | 0 | 1 | +-----------------+----------+----------+---------+ | Enforce atomic | 0 | 1 | 0 | +-----------------+----------+----------+---------+ Table 7: Forged viewed record without the shared secret In the fourth scenario C(T) was submitted twice, with the authentic viewed record both times. Every verifier accepted the first submission and rejected the second (1 accepted, 1 rejected, 0 flagged). That rejection is the Section 5.2 rule of [RFC6238], which this document keeps; the viewed-record check was not what rejected the replay. In the fifth scenario an attacker who held the shared secret computed C(T+1) and a valid covering MAC for step T+1. The device itself never viewed T+1. Every verifier, including enforce mode, accepted the attempt (1 accepted, 0 rejected, 0 flagged). In the sixth scenario the user viewed C(T), the attacker submitted that code first, and the user submitted it afterwards. Every verifier accepted the attacker and rejected the user (1 accepted, 1 rejected, 0 flagged). Audit mode did not flag the attacker's accept, because the record covered T. What the simulation showed the draft stops, in enforce mode only: * computed unviewed neighbour-step codes (second scenario); * a viewed record forged without the shared secret (third scenario). What it detects only, in audit mode, without changing acceptance: unviewed neighbour-step accepts, and an accept that carried a bad mac. Audit mode did not change accepted or rejected counts relative to RFC 6238 in any scenario that was run. What it does not stop: Rigopoulos Expires 4 June 2027 [Page 23] Internet-Draft TOTP Offline Time and Viewed Records December 2026 * the first use of an intercepted code that was viewed, including ten parallel clients of that code (first scenario) and an attacker who submits the viewed code before the user (sixth scenario); * a check-then-update race on the one-time-use rule, which enforce mode did not close (first scenario, naive rows); * an attacker who has the shared secret and forges both a code and a record (fifth scenario); * a second submission of an already-accepted code, which is already refused by [RFC6238] Section 5.2 (fourth scenario). The optional transaction-binding extension in Section 5.4 was specified to close the first of those gaps when each authorisation has a distinct action or challenge. It was not itself part of the simulation, and this section does not report results for it. 11. Live and Pressure Test Results This section reports two further sets of tests run on 30 November 2026. They test the one-time-use rule and the viewed-record check under parallel load. They do not measure any deployed service. In the live runs a local test login site, listening only on the loopback address, verified standard TOTP (HMAC-SHA-1, six digits, X = 30 seconds, +/- 1 window) from a commercially available authenticator application. For each run the author supplied the code currently displayed by that application, and N clients submitted that same code at the same time. The "naive" verifier checked that the step was unused, paused for a deliberate 150 ms, and then recorded the step, so the race was made reliable on purpose. The "atomic" verifier performed the check and the update as one operation. The deliberate pause means these runs show what a non-atomic verifier can do, and do not show how often real servers have such a gap. An authenticator application of this kind does not write viewed records, so enforce mode was not exercised in the live runs. Rigopoulos Expires 4 June 2027 [Page 24] Internet-Draft TOTP Offline Time and Viewed Records December 2026 +==========+=============+==========+==========+ | Verifier | Clients | Accepted | Rejected | +==========+=============+==========+==========+ | Naive | 10 | 10 | 0 | +----------+-------------+----------+----------+ | Naive | 50 | 50 | 0 | +----------+-------------+----------+----------+ | Naive | 100 (run 1) | 100 | 0 | +----------+-------------+----------+----------+ | Naive | 100 (run 2) | 100 | 0 | +----------+-------------+----------+----------+ | Atomic | 10 (run 1) | 1 | 9 | +----------+-------------+----------+----------+ | Atomic | 10 (run 2) | 1 | 9 | +----------+-------------+----------+----------+ | Atomic | 50 | 1 | 49 | +----------+-------------+----------+----------+ | Atomic | 100 (run 1) | 1 | 99 | +----------+-------------+----------+----------+ | Atomic | 100 (run 2) | 1 | 99 | +----------+-------------+----------+----------+ Table 8: Live runs, N clients submitting the same code at once Two further runs are excluded and are disclosed here for completeness. One atomic run of 10 clients rejected all ten because a stale code from an earlier run had been submitted. One naive run of 50 clients had connection resets because the test server's listen backlog was too small; the backlog was raised and the run was repeated with the results shown. Both naive and atomic verifiers also accepted codes from the adjacent steps inside the +/- 1 window, as [RFC6238] permits. The pressure test ran in-process, with no network, against the verifier of Section 10, using a throwaway key, a fixed clock, 100 parallel clients released together by a barrier, and 200 trials per row. In the first part, a pause was inserted between the unused-step check and the update, and 100 clients submitted the same code. Rigopoulos Expires 4 June 2027 [Page 25] Internet-Draft TOTP Offline Time and Viewed Records December 2026 +====================+==================+======================+ | Pause | Trials with more | Accepted per trial | | | than one accept | (min / median / max) | +====================+==================+======================+ | none | 0 of 200 | 1 / 1 / 1 | +--------------------+------------------+----------------------+ | 0.5 ms | 200 of 200 | 5 / 22 / 54 | +--------------------+------------------+----------------------+ | 1 ms | 200 of 200 | 8 / 47 / 76 | +--------------------+------------------+----------------------+ | 2 ms | 200 of 200 | 24 / 94.5 / 100 | +--------------------+------------------+----------------------+ | 5 ms | 200 of 200 | 91 / 100 / 100 | +--------------------+------------------+----------------------+ | 20 ms | 200 of 200 | 100 / 100 / 100 | +--------------------+------------------+----------------------+ | Atomic control (20 | 0 of 200 | 1 / 1 / 1 | | ms pause ignored) | | | +--------------------+------------------+----------------------+ Table 9: Pause between check and update, non-atomic verifier, 100 clients, 200 trials The row with no pause is an artefact of how the interpreter schedules threads, which ran the check and the update without switching, and it is not evidence that a real verifier is safe at zero gap. Any pause of 0.5 ms or more allowed duplicate acceptance in every trial. Database round trips and remote calls commonly exceed that. In the second part, enforce mode was run with 100 clients, 200 trials per row. Rigopoulos Expires 4 June 2027 [Page 26] Internet-Draft TOTP Offline Time and Viewed Records December 2026 +=====================================+=============+==============+ | Submission | Verifier | Accepted per | | | | trial | +=====================================+=============+==============+ | Viewed code with its authentic | atomic | 1 in 200 of | | record | | 200 trials | +-------------------------------------+-------------+--------------+ | Viewed code with its authentic | non-atomic, | median 100 | | record | 2 ms pause | (minimum 21) | +-------------------------------------+-------------+--------------+ | Viewed code with its authentic | non-atomic, | 100 | | record | 20 ms pause | | +-------------------------------------+-------------+--------------+ | Unviewed neighbour codes C(T-1) and | atomic | 0 in 200 of | | C(T+1), no record | | 200 trials | +-------------------------------------+-------------+--------------+ | Current code, no record | atomic | 0 in 200 of | | | | 200 trials | +-------------------------------------+-------------+--------------+ | Current code with a record for a | atomic | 0 in 200 of | | different step | | 200 trials | +-------------------------------------+-------------+--------------+ | Current code with a record forged | atomic | 0 in 200 of | | under a wrong key | | 200 trials | +-------------------------------------+-------------+--------------+ | 1 viewed submission and 99 unviewed | atomic | exactly 1 in | | submissions of the same code | | 200 of 200 | | | | trials | +-------------------------------------+-------------+--------------+ Table 10: Enforce mode, 100 parallel clients, 200 trials per row Enforce mode rejected every unviewed, wrong-step and forged-record submission in every trial under this load. It did not prevent concurrent acceptance of a genuinely viewed code on a non-atomic verifier, which is why Section 6.4 requires an atomic update. The tests used one machine and the author's own verifier implementation. They do not test a relay of a code that was viewed and then copied; that case is described in Section 13. 12. Implementation Status This section is to be removed before publishing as an RFC. This section records the status of known implementations of the mechanism defined in this document at the time of posting, following [RFC7942]. It is to be removed before publication as an RFC. Rigopoulos Expires 4 June 2027 [Page 27] Internet-Draft TOTP Offline Time and Viewed Records December 2026 Organization: YPS Services LLC Implementation: Last Viewed, security software. A public RFC 6238 test panel that computes codes locally without a network is available at https://lastviewed.ypsservices.com/. Coverage: RFC 6238 code generation with the Appendix B test key. The viewed record defined in this document is in development. A local simulation of verifier behaviour, including audit and enforce modes and an atomic and a non-atomic one-time-use check, was run on 30 November 2026 and is reported in Section 10. The simulation code is in the author's possession and can be made public. The optional Reference Device role, the transaction-binding extension, and the example hardware below have not been measured as shipping implementations. Licensing: Proprietary. Contact: ea.rigopoulos@ypsservices.com Last Viewed is a trademark of YPS Services LLC. 12.1. Example Hardware for Laboratory Evaluation The following combination is described only as an example of a microcontroller and a TCXO RTC that could be used to evaluate the Offline Time Source profile in a laboratory. It is not a Last Viewed product, it is not a claim that Last Viewed includes or qualifies this hardware, and it has not been measured under Section 4.3. Module layout, charging circuitry, and even the identity of the RTC and EEPROM ICs vary between vendors and MUST be verified on the board in hand. The microcontroller example is a Raspberry Pi Pico H, Raspberry Pi order code SC0917 (also listed by some vendors as RP-SC0917), an RP2040 board with pre-soldered headers [PICO-DS]. The Pico H recommended operating conditions in that datasheet are a minimum of -20 degrees C and a maximum of +85 degrees C including self-heating, with a recommended maximum ambient of 70 degrees C. The Pico's own oscillator is not a battery-backed real-time clock and is not, by itself, a basis for claiming this profile. A qualifying local RTC would be added over I2C or a similar bus. Rigopoulos Expires 4 June 2027 [Page 28] Internet-Draft TOTP Offline Time and Viewed Records December 2026 The RTC example is an Analog Devices / Maxim Integrated DS3231, an I2C RTC with an integrated TCXO and crystal [DS3231]. Figures in this paragraph are taken from the Maxim Integrated DS3231 datasheet, document 19-5170, Revision 10, March 2015. A later Analog Devices reprint, if any, has not been checked for this revision and SHOULD be verified by implementers. Headline accuracy in that datasheet is +/-2 ppm from 0 degrees C to +40 degrees C and +/-3.5 ppm from -40 degrees C to +85 degrees C. The frequency stability table, with the aging-offset register at 00h, is more specific: for the commercial device (DS3231S, 0 degrees C to +70 degrees C) the bound is +/-2 ppm from 0 degrees C to +40 degrees C and +/-3.5 ppm from above +40 degrees C to +70 degrees C; for the industrial device (DS3231SN, -40 degrees C to +85 degrees C) the bound is +/-3.5 ppm from -40 degrees C to below 0 degrees C, +/-2 ppm from 0 degrees C to +40 degrees C, and +/-3.5 ppm from above +40 degrees C to +85 degrees C. A declared D_max that uses the +/-2 ppm figure MUST state that it applies only over 0 degrees C to +40 degrees C. Crystal aging in the same table, after reflow and marked "not production tested", is +/-1.0 ppm for the first year and +/-5.0 ppm over 0-10 years; a declared D_max for a long service interval needs to take aging into account as well as the temperature-stability figure. Timekeeping battery current IBATT, with EOSC = 0, BBSQW = 0, EN32kHz = 1, and the I2C pins idle, is typically 0.84 microamperes and at most 3.0 microamperes at VBAT = 3.63 V, and typically 1.0 microamperes and at most 3.5 microamperes at VBAT = 5.5 V. A short temperature-conversion current IBATTC of at most 575 microamperes at VBAT = 3.63 V (650 microamperes at 5.5 V) is specified separately; the datasheet's IBATT maximum is the figure to use for average timekeeping budget. This document does not convert those currents into a battery-life in years; life is estimated from the cell datasheet's capacity and from IBATT, and any such estimate is to be verified for the cell and module used. Typical inexpensive "DS3231 Precision Memory" modules sold for use with Arduino or Raspberry Pi boards also carry a 32-kbit I2C EEPROM, commonly an AT24C32 or compatible part, which can store viewed records on the device. The presence, type, and capacity of that EEPROM are properties of the module, not of the DS3231, and are to be verified on the board in hand. Many such modules also include a crude charging path (often a resistor and a diode) aimed at a rechargeable LIR2032 cell. That path can damage a non-rechargeable CR2032. An implementer MUST use a cell type the module is actually designed for, or MUST disable the charging path, and MUST NOT assume that the Analog DS3231 datasheet specifies this module circuitry. Whether a particular board has the path, and whether the IC is a genuine DS3231 rather than a substitute with a looser accuracy class, is to be verified. Rigopoulos Expires 4 June 2027 [Page 29] Internet-Draft TOTP Offline Time and Viewed Records December 2026 13. Security Considerations The security of the TOTP value remains that of [RFC6238] and [RFC4226]. This section considers only the additions in this document. The viewed record detects; it does not prevent, unless the verifier implements enforce mode and actually receives an authentic record at validation time. Audit mode is a retrospective control. A deployment that only stores records on the prover, and never compares them, does not change the attack surface of [RFC6238]. This document assumes that the displayed OTP is visible only to the user. Where an observer or interceptor can copy an OTP while it is displayed, the viewed record for that OTP is genuine and a verifier in enforce mode accepts whichever party submits it first. This document does not claim to prevent that. It does ensure that the OTP is accepted once, and the rejection of the legitimate user's own attempt is then a visible collision rather than a silent second acceptance. The parallel-client runs in Section 11 model an interceptor on purpose, as a worst-case stress test, and are not the expected condition. A shoulder-surf or other copy of an OTP that the prover did record as viewed is not distinguishable, from the record alone, from the user's own use of that OTP. The simulation in Section 10 confirmed that enforce mode accepted the first submission of a viewed code, including a submission that arrived before the user's. The optional transaction-binding extension in Section 5.4 is intended to reject a copy that is presented for a different action or session; it does not reject the first use of a correctly bound record for the same action. The Section 5.2 rule in [RFC6238] remains the control that stops the same OTP being accepted twice at that verifier after a first success. That one-time-use rule MUST be applied atomically, as required in Section 6.4. A check-then-update implementation can accept several concurrent submissions of the same OTP. The simulation forced that race and observed ten accepts out of ten, including in enforce mode. Transaction binding does not remove the requirement for submissions of the same (OTP, action) pair. Record tampering: an attacker who can append or alter records without K cannot forge a valid digest or mac. An attacker who has K can forge records and TOTP values; protection of K is therefore essential and is out of scope of this document, as it is of [RFC6238]. The simulation confirmed that an attacker who held K and forged both a neighbour-step code and a covering MAC was accepted in enforce mode. Implementations SHOULD treat a record with a missing or invalid mac Rigopoulos Expires 4 June 2027 [Page 30] Internet-Draft TOTP Offline Time and Viewed Records December 2026 as unauthenticated. Sequence numbers detect gaps but do not, by themselves, prove that a missing view did not occur on a different device that shares K. Clock tampering: an attacker who can set the prover's local clock can shift T and the viewed timestamp. The Offline Time Source profile reduces dependence on a network time protocol and on sudden network time jumps, but it does not prevent physical or software attacks on the local clock. A low or missing backup supply MUST be treated as making the clock untrusted until resynchronisation, as in Section 4.5. Setting the clock SHOULD require an additional authentication measure when the offset is large, as in Section 6 of [RFC6238] and in Section 4.2. Verifiers SHOULD NOT widen the acceptance window beyond what Section 5.2 of [RFC6238] recommends without understanding the added exposure (more simultaneously valid codes and a longer acceptance period for each code). Reference Device compromise: an attacker who can issue authentic signed time messages, because they hold the Reference Device's signing key or have replaced the device, can shift the clocks of provers that trust it. Mitigation is the same additional authentication measure for large offsets, plus the ranking and freshness rules in Section 4.6.4, and protection of the provisioning of the reference's public or MAC key. Unauthenticated peer-to-peer time copy, including following a peer with a longer reported battery life, can propagate a single compromised or wrong clock and MUST NOT be used as a trusted reference. Shared-secret storage, provisioning, and the design of any particular hardware token are out of scope. Keys SHOULD still be generated and protected as recommended in [RFC6238]. 14. Privacy Considerations A viewed record is a log of authentication activity: it shows that a particular account's OTP was displayed or copied at a particular local time. An action identifier can additionally associate that event with a transaction or session. Implementations SHOULD keep records on the prover by default, export them only with user or administrator action, and retain them only as long as needed for the agreed audit or enforce policy. Account labels and other identifiers SHOULD be omitted from exported records unless required. When transaction binding is used, exported records SHOULD carry a digest or a verifier-supplied challenge, not plaintext amounts, destinations, or account numbers. Verifiers that receive records SHOULD apply the same retention limits as for other authentication logs. See also [RFC6973]. Rigopoulos Expires 4 June 2027 [Page 31] Internet-Draft TOTP Offline Time and Viewed Records December 2026 15. IANA Considerations This document has no IANA actions. 16. References 16.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC4226] M'Raihi, D., Bellare, M., Hoornaert, F., Naccache, D., and O. Ranen, "HOTP: An HMAC-Based One-Time Password Algorithm", RFC 4226, DOI 10.17487/RFC4226, December 2005, . [RFC6238] M'Raihi, D., Machani, S., Pei, M., and J. Rydell, "TOTP: Time-Based One-Time Password Algorithm", RFC 6238, DOI 10.17487/RFC6238, May 2011, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . 16.2. Informative References [DS3231] Maxim Integrated Products, Inc., "DS3231 Extremely Accurate I2C-Integrated RTC/TCXO/Crystal", Document 19-5170, Revision 10. Product page now hosted by Analog Devices., March 2015, . [PICO-DS] Raspberry Pi Ltd, "Raspberry Pi Pico Datasheet", 2026, . [RFC6287] M'Raihi, D., Rydell, J., Bajaj, S., Machani, S., and D. Naccache, "OCRA: OATH Challenge-Response Algorithm", RFC 6287, DOI 10.17487/RFC6287, June 2011, . Rigopoulos Expires 4 June 2027 [Page 32] Internet-Draft TOTP Offline Time and Viewed Records December 2026 [RFC6973] Cooper, A., Tschofenig, H., Aboba, B., Peterson, J., Morris, J., Hansen, M., and R. Smith, "Privacy Considerations for Internet Protocols", RFC 6973, DOI 10.17487/RFC6973, July 2013, . [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running Code: The Implementation Status Section", BCP 205, RFC 7942, DOI 10.17487/RFC7942, July 2016, . [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017, . [RFC8949] Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", STD 94, RFC 8949, DOI 10.17487/RFC8949, December 2020, . Changes from draft-rigopoulos-totp-offline-audit-01 * Removed the "Updates: RFC 6238" relationship (the XML "updates" attribute) and every statement that this document updates or modifies [RFC6238]. The document now describes a method that builds on, and is compatible with, RFC 6238. Reason: a document on the Independent Submission stream cannot update a Standards Track RFC. * Reworded the Abstract and the Introduction accordingly, and removed the sentence in the Abstract that described this revision's additions. * Added a "Relationship to RFC 6238" paragraph to the Interoperability section stating what RFC 6238 is relied on for (Unix time, Section 5.2, Section 6) and that no adoption or endorsement is claimed. * Clarified that the atomic one-time-use requirement applies to a verifier that implements this document, and restates a rule that already exists in Section 5.2 of RFC 6238. * The category (Experimental) and the stream (Independent Submission) are unchanged. No technical change to the viewed record, audit and enforce modes, the atomic check, the drift model, or the test results. Rigopoulos Expires 4 June 2027 [Page 33] Internet-Draft TOTP Offline Time and Viewed Records December 2026 Changes from draft-rigopoulos-totp-offline-audit-00 * Clarified that a declared 2 ppm class still accumulates a 30-second offset in about 174 days under the constant-rate model, and that D_max MUST be stated with a temperature range. * Added applicability of the Offline Time Source profile to new hardware and to upgrades, including offline crypto wallets; existing devices without a qualifying RTC cannot claim the profile but can still adopt the viewed record. * Added battery-status reporting: a low or missing backup supply makes the clock untrusted until resynchronisation. No battery- life figures are published. * Added an optional Reference Device role, a signed time message, offset measurement and the existing large-offset authentication requirement, and a rule that references are ranked by declared D_max and time since trusted sync, not by battery life or age. * Noted that a software application, including the author's Last Viewed product, could provide a sync path, without claims about particular hardware clock specifications. * Added an optional transaction-binding extension to the viewed record, with a covering-MAC extension that leaves the -00 test vectors unchanged when the action field is absent, and a reference to OCRA [RFC6287]. * Required atomic application of the RFC 6238 Section 5.2 one-time- use rule. * Added an Implementation and Test Results section reporting only the local verifier simulation; listed honestly what was not stopped. * Added a Live and Pressure Test Results section: live runs with a real authenticator application against a local test site (10, 50 and 100 parallel clients), a sweep of the pause between check and update, and enforce mode at 100 parallel clients, with the limits of each stated. * Stated the threat-model assumption that the displayed OTP is visible only to the user, and that relay of a viewed code is not prevented. Rigopoulos Expires 4 June 2027 [Page 34] Internet-Draft TOTP Offline Time and Viewed Records December 2026 * Updated Implementation Status per [RFC7942], including an example Raspberry Pi Pico H (SC0917) and DS3231 laboratory build, cited from the manufacturers' datasheets, with items that are still to be verified labelled as such. The example is not a Last Viewed hardware claim. * Updated Security Considerations for clock tampering, Reference Device compromise, record forgery by a holder of K, and atomic verifier checks. Acknowledgements This document builds on [RFC6238] by D. M'Raihi, S. Machani, M. Pei, and J. Rydell, and on [RFC4226] by D. M'Raihi, M. Bellare, F. Hoornaert, D. Naccache, and O. Ranen. Errors of interpretation remain the author's. Author's Address E. A. Rigopoulos YPS Services LLC Email: ea.rigopoulos@ypsservices.com URI: https://ypsservices.com/ Rigopoulos Expires 4 June 2027 [Page 35]