<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="rfc7991bis.rnc"?>
<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="info"
  docName="draft-melo-dap-visual-oob-auth-00"
  ipr="trust200902"
  submissionType="independent"
  xml:lang="en"
  version="3"
  tocInclude="true"
  tocDepth="4"
  symRefs="true"
  sortRefs="true">

  <front>
    <title abbrev="DAP Visual OOB Transaction Auth">Dynamic Authorization Protocol (DAP):
      Out-of-Band Visual Transaction Authorization for Untrusted Terminals</title>

    <author fullname="Laerte Peotta de Melo" initials="L. P." surname="de Melo">
      <organization abbrev="UnB">University of Brasilia</organization>
      <address>
        <postal>
          <street>Department of Electrical Engineering</street>
          <street>Campus Universitario Darcy Ribeiro, Asa Norte</street>
          <city>Brasilia</city>
          <region>DF</region>
          <code>70910-900</code>
          <country>BR</country>
        </postal>
        <email>laerte.melo@unb.br</email>
        <uri>https://orcid.org/0000-0002-2075-6601</uri>
      </address>
    </author>

    <author fullname="Dino Macedo Amaral" initials="D. M." surname="Amaral">
      <organization abbrev="UnB">University of Brasilia</organization>
      <address>
        <postal>
          <street>Department of Electrical Engineering</street>
          <street>Campus Universitario Darcy Ribeiro, Asa Norte</street>
          <city>Brasilia</city>
          <region>DF</region>
          <code>70910-900</code>
          <country>BR</country>
        </postal>
        <email>dino.macedo@gmail.com</email>
        <uri>https://orcid.org/0000-0002-8023-1057</uri>
      </address>
    </author>

    <author fullname="Robson de Oliveira Albuquerque" initials="R. O." surname="Albuquerque">
      <organization abbrev="UnB">University of Brasilia</organization>
      <address>
        <postal>
          <street>Department of Electrical Engineering</street>
          <street>Campus Universitario Darcy Ribeiro, Asa Norte</street>
          <city>Brasilia</city>
          <region>DF</region>
          <code>70910-900</code>
          <country>BR</country>
        </postal>
        <email>robson@redes.unb.br</email>
        <uri>https://orcid.org/0000-0002-6717-3374</uri>
      </address>
    </author>

    <author fullname="Joao Jose Costa Gondim" initials="J. J. C." surname="Gondim">
      <organization abbrev="UnB">University of Brasilia</organization>
      <address>
        <postal>
          <street>Department of Electrical Engineering</street>
          <street>Campus Universitario Darcy Ribeiro, Asa Norte</street>
          <city>Brasilia</city>
          <region>DF</region>
          <code>70910-900</code>
          <country>BR</country>
        </postal>
        <email>gondim@unb.br</email>
        <uri>https://orcid.org/0000-0002-5873-7502</uri>
      </address>
    </author>

    <author fullname="Fabio Lucio Lopes de Mendonca" initials="F. L. L." surname="de Mendonca">
      <organization abbrev="UnB">University of Brasilia</organization>
      <address>
        <postal>
          <street>Department of Electrical Engineering</street>
          <street>Campus Universitario Darcy Ribeiro, Asa Norte</street>
          <city>Brasilia</city>
          <region>DF</region>
          <code>70910-900</code>
          <country>BR</country>
        </postal>
        <email>fabio.mendonca@unb.br</email>
        <uri>https://orcid.org/0000-0001-7100-7304</uri>
      </address>
    </author>

    <author fullname="Rafael Timoteo de Sousa Junior" initials="R. T." surname="de Sousa Junior">
      <organization abbrev="UnB">University of Brasilia</organization>
      <address>
        <postal>
          <street>Department of Electrical Engineering</street>
          <street>Campus Universitario Darcy Ribeiro, Asa Norte</street>
          <city>Brasilia</city>
          <region>DF</region>
          <code>70910-900</code>
          <country>BR</country>
        </postal>
        <email>desousa@unb.br</email>
        <uri>https://orcid.org/0000-0003-1101-3029</uri>
      </address>
    </author>

    <date year="2026" month="November" day="15" />

    <workgroup>Independent Submission</workgroup>

    <keyword>out-of-band authentication</keyword>
    <keyword>transaction authorization</keyword>
    <keyword>visual challenge-response</keyword>
    <keyword>QR code</keyword>
    <keyword>dynamic authorization protocol</keyword>
    <keyword>electronic banking</keyword>
    <keyword>WYSIWYS</keyword>

    <abstract>
      <t>
        This document specifies the Dynamic Authorization Protocol (DAP), an
        Out-of-Band (OOB) visual transaction authorization protocol, used as a second factor, for
        electronic financial transactions initiated on untrusted terminals.
        The terminal displays a cryptographically protected challenge as a
        Quick Response (QR) code. A trusted mobile device of the user, which
        needs no network connection, scans the code, verifies it with
        HMAC-SHA-256, shows the transaction details for confirmation ("What
        You See Is What You Sign"), and then reveals a one-time authorizer
        code protected with AES-256. Each challenge is bound to one
        transaction and expires within 120 seconds. The document also
        describes the provisioning of the shared key through a dual-channel
        XOR split-key exchange, its activation, and the templates used to
        display transactions. DAP targets Man-in-the-Middle (MITM) and
        Man-in-the-Browser (MITB) adversaries that control the terminal and
        alter transaction parameters.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro">
      <name>Introduction</name>
      <t>
        Internet banking and electronic transaction systems have evolved to
        provide ubiquitous financial services, but security models relying
        solely on session-level authentication have not kept pace with modern
        adversarial capabilities. Requiring access exclusively from
        pre-registered devices restricts user mobility, whereas relying on
        conventional challenge-response mechanisms over a single channel exposes
        users to session hijacking, credential harvesting, and real-time
        transaction manipulation.
      </t>
      <t>
        When a customer initiates a financial transaction from a personal
        computer connected to the Internet, that terminal has to be treated as
        potentially untrusted. Malware, trojans, and Man-in-the-Browser (MITB) agents
        can silently modify destination accounts or transaction amounts while
        displaying legitimate-looking confirmation screens to the user.
        Conventional second factors such as TANs, hardware OTP tokens, or Short
        Message Service (SMS) codes (which are additionally exposed to cellular
        network and Signaling System No. 7 (SS7) vulnerabilities) do not
        cryptographically bind the authorization code to the actual transaction
        content verified by the user on an independent trusted display.
      </t>
      <t> The Dynamic Authorization Protocol (DAP) <xref target="Melo2012" />
        <xref target="Melo2024" />
        addresses this gap by establishing an Out-of-Band (OOB) visual channel between the service
        provider (such as the e-Bank server) and the user's trusted mobile device. DAP applies the
        "What You See Is What You Sign" (WYSIWYS) principle <xref target="Starnberger2009" />: every
        transaction initiated on an untrusted computer generates a cryptographically protected
        challenge rendered as a two-dimensional visual code (QR code). The user captures this QR
        code using the camera of a mobile device that needs no network connection, which verifies
        the integrity and authenticity of the transaction parameters, displays the transaction
        details on the trusted mobile screen, and, upon explicit user confirmation, decrypts and
        reveals a 6-digit transaction-specific authorizer code that the user enters back into the
        untrusted terminal to complete the operation. </t>

      <t>
        Because only the holder of the key can produce a valid
        authentication tag, a counterfeit site or a malicious terminal cannot
        create a challenge that the mobile device accepts, which makes DAP
        resistant to phishing.
      </t>
      <t>
        This document assumes a deployment in which the customer obtains the
        key through an Automated Teller Machine (ATM) of the financial
        institution, which has a screen capable of showing QR codes and reads
        the bank smartcard of the customer. Other channels for provisioning
        the key are out of the scope of this document.
      </t>

      <section anchor="bcp14">
        <name>Requirements Language</name>
        <t> The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>",
          "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD
          NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>",
          and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described in BCP
          14 <xref target="RFC2119" /> <xref target="RFC8174" /> when, and only when, they appear in
          all capitals, as shown here. </t>
      </section>

      <section anchor="terms">
        <name>Terminology and Notation</name>
        <t>
          The following actors and architectural entities are defined in this
          specification:
        </t>
        <dl newline="false" spacing="normal">
          <dt>User (Customer):</dt>
          <dd> The legitimate human account holder initiating a transaction on an Untrusted Computer
            (<tt>UC</tt>) and authorizing it via a Trusted Mobile Device (<tt>MD</tt>). </dd>
          <dt>Untrusted Computer (<tt>UC</tt>):</dt>
          <dd> Any personal computer or Internet-connected terminal used to access the e-Bank web
            interface. Under the DAP threat model, <tt>UC</tt> is assumed to be potentially
            compromised by malware or controlled by an adversary. </dd>
          <dt>Trusted Mobile Device (<tt>MD</tt>):</dt>
          <dd> A portable device (such as a smartphone) equipped with an embedded camera and running
            the mobile application of the financial institution, which includes the DAP function
            (the "DAP application"). <tt>MD</tt> operates out-of-band without requiring network
            connectivity during transaction verification. </dd>
          <dt>Automated Teller Machine (<tt>ATM</tt>):</dt>
          <dd>
            A physical terminal operated by the financial institution and
            connected to its dedicated network, used as a secondary trusted
            channel during split-key provisioning.
          </dd>
          <dt>Financial Institution Server (<tt>e-Bank</tt>):</dt>
          <dd>
            The remote application server responsible for authenticating sessions,
            generating transaction challenges, and validating transaction
            authorizer codes.
          </dd>
          <dt>Hardware Security Module (<tt>HSM</tt>):</dt>
          <dd>
            A tamper-resistant cryptographic processor within the financial
            institution ("HSM Bank") that stores primary root keys and computes, on demand, the key share k_2 of each customer, so that no complete customer key is kept in persistent storage.
          </dd>
        </dl>

        <t>
          The cryptographic notation used throughout this document is summarized
          below:
        </t>
        <dl newline="false" spacing="normal">
          <dt><tt>MK</tt>:</dt>
          <dd> A Primary Root Key held inside the <tt>HSM</tt>, where <tt>MK</tt> is a 512-bit key
            in <tt>{0,1}^512</tt>, generated inside the <tt>HSM</tt> with a cryptographically secure
            random number generator. </dd>
          <dt><tt>k</tt>:</dt>
          <dd> A 512-bit customer secret key (<tt>k</tt> in <tt>{0,1}^512</tt>), computed as <tt>k =
            k_1 XOR k_2</tt>, shared between the <tt>HSM</tt>/<tt>e-Bank</tt> and the customer's <tt>
            MD</tt>. </dd>
          <dt><tt>F</tt>:</dt>
          <dd> A pseudorandom function implemented inside the <tt>HSM</tt>, instantiated as
            HMAC-SHA-512 keyed with <tt>MK</tt>, used to generate the key share <tt>k_2</tt>. </dd>
          <dt><tt>k'_1</tt>, <tt>k'_2</tt>:</dt>
          <dd> The two 256-bit subkeys partitioned from <tt>k</tt>, where <tt>k'_1</tt> in <tt>
            {0,1}^256</tt> (the first 32 octets of <tt>k</tt>) is the HMAC-SHA-256 authentication
            key and <tt>k'_2</tt> in <tt>{0,1}^256</tt> (the last 32 octets of <tt>k</tt>) is the
            AES-256-CBC encryption key. </dd>
          <dt><tt>k_1</tt>, <tt>k_2</tt>:</dt>
          <dd> Two 512-bit key shares used for symmetric key distribution over separated channels,
            such that <tt>k = k_1 XOR k_2</tt>. The share <tt>k_1</tt> is a random 512-bit string
            with uniform distribution that <tt>e-Bank</tt> stores for the customer. The share <tt>
            k_2</tt> is generated by the <tt>HSM</tt> from <tt>MK</tt> and customer data, and is
            recomputed whenever it is needed. </dd>
          <dt><tt>m</tt>:</dt>
          <dd> The transaction message containing the transaction details (<tt>trans_data</tt>)
            requested by the user. </dd>
          <dt><tt>r</tt>:</dt>
          <dd> A 6-digit pseudorandom authorizer code uniformly distributed in the range <tt>000000
            &lt;= r &lt;= 999999</tt> (encoded for encryption as six ASCII decimal digits, including
            leading zeros). </dd>
          <dt><tt>r'</tt>:</dt>
          <dd> The protected authorizer code, <tt>r' = IV | C</tt>, where <tt>IV</tt> is a 128-bit
            (16-octet) initialization vector and <tt>C</tt> is the single 128-bit (16-octet)
            AES-256-CBC ciphertext block of <tt>r</tt>, computed as <tt>C = CBC-Enc_{k'_2}(IV, r)</tt>
            (see <xref target="layout" />). The total length of <tt>r'</tt> is 32 octets (256 bits). </dd>
          <dt><tt>Nonce</tt>:</dt>
          <dd> The unique identifier that <tt>e-Bank</tt> assigns to each transaction, a random text
            of 20 characters. It is carried inside <tt>trans_data</tt>. </dd>
          <dt><tt>y</tt>:</dt>
          <dd> The 256-bit HMAC-SHA-256 authentication tag of the challenge, <tt>y =
            HMAC-SHA-256_{k'_1}(trans_data | r')</tt>. </dd>
          <dt><tt>XOR</tt>:</dt>
          <dd>
            Bitwise exclusive-OR operation.
          </dd>
          <dt><tt>CONCAT</tt> (<tt>|</tt>):</dt>
          <dd>
            Bitstring or octet-string concatenation.
          </dd>
        </dl>
      </section>
    </section>

    <section anchor="related">
      <name>Related Work</name>
      <t>
        This section compares DAP with mechanisms that are commonly used to
        authorize electronic transactions. The comparison is limited to the
        property that matters for an untrusted terminal: whether the
        authorization code or credential depends on the transaction content
        that the user has seen on an independent trusted display.
      </t>
      <table anchor="tabrelated">
        <name>Comparison of DAP with Existing Mechanisms</name>
        <thead>
          <tr>
            <th>Mechanism</th>
            <th>Code bound to transaction content</th>
            <th>Trusted display of the transaction</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>HOTP <xref target="RFC4226" /> and TOTP <xref target="RFC6238" /></td>
            <td>No</td>
            <td>No</td>
          </tr>
          <tr>
            <td>SMS one-time password</td>
            <td>No, unless the message repeats the transaction</td>
            <td>Only the text of the message</td>
          </tr>
          <tr>
            <td>QR-TAN <xref target="Starnberger2009" /></td>
            <td>Yes</td>
            <td>Yes, on a mobile device</td>
          </tr>
          <tr>
            <td>FIDO2 / WebAuthn <xref target="WebAuthn2" /></td>
            <td>No, by the core specification</td>
            <td>Not defined by the core specification</td>
          </tr>
          <tr>
            <td>DAP (this document)</td>
            <td>Yes</td>
            <td>Yes, on a mobile device that does not need a network</td>
          </tr>
        </tbody>
      </table>
      <t> HOTP and TOTP derive a password from a shared secret and a counter or the time. The
        password does not depend on the transaction, so malware on <tt>UC</tt> that changes the
        transaction after the user has authenticated can still use a valid password. SMS one-time
        passwords have the same property, and they are additionally exposed to weaknesses of the
        cellular network. </t>
      <t> QR-TAN <xref target="Starnberger2009" /> is the closest approach: the mobile device scans
        a code from the terminal and shows the transaction before producing the authorization. DAP
        differs in the following aspects: the shared key is provisioned by a split-key exchange over
        two separate channels (<xref target="provisioning" />); the transaction is shown through
        templates selected by a transaction code; the challenge is authenticated with HMAC-SHA-256
        over the transaction data and the protected code; the challenge is valid for 120 seconds,
        and the mobile device checks the generation timestamp; and the user returns a 6-digit code
        through <tt>UC</tt>. </t>
      <t> FIDO2 / WebAuthn <xref target="WebAuthn2" /> authenticates the user to a relying party
        with public-key credentials and resists phishing. The core specification does not define a
        display of the transaction on a separate trusted device. It addresses a different problem
        from DAP, and both can be used together. </t>
      <t> The Regulatory Technical Standards under the European Payment Services Directive <xref
          target="PSD2RTS" /> require, for remote electronic payments, that the authentication code
        be dynamically linked to the amount and the payee (Article 5). DAP addresses the same
        concern by binding the authorizer code to a single transaction. This document makes no claim
        of compliance with any regulation. </t>
    </section>

    <section anchor="arch">
      <name>System Architecture and Functional Premises</name>

      <section anchor="overview">
        <name>Architectural Overview</name>
        <t> In the DAP model, a session authenticated via static or conventional credentials is
          never trusted to authorize financial transactions implicitly. Instead, every transaction
          message exchanged on the Internet banking channel is treated as an independent operation
          that <bcp14>MUST</bcp14> be explicitly authorized by the customer via an Out-of-Band
          channel strictly bound to that transaction's data. </t>
        <t> The system architecture comprises the remote financial institution (<tt>e-Bank</tt>
          backed by <tt>HSM</tt>) and the customer interacting across three distinct environments
          and communication channels, as illustrated in <xref target="figarch" />: </t>

        <figure anchor="figarch">
          <name>DAP Multi-Channel Architecture</name>
          <artwork type="ascii-art">
+---------------------------------------------------------------+
|                 Financial Institution Domain                  |
|                                                               |
|  +------------------+               +----------------------+  |
|  |     HSM Bank     |&lt;=============&gt;|    e-Bank Server     |  |
|  | (Root Keys MK_i, | Internal Bus  | (Session &amp; Challenge |  |
|  |  Key Derivation) |               |     Management)      |  |
|  +------------------+               +----------------------+  |
+-----------|--------------------------------------|------------+
            |                                      |
 Channel 1: | Dedicated Bank Net        Channel 2: | Untrusted Net
 Trusted    | (Key Share k_2)           (HTTPS)    | (k_1, QR,
 ATM Link   |                                      |  r_hat)
            v          [Channel Boundary]          v
  +--------------------+               +----------------------+
  |    ATM Terminal    |               |  Untrusted Computer  |
  | (Smartcard + PIN,  |               |         (UC)         |
  |  Visual QR Screen) |               |  (Web Browser / UI)  |
  +--------------------+               +----------------------+
            |                                      |
            | Channel 3a: QR                       | Channel 3b: QR
            | (Camera: k_2)                        | (Camera: k_1/Tx)
            +------------------+-------------------+
                               |
                               v
                     +--------------------+
                     |   Trusted Mobile   |
                     |    Device (MD)     |
                     | (DAP App,          |
                     |  Camera, Key k)    |
                     +--------------------+
                               |
                               | Visual Confirmation (WYSIWYS)
                               | &amp; Display of 6-digit Code (r_hat)
                               v
                     [ Legitimate Customer ]
                               |
                               | Entry of r_hat into UC (Channel 2)
</artwork>
        </figure>

        <t>
          This channel separation provides five core security properties:
        </t>
        <ol spacing="normal" type="1">
          <li>
            <em>Channel Segmentation:</em> Transaction initiation occurs over the primary Internet
            channel (<tt>UC</tt>), whereas transaction verification and authorizer code recovery
            occur on a physically separate device (<tt>MD</tt>) via an optical channel. </li>
          <li>
            <em>Visual Verification (WYSIWYS):</em> By decoding and displaying transaction
            parameters on <tt>MD</tt> after cryptographic integrity verification, the user confirms
            the exact recipient, account, date, and value that the server will execute. </li>
          <li>
            <em>Integrity of the Transaction Against a Compromised Terminal:</em> An adversary that
            controls <tt>UC</tt>, including On-Path (MITM) and Man-in-the-Browser (MITB) attackers,
            cannot alter the transaction payload inside the challenge without invalidating the HMAC
            tag verified by <tt>MD</tt>. This property does not protect against a legitimate user
            who confirms a fraudulent transaction (see <xref target="risks" />). </li>
          <li>
            <em>No Network Dependency:</em> <tt>MD</tt> does not need cellular, Wi-Fi, or Bluetooth
            connectivity to verify a transaction and to display the authorizer code. The network is
            therefore not an attack path in the protocol, and the protocol remains available in
            unstable connectivity environments. The protocol does not require <tt>MD</tt> to be
            disconnected, and it does not address malware running on <tt>MD</tt> itself, which is
            outside the adversary model of <xref target="adversary" />. </li>
          <li>
            <em>Isolation of Cryptographic Secrets:</em> The cryptographic key <tt>k</tt> is stored
            inside <tt>MD</tt> and is never known or viewable by the human user, preventing
            inadvertent disclosure of the secret key under social engineering. </li>
        </ol>
      </section>

      <section anchor="premises">
        <name>Functional and Operational Requirements</name>
        <t> Compliant implementations of the Dynamic Authorization Protocol <bcp14>MUST</bcp14>
          satisfy the following nine functional premises: </t>
        <ol spacing="normal" type="1">
          <li>
            <em>Message Lifespan:</em> Every generated challenge message, including encrypted
            payloads, <bcp14>MUST</bcp14> have a maximum lifespan (Time-To-Live) of 120 seconds,
            counted from the instant at which <tt>e-Bank</tt> generated it. This instant is carried
            in the message as a timestamp, so that both <tt>e-Bank</tt> and <tt>MD</tt> can verify
            the lifespan. </li>
          <li>
            <em>Mandatory Authentication:</em> Every challenge message <bcp14>MUST</bcp14> be
            authenticated with the HMAC tag <tt>y</tt>, and every transaction <bcp14>MUST</bcp14> be
            authorized with the authorizer code <tt>r</tt> that is bound to it. </li>
          <li>
            <em>Timeout Cancellation:</em> Failure to receive a valid authorization response within
            120 seconds <bcp14>MUST</bcp14> result in the automatic cancellation of the ongoing
            transaction by the server. </li>
          <li>
            <em>Response Time:</em> Under normal operating conditions, the cryptographic processing
            and response time for transaction authentication and authorization <bcp14>SHOULD</bcp14>
            be less than 2 seconds. </li>
          <li>
            <em>Offline Mobile Execution:</em> No active network connection to or from the Trusted
            Mobile Device (<tt>MD</tt>) <bcp14>SHALL</bcp14> be needed during transaction
            authorization. </li>
          <li>
            <em>Attack Countermeasures:</em> The protocol implementation <bcp14>MUST</bcp14> include
            the mechanisms specified in this document to counter brute-force attempts on the
            authorizer code (<xref target="attempts" />), customer impersonation and phishing (<xref
              target="impersonation" />), On-Path (MITM) and Man-in-the-Browser (MITB) alteration of
            the transaction (<xref target="mitb" />), and replay (<xref target="replay" />). </li>
          <li>
            <em>Key Protection:</em> All cryptographic keys <bcp14>MUST</bcp14> be protected against
            unauthorized extraction at rest and in use; the keys that <tt>e-Bank</tt> handles in memory are protected as described in <xref target="ebankkeys" />. The key <tt>k</tt> on <tt>MD</tt> <bcp14>MUST</bcp14>
            be stored in the protected storage of the mobile application of the financial
            institution, and <bcp14>MUST NOT</bcp14> be exported, copied, or included in backups.
            The mobile application <bcp14>MUST</bcp14> be protected by a local password that the
            user enters to open it, so that the key <tt>k</tt> cannot be used by someone who only
            has physical access to an <tt>MD</tt> that is switched on. </li>
          <li>
            <em>Cryptographic Strength:</em> Implementations <bcp14>MUST</bcp14> utilize symmetric
            encryption with keys of at least 256 bits (AES-256) <xref target="FIPS197" /> and
            message authentication based on HMAC-SHA-256 <xref target="RFC2104" /> <xref
              target="RFC6234" />. </li>
          <li>
            <em>Modular Architecture:</em> The system <bcp14>SHOULD</bcp14> be built with a modular
            cryptographic architecture so that security updates and algorithm migrations can be
            applied without interrupting service availability. </li>
        </ol>
      </section>

      <section anchor="hypotheses">
        <name>Foundational Design Hypotheses</name>
        <t>
          The DAP security model is built upon three foundational hypotheses
          regarding real-world Internet banking environments:
        </t>
        <dl newline="false" spacing="normal">
          <dt>Hypothesis 1:</dt>
          <dd> The personal computer (<tt>UC</tt>) where the transaction is initiated and executed
            can be fully compromised by malicious code. </dd>
          <dt>Hypothesis 2:</dt>
          <dd> It is infeasible to guarantee the integrity of the client application (e.g., web
            browser or plugins) running on <tt>UC</tt>. </dd>
          <dt>Hypothesis 3:</dt>
          <dd>
            It is difficult to protect the human customer from social
            engineering; therefore, security mechanisms need to minimize
            reliance on user-memorized secrets and require explicit
            per-transaction visual confirmation on an uncompromised device.
          </dd>
        </dl>
      </section>
    </section>

    <section anchor="crypto">
      <name>Cryptographic Primitives and Message Format</name>

      <section anchor="derivation">
        <name>Primary Root Key and Ephemeral Server-Side Key Recovery</name>
        <t> Storing millions of complete static per-user symmetric keys in a standard application
          database introduces significant operational risk. In the DAP architecture, the financial
          institution's <tt>HSM</tt> holds a set of high-entropy primary root keys <tt>MK_1</tt>
          through <tt>MK_n</tt>, where each <tt>MK</tt> is generated inside the <tt>HSM</tt> with a
          cryptographically secure random number generator. For each customer, <tt>e-Bank</tt>
          stores only the random key share <tt>k_1</tt>; the complete key <tt>k</tt> is never
          stored by <tt>e-Bank</tt>. </t>
        <t> For each enrolled customer, the <tt>HSM</tt> generates the 512-bit key share <tt>k_2</tt>
          in <tt>{0,1}^512</tt> deterministically as: </t>
        <artwork type="ascii-art">
k_2 &lt;- F_MK(ID | key_timestamp)
</artwork>
        <t> where <tt>F</tt> is HMAC-SHA-512 <xref target="RFC2104" />
          <xref target="RFC6234" />
          implemented inside the <tt>HSM</tt> and keyed with the 512-bit root key <tt>MK</tt> (the
          key <tt>MK_i</tt> identified by <tt>key_id</tt>), so that the output has 512 bits. In
          other words, <tt>k_2</tt> is a 512-bit keyed hash of the data that identify the customer
          and of the instant at which <tt>k_2</tt> is generated; the <tt>HSM</tt> applies the HMAC
          directly to these data, and there is no separate encryption step. The instant is stored
          as <tt>key_timestamp</tt> in the internal database of the financial institution. The
          function input <tt>x</tt> is the following octet string, in which all integers are
          unsigned and in network byte order (big-endian): </t>
        <artwork type="ascii-art">
x = label | key_id | key_version | len(ID) | ID | key_timestamp
</artwork>
        <ul spacing="normal">
          <li>
            <tt>label</tt>: the 9 ASCII octets "DAP-k2-v1", which provide domain separation for this derivation. It is not the DAP protocol version carried in the <tt>Version</tt> field of a challenge. </li>
          <li>
            <tt>key_id</tt>: a 4-octet identifier of the root key <tt>MK_i</tt> held in the <tt>HSM</tt>
            that is used for this customer. It enables root key rotation. </li>
          <li>
            <tt>key_version</tt>: a 4-octet key version counter, starting at 1 and incremented each time
            the customer key is provisioned again (for example, after a suspected compromise of a
            provisioning session). </li>
          <li>
            <tt>len(ID)</tt>: a 2-octet length, in octets, of <tt>ID</tt>. </li>
          <li>
            <tt>ID</tt>: the unique identifier of the customer, not of an account, for example the
            national taxpayer registry number or an internal unique customer identifier, encoded in
            UTF-8 <xref target="RFC3629" />. A customer with several accounts has a single <tt>ID</tt>
            and a single key <tt>k</tt>. The <tt>ID</tt> is kept on the server and is never carried
            in a challenge. </li>
          <li>
            <tt>key_timestamp</tt>: an 8-octet value with the server-assigned enrollment time (not
            to be confused with the generation timestamp of a transaction challenge), in seconds
            since 1970-01-01T00:00:00Z. </li>
        </ul>
        <t> The values <tt>key_id</tt>, <tt>key_version</tt>, <tt>ID</tt>, and <tt>key_timestamp</tt>
          are kept in the customer record together with <tt>k_1</tt>. In the remainder of this
          document, <tt>F_MK(ID | key_timestamp)</tt> denotes the computation of <tt>F</tt> over the
          complete input <tt>x</tt>. The customer key is then <tt>k = k_1 XOR k_2</tt>. </t>
        <t> Because <tt>k_2</tt> can be recalculated on demand inside the <tt>HSM</tt> from the customer
          data and <tt>key_timestamp</tt>, the <tt>HSM</tt> is used only to compute <tt>k_2</tt>. For
          each challenge, <tt>e-Bank</tt> requests <tt>k_2</tt> from the <tt>HSM</tt>, combines it
          with the stored share <tt>k_1</tt> to obtain <tt>k = k_1 XOR k_2</tt>, partitions <tt>k</tt>
          into <tt>k'_1</tt> and <tt>k'_2</tt>, performs the other cryptographic operations of the
          protocol itself, and immediately discards <tt>k_2</tt> and <tt>k</tt> from working
          memory. <tt>e-Bank</tt> <bcp14>MUST NOT</bcp14> permanently store <tt>k</tt> or <tt>k_2</tt>
          in cleartext. The root key <tt>MK</tt> never leaves the <tt>HSM</tt>, and the <tt>HSM</tt>
          never receives <tt>k_1</tt>. The stored share <tt>k_1</tt> alone reveals nothing useful
          about <tt>k</tt>. Because <tt>k_2</tt> and <tt>k</tt> are handled in the working memory of
          <tt>e-Bank</tt>, the <tt>HSM</tt> protects <tt>MK</tt> but not the key <tt>k</tt> of a
          customer whose challenge is being processed: a compromise of the <tt>e-Bank</tt> process
          at that moment exposes that key. </t>
        <t> The only persistent copy of <tt>k</tt> is in the protected storage of the mobile application
          of the customer (<xref target="premises" />). The share <tt>k_2</tt> is the output of a
          keyed function whose key <tt>MK</tt> never leaves the <tt>HSM</tt>, and <tt>e-Bank</tt>
          keeps only <tt>k_1</tt> and the data needed to request <tt>k_2</tt>. An adversary who obtains the customer
          database, its backups, or its logs therefore cannot compute <tt>k</tt>: it also needs the
          <tt>HSM</tt> to compute <tt>k_2</tt> for that customer. This does not hold against an
          adversary who can send requests to the <tt>HSM</tt>, for example by controlling the <tt>
          e-Bank</tt> process. For this reason <tt>e-Bank</tt> <bcp14>SHOULD</bcp14> restrict,
          rate-limit, and audit the requests for <tt>k_2</tt> (see <xref target="ebankkeys" />). </t>
      </section>

      <section anchor="partitioning">
        <name>Customer Key Partitioning</name>
        <t> The 512-bit key <tt>k</tt> in <tt>{0,1}^512</tt> is partitioned into two independent
          256-bit (32-octet) subkeys, <tt>k'_1</tt> and <tt>k'_2</tt>, as follows: </t>
        <ul spacing="normal">
          <li>
            <tt>k'_1</tt> in <tt>{0,1}^256</tt> (32 octets): Used exclusively with HMAC-SHA-256 to
            guarantee message integrity and authenticity. </li>
          <li>
            <tt>k'_2</tt> in <tt>{0,1}^256</tt> (32 octets): Used exclusively with AES-256 in Cipher
            Block Chaining (CBC) mode <xref target="FIPS197" />
            <xref target="SP800-38A" /> to
            protect the confidentiality of the authorizer code <tt>r</tt>. The integrity of <tt>r'</tt>
            is provided by the HMAC tag <tt>y</tt>. </li>
        </ul>

      </section>

      <section anchor="layout">
        <name>Transaction Challenge Message Layout</name>
        <t> A DAP challenge is the octet string <tt>trans_data | r' | y</tt>, laid out as shown in <xref
            target="figlayout" />. The field <tt>trans_data</tt> carries the transaction in
          cleartext, as described in <xref target="transdata" />. </t>
        <t> The fields <tt>r'</tt> and <tt>y</tt> have fixed lengths of 32 octets each, so <tt>
          trans_data</tt> comprises all octets of the challenge except the last 64. The challenge is
          encoded in Base64 <xref target="RFC4648" />, using the standard alphabet with padding, and
          the resulting text is the content of the QR code <xref target="ISO18004" />. </t>

        <figure anchor="figlayout">
          <name>Challenge Payload Encoded in Visual QR Code</name>
          <artwork type="ascii-art">
+---------------------------------------------------------------+
|                                                               |
+         Transaction Data (trans_data), variable length        +
|         (Nonce; Version; Code; Field_1; ...; Field_n)         |
|                                                               |
+---------------------------------------------------------------+
|           Protected Authorizer Code (r'), 32 octets           |
+      IV (128 bits) | C (128 bits, one AES-256-CBC block)      +
+---------------------------------------------------------------+
|                                                               |
+          Authentication Tag (y), 256 bits / 32 octets         +
|            y = HMAC-SHA-256_{k'_1}(trans_data | r')           |
|                                                               |
+---------------------------------------------------------------+
Fields are concatenated in the order shown, and the resulting octet
string is Base64-encoded before QR code generation. The fields
are not aligned to 32-bit words.
</artwork>
        </figure>

        <section anchor="transdata">
          <name>Transaction Data Encoding</name>
          <t> The field <tt>trans_data</tt> is a text string made of fields separated by the
            character ";" (0x3B). It uses only printable US-ASCII characters (0x20 to 0x7E), which
            are a subset of UTF-8 <xref target="RFC3629" />. Accented letters and other non-ASCII
            characters are not accepted: </t>
          <artwork type="ascii-art">
trans_data = Nonce ; Version ; Code ; Field_1 ; ... ; Field_n
</artwork>
          <ul spacing="normal">
            <li>
              <tt>Nonce</tt>: the unique transaction identifier assigned by <tt>e-Bank</tt>, a
              random text of 20 characters taken from the uppercase letters "A" to "Z" and the
              digits "0" to "9". It is generated with a cryptographically secure random number
              generator <xref target="RFC4086" />, and <tt>e-Bank</tt> <bcp14>MUST</bcp14> ensure
              that it is unique (<xref target="challenge" />). </li>
            <li>
              <tt>Version</tt>: the version of DAP used to build the challenge, 3 octets long. The
              current version is "099". <tt>MD</tt>
              <bcp14>MUST</bcp14> reject a challenge whose
              version it does not support. </li>
            <li>
              <tt>Code</tt>: the transaction code, 3 octets long (for example, "818"), which selects
              the template. The code "001" is reserved for the key exchange (<xref target="keyqr" />).
              The code "000" is reserved for the activation challenge (<xref target="steps" />). </li>
            <li>
              <tt>Field_1</tt> to <tt>Field_n</tt>: the field values, in the order defined by the
              template. Their lengths are not fixed, but each template defines a type (numeric or
              alphanumeric) and a maximum length for each field. Numeric fields contain only digits.
              Alphanumeric fields contain only uppercase letters "A" to "Z", digits, the space, and
              the punctuation characters that the template permits. The timestamp has 12 digits, in
              the format YYMMDDHHMMSS (two-digit year, month, day, hour, minute, and second),
              expressed in Coordinated Universal Time (UTC). The monetary amount is expressed as
              digits only, without decimal separator; the template defines the currency (for
              example, BRL) and the number of decimal places. The data type of each field in the template (<xref target="tplformat" />) defines the formatting shown to the user. </li>
          </ul>
          <t> The character ";" <bcp14>MUST NOT</bcp14> appear inside any field value. <tt>e-Bank</tt> <bcp14>
            MUST</bcp14> convert names to uppercase ASCII before building <tt>trans_data</tt>. <tt>
            MD</tt>
            <bcp14>MUST</bcp14> reject a challenge that contains a character outside the
            permitted set (including control characters and non-ASCII octets) or a field that does
            not match the type and the maximum length defined by the template. </t>
          <t> A template defines, for one transaction code, the ordered list of fields and the mask
            that the DAP application on <tt>MD</tt> uses to present them. A template lists only the
            fields that the user needs to see to confirm the operation; other data of the
            transaction stay in <tt>e-Bank</tt>. Credentials such as account passwords or PINs <bcp14>MUST
            NOT</bcp14> be part of any template or of <tt>trans_data</tt>. <xref target="tabtpl" />
            shows two examples, inspired by the transaction layouts used by Brazilian banks. The set
            of codes, the set of operations that require DAP, and the complete list of templates are
            defined by each financial institution. </t>

          <table anchor="tabtpl">
            <name>Examples of Transaction Templates</name>
            <thead>
              <tr>
                <th>Code</th>
                <th>Operation</th>
                <th>Fields, in order</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td>818</td>
                <td>Transfer between current accounts</td>
                <td>Destination branch (5 digits), destination account
                  (12 digits), check digit (1), beneficiary name (up to 30
                  characters), amount (13 digits, 2 decimal places, BRL),
                  timestamp</td>
              </tr>
              <tr>
                <td>867</td>
                <td>Payment of a bank collection slip</td>
                <td>Beneficiary bank (3 digits), bar code (48 digits),
                  document value, discount, rebate, increase, fine, and
                  amount charged (13 digits each, 2 decimal places, BRL),
                  timestamp</td>
              </tr>
            </tbody>
          </table>
          <t> In both templates the date and the time shown to the user are derived from the
            timestamp. Illustrative <tt>trans_data</tt> values for the code "818", which transfers
            1,500.00 to the account 000000123456-7 of branch 01234, are: </t>
          <artwork type="ascii-art">
7QK2M9XW4HD1R8TZ5PB3;099;818;01234;000000123456;7;MARIA SILVA;
0000000150000;261102133000
</artwork>
          <t> (The value is split over two lines in this document for presentation only; in a real
            challenge it is a single string.) The timestamp field carries the exact instant at which <tt>
            e-Bank</tt> generated the transaction challenge. Every template of a code that is carried in a challenge (all codes except "001") <bcp14>MUST</bcp14> include this field and identify it as the generation timestamp, because <tt>MD</tt> uses
            it to check the validity of the challenge (see <xref target="verification" />). The
            templates are embedded in the DAP application as an XML file <xref target="XML" /> (<xref
              target="tplformat" />) and are selected by the transaction code and by the <tt>Version</tt>. The application
            updates this file each time it is opened and the user is authenticated. The XML file is
            digitally signed by the financial institution as a Cryptographic Message Syntax (CMS)
            SignedData structure <xref target="RFC5652" /> (the successor of PKCS #7), using its
            private key. The application verifies the signature before using the file, using the
            corresponding X.509 public certificate <xref target="RFC5280" /> embedded in the
            application. </t>
        </section>

        <section anchor="tplformat">
          <name>Template File Format</name>
          <t> The template file is an XML document <xref target="XML" /> whose root element is <tt>
            templates</tt>. It contains one <tt>template</tt> element for each transaction code. A <tt>
            template</tt> element has the attributes <tt>code</tt> (the transaction code) and <tt>
            version</tt> (the DAP version to which the template belongs, with the same value and the
            same 3-octet format as the <tt>Version</tt> field of <tt>trans_data</tt>; <tt>MD</tt> <bcp14>
            MUST</bcp14> use the template whose <tt>version</tt> equals the <tt>Version</tt> of the
            challenge), and the following child elements: </t>
          <ul spacing="normal">
            <li>
              <tt>name</tt>: the name of the operation. </li>
            <li>
              <tt>field</tt>, one or more: a field of <tt>trans_data</tt>. The order of the <tt>field</tt>
              elements is the order of the fields in <tt>trans_data</tt> after <tt>Code</tt>. The
              attributes are <tt>id</tt> (identifier used by the mask), <tt>label</tt> (the text
              shown to the user), <tt>type</tt> ("N" for numeric or "A" for alphanumeric), <tt>max</tt>
              (the maximum length), and <tt>datatype</tt>, which defines how <tt>MD</tt> formats the
              value for display: "text" (shown as received; the default for type "A"), "digits"
              (shown as received; the default for type "N"), "amount" (the last <tt>decimals</tt>
              digits are the decimal places, the leading zeros of the integer part are removed, the
              thousands and decimal separators follow the language of the user, and the code in
              <tt>currency</tt> is shown; a field of this data type has the attributes <tt>currency</tt>
              and <tt>decimals</tt>), "datetime" (twelve digits in the format YYMMDDHHMMSS, in UTC,
              shown as a date and a time in the format of the language of the user and in the time
              zone of the device), and "barcode" (digits shown in groups of the size given by the
              attribute <tt>group</tt>, 12 by default). In a template of a code that is carried in a
              challenge, exactly one field has the attribute <tt>role="timestamp"</tt>, which
              identifies the generation timestamp and has the data type "datetime". </li>
            <li>
              <tt>mask</tt>: the text that <tt>MD</tt> shows to the user, where <tt>{id}</tt> is
              replaced by the value of the field with that identifier, formatted according to its data type. </li>
          </ul>
          <t> All transaction codes have a template in the file, including "000" and "001". The template of
            "000" has the generation timestamp and the activation message. The template of "001" has
            only the <tt>name</tt> and the <tt>mask</tt> text that <tt>MD</tt> shows while it
            captures a key share; it has no <tt>field</tt> elements and no timestamp, because the QR
            codes of <xref target="keyqr" /> are not challenges. </t>
          <t> The labels and the mask are used only for display and can be written in the language
            of the user; the file is encoded in UTF-8. The values in <tt>trans_data</tt> are always
            restricted to US-ASCII (<xref target="transdata" />). A template contains only the data
            needed for the display and the validation of the fields. Fields that e-Bank needs only
            for its own processing, and credentials such as passwords, <bcp14>MUST NOT</bcp14> be
            part of a template. As an example, the template of the code "818" of <xref
              target="tabtpl" /> is: </t>
          <artwork type="ascii-art">
&lt;templates&gt;
  &lt;template code="818" version="099"&gt;
    &lt;name&gt;Transfer between current accounts&lt;/name&gt;
    &lt;field id="branch" label="Branch" type="N" max="5"
           datatype="digits"/&gt;
    &lt;field id="account" label="Account" type="N" max="12"
           datatype="digits"/&gt;
    &lt;field id="digit" label="Check digit" type="N" max="1"
           datatype="digits"/&gt;
    &lt;field id="payee" label="Beneficiary" type="A" max="30"
           datatype="text"/&gt;
    &lt;field id="amount" label="Amount" type="N" max="13"
           datatype="amount" currency="BRL" decimals="2"/&gt;
    &lt;field id="time" label="Date and time" type="N" max="12"
           datatype="datetime" role="timestamp"/&gt;
    &lt;mask&gt;
      Branch {branch}, account {account}-{digit}
      Beneficiary: {payee}
      Amount: {amount}
      Date and time: {time}
    &lt;/mask&gt;
  &lt;/template&gt;
&lt;/templates&gt;
</artwork>
        </section>
      </section>
    </section>

    <section anchor="provisioning">
      <name>Key Provisioning</name>
      <t> DAP establishes the shared security context between <tt>e-Bank</tt> and <tt>MD</tt>
        through a dual-channel split-key exchange based on XOR-based two-share splitting of the key,
        followed by an activation challenge. The perfect secrecy of a single share follows from the
        one-time pad argument <xref target="Shannon1949" />. </t>

      <t> The core challenge is provisioning the 512-bit key <tt>k</tt> to the customer's <tt>MD</tt>
        when the primary Internet channel (<tt>UC</tt>) is assumed to be monitored or controlled by
        an adversary. DAP solves this by defining <tt>k</tt> as the XOR of two 512-bit shares, <tt>
        k_1</tt> and <tt>k_2</tt>, transmitted over two separated channels so that <tt>k</tt> is
        never transmitted in full over any communication channel: </t>
      <ol spacing="normal" type="1">
        <li> The server generates a random 512-bit string <tt>k_1</tt> with uniform distribution in <tt>
          {0,1}^512</tt> and stores it for the customer. </li>
        <li> The <tt>HSM</tt> computes the share <tt>k_2 &lt;- F_MK(ID | key_timestamp)</tt>, whenever it is needed, in <tt>
          {0,1}^512</tt>. </li>
        <li> The customer key is <tt>k = k_1 XOR k_2</tt>, where <tt>|k_2| = |k_1| = |k| = 512</tt>
          bits. The value <tt>k</tt> is not stored. </li>
      </ol>
      <t> Because <tt>k_1</tt> is uniformly distributed in <tt>{0,1}^512</tt>, an adversary who
        observes <tt>k_2</tt> alone (for example, on the <tt>ATM</tt> screen) gains no information
        about <tt>k</tt>, as in a one-time pad: for every value <tt>x</tt> in <tt>{0,1}^512</tt>, </t>
      <artwork type="ascii-art">
Pr[k = x | k_2 = s] = Pr[k_1 = x XOR s] = 1 / (2^512)
</artwork>
      <t> An adversary who observes <tt>k_1</tt> alone (for example, on the untrusted computer <tt>
        UC</tt>) gains no computational advantage in learning <tt>k</tt>, because <tt>k_2</tt> is
        the output of a pseudorandom function keyed with <tt>MK</tt> inside the <tt>HSM</tt>. The
        secrecy of <tt>k</tt> therefore holds as long as the adversary obtains at most one of the
        two shares. </t>
      <t> This argument rests on two assumptions. First, <tt>F</tt> is a pseudorandom function:
        without knowledge of <tt>MK</tt>, its outputs on distinct inputs <tt>x</tt> are
        computationally indistinguishable from independent uniform 512-bit strings. Second, <tt>MK</tt>
        never leaves the <tt>HSM</tt>. If either assumption fails, an adversary who learns <tt>k_1</tt>
        alone may be able to learn information about <tt>k</tt>. </t>

      <section anchor="steps">
        <name>Provisioning and Activation Procedure</name>
        <t>
          The provisioning procedure consists of five operational
          steps across three phases:
        </t>
        <dl newline="false" spacing="normal">
          <dt>Step 1 (Service Request and App Installation):</dt>
          <dd> The customer authenticates to <tt>e-Bank</tt> over the Internet channel using <tt>UC</tt>,
            requests enrollment of their mobile device as a second-factor authorizer, and installs
            the DAP application on <tt>MD</tt>. </dd>
          <dt>Step 2 (Generation and Delivery of <tt>k_1</tt>):</dt>
          <dd> The <tt>e-Bank</tt> server generates and stores the random share <tt>k_1</tt>, and assigns
            <tt>key_id</tt>, <tt>key_version</tt>, and <tt>key_timestamp</tt> to the enrollment. The
            share <tt>k_2</tt> is not computed yet: the <tt>HSM</tt> computes it when it is needed
            (Step 4). The <tt>e-Bank</tt> server returns <tt>k_1</tt> to <tt>UC</tt>, which displays
            <tt>k_1</tt> as a visual QR code on the computer screen (format in <xref target="keyqr" />). </dd>
          <dt>Step 3 (Mobile Capture of <tt>k_1</tt>):</dt>
          <dd> Using the DAP application on <tt>MD</tt>, the customer captures the visual QR code
            containing <tt>k_1</tt> from <tt>UC</tt> and stores <tt>k_1</tt> temporarily in <tt>MD</tt>.
            The customer is then instructed to complete the provisioning at an ATM terminal. </dd>
          <dt>Step 4 (Out-of-Band Capture of <tt>k_2</tt> and Key Reconstruction):</dt>
          <dd> The customer authenticates physically at a bank <tt>ATM</tt> using their bank
            smartcard and Personal Identification Number (PIN). Upon verification, <tt>e-Bank</tt> requests <tt>k_2</tt> from the <tt>HSM</tt> and the <tt>ATM</tt> displays the second key share <tt>k_2</tt> as a visual QR code on the <tt>ATM</tt>
            screen. The customer captures <tt>k_2</tt> using <tt>MD</tt>. The <tt>MD</tt>
            application computes <tt>k = k_1 XOR k_2</tt>, partitions <tt>k</tt> into <tt>k'_1</tt>
            and <tt>k'_2</tt>, securely stores <tt>k</tt> in the protected storage of the mobile
            application of the financial institution, and immediately zeroizes (deletes) both <tt>
            k_1</tt> and <tt>k_2</tt>. </dd>
          <dt>Step 5 (Activation):</dt>
          <dd> Right after <tt>MD</tt> receives <tt>k_2</tt> and computes <tt>k</tt>, <tt>e-Bank</tt>
            generates an activation challenge with the transaction code "000" and shows it as a QR
            code on the <tt>ATM</tt> screen. This challenge has the format of <xref target="layout" />
            and is verified by <tt>MD</tt> as in <xref target="verification" />. Its template has no
            financial fields: it has only the generation timestamp and an activation message. The
            user confirms the activation on <tt>MD</tt>, which displays the authorizer code <tt>
            r_hat</tt>, and the user enters <tt>r_hat</tt> at the <tt>ATM</tt>. If <tt>r_hat</tt> is
            correct and is received within the 120-second window (with at most three attempts), <tt>
            e-Bank</tt> marks <tt>MD</tt> as enabled. DAP is activated for the customer only after
            this verification: before it, <tt>e-Bank</tt> <bcp14>MUST NOT</bcp14> treat <tt>MD</tt>
            as a valid authorizer. If the code is not correct, or the window expires, the activation
            fails and the customer repeats the procedure. <tt>e-Bank</tt>
              <bcp14>SHOULD</bcp14>
            discard enrollments that are not activated after a period defined by the financial
            institution. A successful activation shows that <tt>e-Bank</tt> and <tt>MD</tt> hold the
            same key <tt>k</tt>, so a share that was altered during the provisioning is detected. </dd>
        </dl>

        <t>
          <xref target="figseed" /> illustrates the end-to-end interaction between the Customer, <tt>
          UC</tt>, <tt>ATM</tt>, <tt>e-Bank</tt>, and <tt>HSM</tt> during symmetric key generation,
          provisioning, and activation. </t>

        <figure anchor="figseed">
          <name>Symmetric Key Generation and Dual-Channel Exchange (k_1 and k_2)</name>
          <artwork type="ascii-art">
Customer/MD            UC                e-Bank/HSM              ATM
     |                  |                     |                   |
  --- Phase 1: Internet channel (Steps 1 to 3 of Section 5.1) ---
     |-- 1. Enroll ----&gt;|                     |                   |
     |                  |-- 2. Enroll -------&gt;|                   |
     |                  |                     |                   |
                          [3. e-Bank: random k_1, stored;
                            key_id, key_version, key_timestamp]
     |                  |                     |                   |
     |                  |&lt;- 4. QR k_1/001 ----|                   |
     |&lt;= 5. Scan =======|                     |                   |
   [6. MD: store k_1]
     |                  |                     |                   |
  --- Phase 2: ATM channel (Step 4 of Section 5.1) ---
     |-- 7. Smartcard + PIN -------------------------------------&gt;|
     |                  |                     |&lt;- 8. Get k_2 -----|
                          [HSM: k_2 = F_MK(ID | key_timestamp)]
     |                  |                     |-- 9. QR k_2/001 -&gt;|
     |&lt;= 10. Scan (optical, no network) ==========================|
     |                  |                     |                   |
   [11. MD: k = k_1 XOR k_2; (k'_1, k'_2) = k;
     store k; zeroize k_1 and k_2]
     |                  |                     |                   |
  --- Phase 3: Activation (Step 5 of Section 5.1) ---
                                             [12. e-Bank: activation
                                               challenge, code 000]
     |                  |                     |-- 13. QR(000) ---&gt;|
     |&lt;= 14. Scan (optical) ======================================|
   [15. MD: verify y, Version, Code 000, timestamp;
     user confirms; MD shows r_hat]
     |-- 16. Enter r_hat at ATM ---------------------------------&gt;|
     |                  |                     |&lt;- 17. r_hat ------|
                          [18. e-Bank: within 120 s? r_hat = r?
                            (at most 3 attempts); if yes,
                            MD is enabled]
     |                  |                     |-- 19. Enabled ---&gt;|
     |&lt;- 20. Activated -------------------------------------------|
</artwork>
        </figure>

      </section>

      <section anchor="keyqr">
        <name>Key Exchange QR Code Format (Code 001)</name>
        <t> The QR codes that carry <tt>k_1</tt> (Step 2) and <tt>k_2</tt> (Step 4) use the
          transaction code "001". They are not challenges in the sense of <xref target="layout" />: <tt>
          MD</tt> does not yet hold a key, so the QR codes carry no tag <tt>y</tt> and no encrypted
          authorizer code. The content of each QR code is a US-ASCII text string, used directly
          without Base64 encoding of the whole string, with fields separated by ";" (0x3B): </t>
        <artwork type="ascii-art">
key_share = Version ; Code ; Share ; Enroll ; Value ; Check
</artwork>
        <ul spacing="normal">
          <li>
            <tt>Version</tt>: 3 octets, as in <xref target="transdata" /> (currently "099"). </li>
          <li>
            <tt>Code</tt>: 3 octets, the value "001". </li>
          <li>
            <tt>Share</tt>: 1 octet, "1" for <tt>k_1</tt> (displayed on <tt>UC</tt>) or "2" for <tt>
            k_2</tt> (displayed on the <tt>ATM</tt>). </li>
          <li>
            <tt>Enroll</tt>: an enrollment identifier of 20 characters, generated by <tt>e-Bank</tt>
            in the same way as the <tt>Nonce</tt> (<xref target="transdata" />). Both shares of one
            enrollment carry the same value. It is not secret and is not derived from <tt>ID</tt>. </li>
          <li>
            <tt>Value</tt>: the 512-bit share (64 octets) encoded in Base64 <xref target="RFC4648" />
            with padding (88 characters). </li>
          <li>
            <tt>Check</tt>: 8 uppercase hexadecimal digits, the first four octets of the SHA-256
            hash of the text that precedes the last ";" (from <tt>Version</tt> to <tt>Value</tt>,
            inclusive). It detects reading and transcription errors only and gives no protection
            against an adversary. </li>
        </ul>
        <t>
          For example (with an invented value, split over two lines for
          presentation only):
        </t>
        <artwork type="ascii-art">
099;001;1;7QK2M9XW4HD1R8TZ5PB3;&lt;88 Base64 characters&gt;;&lt;8 hex digits&gt;
</artwork>
        <t>
          <tt>MD</tt> accepts the two QR codes in any order. For each one, <tt>MD</tt> <bcp14>MUST</bcp14>
          check that the text has exactly the six fields above, that <tt>Version</tt> is supported,
          that <tt>Code</tt> is "001", that <tt>Value</tt> decodes to exactly 64 octets, and that <tt>
          Check</tt> is correct. <tt>MD</tt>
            <bcp14>MUST</bcp14> compute <tt>k = k_1 XOR k_2</tt>
          only when it holds one QR code with <tt>Share</tt> "1" and one with <tt>Share</tt> "2"
          that have the same <tt>Enroll</tt>; otherwise it <bcp14>MUST</bcp14> reject the second QR
          code. The stored share <bcp14>SHOULD</bcp14> be discarded if the second share is not
          captured within a period defined by the financial institution. </t>
        <t> Since the QR codes are not authenticated, a share that is substituted or altered on the
          way is not detected by <tt>MD</tt> at this point. It is detected by the activation (Step
          5), because <tt>MD</tt> and <tt>e-Bank</tt> would hold different keys and the activation
          challenge would fail. <tt>e-Bank</tt>
            <bcp14>MUST</bcp14> make each share QR code valid for
          a single display, <bcp14>SHOULD</bcp14> expire it after a short period defined by the
          financial institution, and <bcp14>MUST NOT</bcp14> display <tt>k_2</tt> for an enrollment
          that was not started by the customer through the Internet channel. </t>
      </section>
    </section>

    <section anchor="operation">
      <name>Dynamic Authorization Protocol (DAP) Transaction Flow</name>
      <t> Once the customer's Trusted Mobile Device (<tt>MD</tt>) has been provisioned with key <tt>k
        = (k'_1, k'_2)</tt> and activated (<xref target="steps" />), every financial transaction
        initiated on an Untrusted Computer (<tt>UC</tt>) <bcp14>MUST</bcp14> execute the DAP
        challenge-response authorization flow shown in <xref target="figtx" />. In the figure, <tt>
        challenge</tt> denotes the message <tt>(trans_data, r', y)</tt> encoded in the QR code (<xref
          target="figlayout" />). Steps 1 to 3 are the usual authentication of the customer at <tt>
        e-Bank</tt>. Steps 4 to 7 are described in <xref target="challenge" />, steps 8 to 12 in <xref
          target="verification" />, and steps 13 to 20 in <xref target="completion" />. The optical
        channel, shown with "=", needs no network connection. </t>

      <figure anchor="figtx">
        <name>End-to-End Transaction Authorization Sequence</name>
        <artwork type="ascii-art">
  MD             Customer              UC                  e-Bank
   |                 |                  |                     |
   |                 |-- 1. Login -----&gt;|                     |
   |                 |                  |-- 2. Auth ---------&gt;|
   |                 |                  |&lt;- 3. Auth OK -------|
   |                 |-- 4. Issue Tx --&gt;|                     |
   |                 |                  |-- 5. Tx request ---&gt;|
   |                 |                  |                     |
                        [6. e-Bank: build trans_data (Nonce,
                          Version, timestamp); k_2 from HSM, then
                          k = k_1 XOR k_2; new r; r' = IV |
                          CBC-Enc_k'2(r); y = HMAC_k'1(trans_data |
                          r'); start the 120 s timer]
   |                 |                  |                     |
   |                 |                  |&lt;- 7. QR(challenge) -|
   |                 |&lt;- 8. Display QR -|                     |
   |&lt;- 9. Open+pwd --|                  |                     |
   |&lt;= 10. Scan QR (optical) ===========|                     |
   |                 |                  |                     |
     [11. MD: y' = HMAC_k'1(trans_data | r');
       reject if y' != y; check Version, Code,
       template; discard if now - timestamp &gt; 120 s
       or timestamp &gt; now + 60 s; else show Tx]
   |                 |                  |                     |
   |-- 12. Show Tx -&gt;|                  |                     |
   |&lt;- 13. Confirm --|                  |                     |
     [14. MD: r_hat = CBC-Dec_k'2(r')]
   |-- 15. r_hat ---&gt;|                  |                     |
   |                 |-- 16. r_hat ----&gt;|                     |
   |                 |                  |-- 17. r_hat -------&gt;|
   |                 |                  |                     |
                        [18. e-Bank: within 120 s? r_hat = r?
                          (at most 3 attempts); if yes, execute
                          the Tx and invalidate r]
   |                 |                  |                     |
   |                 |                  |&lt;- 19. Tx OK --------|
   |                 |&lt;- 20. Receipt ---|                     |
</artwork>
      </figure>

      <section anchor="flow">
        <name>Detailed Protocol Processing Steps</name>

        <section anchor="challenge">
          <name>Server Challenge Generation</name>
          <t> When an authenticated customer submits a transaction request from <tt>UC</tt>, the <tt>
            e-Bank</tt> server builds the message <tt>m</tt> (<tt>trans_data</tt>) from the fields
            of the request that the template of the transaction code requires. The <tt>Nonce</tt>,
            the <tt>Version</tt>, and the generation timestamp are always assigned by <tt>e-Bank</tt>;
            a value for any of them that is sent by <tt>UC</tt> <bcp14>MUST</bcp14> be ignored. The
            server then proceeds as follows: </t>
          <ol spacing="normal" type="1">
            <li> The <tt>e-Bank</tt> server requests the share <tt>k_2</tt> from the <tt>HSM</tt>, computes the customer's 512-bit key <tt>k = k_1 XOR k_2</tt>, partitions it into <tt>k'_1</tt> and <tt>k'_2</tt>, records the current time as the generation timestamp of the
              challenge, and starts a strict 120-second transaction validity timer. The generation
              timestamp <bcp14>MUST</bcp14> be the value carried in the timestamp field of <tt>
              trans_data</tt>. </li>
            <li> The server assigns a unique transaction identifier <tt>Nonce</tt> (20 random
              characters, see <xref target="transdata" />), checks that it differs from the <tt>
              Nonce</tt> of every pending or recent challenge (generating a new one in the event of
              a collision), and sets the <tt>Version</tt> field (3 octets) to the DAP version in
              use. Both are carried inside <tt>trans_data</tt>. The server generates a pseudorandom
              authorizer code <tt>r</tt> uniformly distributed in the integer sample space <tt>0
              &lt;= r &lt;= 999999</tt> using a cryptographically secure random number generator <xref
                target="RFC4086" /> and rejection sampling (to avoid modulo bias), encoded as six ASCII decimal digits with leading zeros (6 octets). The server keeps <tt>r</tt> for the pending challenge until the challenge is accepted, invalidated, or expired (at most 120 seconds), and then deletes it. </li>
            <li> The server generates a fresh 128-bit <tt>IV</tt> from a cryptographically secure
              random number generator, pads <tt>r</tt> (six ASCII digits) to one 16-octet block
              using the PKCS#7 padding scheme <xref target="RFC5652" />, and encrypts the block
              using AES-256 in CBC mode <xref target="SP800-38A" /> with subkey <tt>k'_2</tt>: <tt>C
              = CBC-Enc_{k'_2}(IV, r)</tt>. The server then sets <tt>r' = IV | C</tt>. The server <bcp14>MUST
              NOT</bcp14> reuse an <tt>IV</tt> with the same key <tt>k'_2</tt>. </li>
            <li> The server computes the message authentication tag <tt>y</tt> over the
              concatenation of the transaction details <tt>trans_data</tt> (which include the <tt>
              Nonce</tt>) and the encrypted authorizer code <tt>r'</tt> using HMAC-SHA-256 with
              subkey <tt>k'_1</tt>: <tt>y = HMAC-SHA-256_{k'_1}(trans_data | r')</tt>. </li>
            <li> The server forms the challenge <tt>trans_data | r' | y</tt>, encodes it in Base64 <xref
                target="RFC4648" />, renders the text as a two-dimensional QR code image <xref
                target="ISO18004" />, and transmits it to <tt>UC</tt> for display on the customer's
              screen. </li>
          </ol>
        </section>

        <section anchor="verification">
          <name>Out-of-Band Visual Capture and Mobile Verification</name>
          <t> Upon seeing the QR code challenge on <tt>UC</tt>, the customer activates the DAP
            application on <tt>MD</tt> and captures the visual code using the device's camera: </t>
          <ol spacing="normal" type="1">
            <li>
              <tt>MD</tt> decodes the QR code and the Base64 text, and splits the resulting octet
              string into <tt>y</tt> (the last 32 octets), <tt>r'</tt> (the preceding 32 octets),
              and <tt>trans_data</tt> (all remaining octets). If the text is not valid Base64, or the decoded string has fewer than 64 octets plus the minimum <tt>trans_data</tt> (<tt>Nonce</tt>, <tt>Version</tt>, <tt>Code</tt>, and their separators), <tt>MD</tt> <bcp14>MUST</bcp14> reject the challenge before computing the tag. </li>
            <li> Using its locally stored authentication subkey <tt>k'_1</tt>, <tt>MD</tt>
              independently computes: <tt>y' = HMAC-SHA-256_{k'_1}(trans_data | r')</tt>. </li>
            <li>
              <tt>MD</tt> compares <tt>y'</tt> with the received tag <tt>y</tt> in constant time. If <tt>y'
              != y</tt>, <tt>MD</tt>
              <bcp14>MUST</bcp14> immediately reject the challenge, display an
              integrity/authenticity error alert to the user, and terminate without decrypting <tt>
              r'</tt>. </li>
            <li> If <tt>y'</tt> equals <tt>y</tt>, the challenge is proven to be authentic and
              unmodified since leaving <tt>e-Bank</tt>. <tt>MD</tt> parses <tt>trans_data</tt> into
              its fields, checks that the <tt>Version</tt> is supported, looks up the template selected by the transaction code and by the <tt>Version</tt>, and checks that the code is known, that the number
              of fields matches the template, and that every field has the type, the maximum length,
              and the character set defined by the template. If any check fails, <tt>MD</tt>
              <bcp14>
              MUST</bcp14> reject the challenge. </li>
            <li>
              <tt>MD</tt> reads the generation timestamp from the timestamp field of <tt>trans_data</tt>
              and compares it, in UTC, with the current time of its own clock. If more than 120
              seconds have elapsed since the generation timestamp, <tt>MD</tt>
              <bcp14>MUST</bcp14>
              discard the challenge, <bcp14>MUST NOT</bcp14> display the transaction or decrypt <tt>
              r'</tt>, and <bcp14>MUST</bcp14> inform the user that the challenge has expired and
              that a new transaction must be initiated. If the generation timestamp is later than
              the current time of <tt>MD</tt> by more than 60 seconds (the tolerance for the
              variation of the clocks of mobile phones, which are not always synchronized with a
              reliable time source), <tt>MD</tt> <bcp14>MUST</bcp14> also discard the challenge and
              ask the user to check the date and time of the device. This check is complementary: <tt>
              e-Bank</tt> remains the authority on the lifespan of the challenge and enforces the
              120-second limit independently (see <xref target="completion" /> and <xref target="replay" />). </li>
            <li> If the challenge is still valid, <tt>MD</tt> applies the template mask to display
              the transaction on its trusted screen (for example, source and destination accounts
              and names, amount, and date) and prompts the user with explicit <tt>Confirm</tt> and <tt>
              Cancel</tt> controls. </li>
          </ol>
        </section>

        <section anchor="completion">
          <name>Authorizer Code Recovery and Transaction Execution</name>
          <ol spacing="normal" type="1">
            <li> The user visually compares the transaction details displayed on <tt>MD</tt> against
              the intended operation (WYSIWYS). If the details do not match what the user intended,
              the user selects <tt>Cancel</tt>, and <tt>MD</tt> discards the challenge. Because <tt>
              MD</tt> does not communicate with <tt>e-Bank</tt>, the pending transaction expires at <tt>
              e-Bank</tt> after at most 120 seconds, unless the user cancels it on <tt>UC</tt>. </li>
            <li> If the user selects <tt>Confirm</tt>, <tt>MD</tt> decrypts the authorizer code by
              parsing <tt>r' = IV | C</tt> and decrypting it with AES-256 in CBC mode and subkey <tt>
              k'_2</tt>: <tt>r_hat = CBC-Dec_{k'_2}(IV, C)</tt>. If the padding is invalid or the
              result is not six ASCII decimal digits, <tt>MD</tt>
              <bcp14>MUST</bcp14> reject the
              challenge and <bcp14>MUST NOT</bcp14> display any code. Otherwise, <tt>MD</tt>
              displays the 6-digit authorizer code <tt>r_hat</tt> (e.g., <tt>431287</tt>) on the
              mobile screen. </li>
            <li> The user types the 6-digit code <tt>r_hat</tt> into the web interface on <tt>UC</tt>,
              which transmits <tt>r_hat</tt> to <tt>e-Bank</tt>. </li>
            <li>
              <tt>e-Bank</tt> checks whether the 120-second validity window has expired. If the
              timer has expired, the transaction <bcp14>MUST</bcp14> be cancelled. Otherwise, <tt>
              e-Bank</tt> verifies whether <tt>r_hat</tt> equals <tt>r</tt> for that specific
              pending transaction <tt>m</tt>, using a constant-time comparison. If and only if they
              match, <tt>e-Bank</tt> commits and executes the transaction and invalidates <tt>r</tt>
              immediately so it cannot be reused. If they do not match, <tt>e-Bank</tt> counts a
              failed attempt and <bcp14>SHOULD</bcp14> allow at most three attempts for the same
              challenge within the 120-second window. After the third failed attempt, <tt>e-Bank</tt> <bcp14>
              SHOULD</bcp14> invalidate the challenge and cancel the transaction (see <xref
                target="attempts" />). </li>
          </ol>
        </section>
      </section>
    </section>

    <section anchor="lifecycle">
      <name>Key Lifecycle and Device Management</name>
      <t> This section describes how <tt>e-Bank</tt> handles the loss or replacement of <tt>MD</tt>,
        the revocation of the DAP enrollment of a customer, and the rotation of root keys. </t>

      <section anchor="revocation">
        <name>Loss, Replacement, and Revocation</name>
        <t> If the customer loses <tt>MD</tt>, has it stolen, or stops using the DAP application,
          the customer revokes the enrollment at an <tt>ATM</tt>, authenticating with the bank
          smartcard and the PIN, or at a branch of the financial institution. After the revocation, <tt>
          e-Bank</tt>: </t>
        <ul spacing="normal">
          <li>
            <bcp14>MUST</bcp14> delete the stored share <tt>k_1</tt> of the customer, which makes <tt>
            k</tt> unrecoverable on the server; </li>
          <li>
            <bcp14>MUST</bcp14> stop generating DAP challenges for the customer, and <bcp14>MUST</bcp14>
            reject any authorizer code related to a pending challenge of the customer; and </li>
          <li>
            <bcp14>SHOULD</bcp14> record the revocation and notify the customer through a channel
            registered by the customer. </li>
        </ul>
        <t> There is no alternative way to authorize a transaction when <tt>MD</tt> is lost: the
          recovery of the service is possible only at an <tt>ATM</tt> or at a branch. A recovery
          procedure <bcp14>MUST NOT</bcp14> weaken DAP; in particular, <tt>e-Bank</tt>
          <bcp14>MUST
          NOT</bcp14> offer a fallback authentication channel (such as SMS or a static code) for an
          operation that requires DAP, because it would allow an attacker to downgrade the protocol. </t>
        <t> A customer who replaces <tt>MD</tt> enrolls the new device with the provisioning and
          activation procedure of <xref target="provisioning" />. The new enrollment <bcp14>MUST</bcp14>
          generate a new <tt>k_1</tt> and a new <tt>key_timestamp</tt>, and <bcp14>MUST</bcp14>
          increment the <tt>key_version</tt> counter of the key, so that the key of the previous device
          is no longer valid. The key <tt>k</tt> is stored in the protected storage of the mobile
          application of the financial institution and is not exportable (see the Key Protection
          premise in <xref target="premises" />), so it cannot be moved to another device: a new
          device always needs a new enrollment and a new activation. </t>
      </section>

      <section anchor="rotation">
        <name>Root Key Rotation</name>
        <t> The root key <tt>MK_i</tt> is identified by <tt>key_id</tt>. Because <tt>k_2</tt> is
          derived from <tt>MK_i</tt>, a change of the root key of a customer changes <tt>k</tt>, and
          the customer has to be re-provisioned. For this reason, <tt>e-Bank</tt>
          <bcp14>SHOULD</bcp14>
          keep each <tt>MK_i</tt> in the <tt>HSM</tt> while at least one active customer record
          refers to its <tt>key_id</tt>, and <bcp14>SHOULD</bcp14> use a new <tt>key_id</tt> for new
          enrollments after a rotation. If an <tt>MK_i</tt> is suspected to be compromised, <tt>
          e-Bank</tt> <bcp14>MUST</bcp14> revoke all enrollments that use it and re-provision the
          affected customers. </t>
      </section>
    </section>

    <section anchor="operations">
      <name>Operational Considerations</name>
      <t>
        The following points concern the deployment of DAP:
      </t>
      <ul spacing="normal">
        <li>
          <em>QR code size.</em> The size of the QR code grows with the length of <tt>trans_data</tt>
          and with the Base64 encoding <xref target="RFC4648" /> of the challenge. Templates <bcp14>
          SHOULD</bcp14> limit the number and the length of the fields, so that the code stays
          readable on common screens and cameras <xref target="ISO18004" />. </li>
        <li>
          <em>Clock of MD.</em> The check of the generation timestamp (<xref target="verification" />)
          depends on the clock of <tt>MD</tt>. The clocks of mobile phones vary (for example, manual
          settings or drift), so <tt>MD</tt> tolerates a generation timestamp that is ahead of its
          own clock by up to 60 seconds. The DAP application <bcp14>SHOULD</bcp14> tell the user to
          check the date and time of the device when it discards a challenge for this reason. </li>
        <li>
          <em>Availability of the HSM.</em> The <tt>HSM</tt> recomputes <tt>k_2</tt> for each challenge (including the activation challenge), so its capacity and
          availability limit the number of transactions that <tt>e-Bank</tt> can authorize. </li>
        <li>
          <em>Templates.</em> The signed template file is updated when the application is opened and
          the user is authenticated (<xref target="tplformat" />). A challenge whose transaction
          code is not in the installed file is rejected, so a new transaction code needs to be
          distributed before <tt>e-Bank</tt> starts to use it. The codes "000" (activation) and
          "001" (key exchange) are reserved and are present in every installed file. </li>
        <li>
          <em>Operations that require DAP.</em> The financial institution defines which operations
          require DAP, for example transfers, payment of bank collection slips, and changes to
          registration data. Operations of low risk can be left out. </li>
        <li>
          <em>Monitoring.</em> <tt>e-Bank</tt> <bcp14>SHOULD</bcp14> monitor expired challenges,
          failed attempts, and revocations per customer (<xref target="attempts" />), because an
          unusual number of them may indicate an attack in progress. </li>
      </ul>
    </section>

    <section anchor="security">
      <name>Security Considerations</name>

      <section anchor="adversary">
        <name>Formal Adversary Model</name>
        <t> The security of DAP is evaluated against an active adversary, in the spirit of <xref
            target="Bellare1994" />, capable of interacting with the three system environments under
          the following assumptions. DAP has not been analyzed in the model of that reference. </t>
        <ul spacing="normal">
          <li>
            <em>Full Control of Untrusted Computer (<tt>UC</tt>):</em> The adversary has complete
            control over the customer's personal computer via malware or trojans. The adversary can
            read, modify, inject, suppress, or delay any message exchanged over the Internet channel
            between <tt>UC</tt> and <tt>e-Bank</tt>, and can capture all keystrokes and screen
            contents on <tt>UC</tt>. </li>
          <li>
            <em>Limited Observation of <tt>ATM</tt> Terminal:</em> The adversary can observe
            information entered via the <tt>ATM</tt> keypad (e.g., via cameras or skimmers) during
            physical interactions, but is assumed not to have internal logical control over the <tt>
            ATM</tt> hardware or its dedicated bank network link, nor physical possession of the
            customer's smartcard. The adversary is also assumed not to observe the <tt>ATM</tt>
            screen while the key share <tt>k_2</tt> is displayed; see the key share independence
            assumption below. </li>
          <li>
            <em>Isolation of Trusted Mobile Device (<tt>MD</tt>):</em> The adversary does not
            control the customer's <tt>MD</tt> and cannot extract or modify the cryptographic key <tt>k
            = (k'_1, k'_2)</tt> stored in the mobile application's protected storage. </li>
        </ul>
        <t> Note that if an adversary compromises the <tt>ATM</tt> itself while also capturing the
          customer's smartcard and PIN, the adversary could already execute arbitrary transactions
          directly at the <tt>ATM</tt> independently of Internet banking. Similarly, if the adversary gains full root control over <tt>MD</tt> and extracts <tt>k</tt>, the second-factor assumption is violated. A compromise of the <tt>e-Bank</tt> servers is outside this adversary model; <xref target="ebankkeys" /> describes the exposure and the controls that reduce it. </t>
        <t>
          <em>Key share independence assumption:</em> The secrecy of <tt>k</tt> in the key
          provisioning procedure (<xref target="provisioning" />) holds only if the adversary
          obtains at most one of the two shares <tt>k_1</tt> and <tt>k_2</tt>. Because an adversary
          controlling <tt>UC</tt> learns <tt>k_1</tt> by definition, an adversary that also captures
          the <tt>ATM</tt> screen at the time <tt>k_2</tt> is displayed (for example, with a hidden
          camera) can compute <tt>k = k_1 XOR k_2</tt> and would defeat the scheme. Deployments
          therefore need to treat the <tt>ATM</tt> display of <tt>k_2</tt> as sensitive: </t>
        <ul spacing="normal">
          <li> The <tt>ATM</tt> <bcp14>SHOULD</bcp14> display the QR code of <tt>k_2</tt> only after
            successful smartcard and PIN verification, only once per provisioning session, and for a
            short time, and it <bcp14>SHOULD</bcp14> use a privacy-shielded display. </li>
          <li> If a provisioning session is suspected of having been observed, the financial
            institution <bcp14>SHOULD</bcp14> invalidate the key <tt>k</tt> and repeat provisioning. </li>
        </ul>
      </section>

      <section anchor="impersonation">
        <name>Resistance to Customer Impersonation Attacks</name>
        <t> In a classic Customer Impersonation Attack (via phishing, pharming, or
          credential-stealing trojans), the adversary captures the static credentials of the
          customer (account identifiers, static authentication secrets, and a device or hardware
          fingerprint). Even when an adversary successfully harvests these credentials and clones
          the device fingerprint to establish a fraudulent session with <tt>e-Bank</tt>, the
          adversary is not able to authorize any transaction under the adversary model of <xref
            target="adversary" />, because: </t>
        <ol spacing="normal" type="1">
          <li> Every transaction generates a fresh challenge encrypted under <tt>k'_2</tt> and
            authenticated under <tt>k'_1</tt>. </li>
          <li> The key <tt>k</tt> is never stored on <tt>UC</tt> and is unknown to the customer
            (preventing phishing of <tt>k</tt>). </li>
          <li> Without <tt>k'_2</tt>, the authorizer code <tt>r</tt> cannot be recovered from <tt>r'</tt>,
            so the adversary can only guess it. The probability of a correct guess is <tt>10^-6</tt>
            per attempt and, when <tt>e-Bank</tt> applies the limit of three attempts per challenge
            within the 120-second window, at most <tt>3 x 10^-6</tt> per challenge (see <xref
              target="attempts" />). </li>
          <li> Only the holder of <tt>k'_1</tt> can produce a valid tag <tt>y</tt>, so a phishing
            site cannot create a challenge that <tt>MD</tt> accepts. </li>
        </ol>
      </section>

      <section anchor="mitb">
        <name>Resistance to Man-in-the-Browser (MITB) Attacks</name>
        <t> In a Man-in-the-Browser (MITB) attack, malware residing on <tt>UC</tt> waits for the
          legitimate customer to log in and either (a) silently initiates background transactions
          using the customer's active session or (b) substitutes the beneficiary account and amount
          of a customer-initiated transaction while displaying the original legitimate details on
          the <tt>UC</tt> browser screen (an "unverified signature" attack). </t>
        <t> Under the adversary model of <xref target="adversary" />, DAP is designed to prevent
          both attack variants: </t>
        <ul spacing="normal">
          <li> If the malware attempts to modify <tt>trans_data</tt> inside the QR code on <tt>UC</tt>
            so that the mobile screen shows the legitimate beneficiary while <tt>e-Bank</tt>
            executes the fraudulent transaction, the HMAC-SHA-256 verification <tt>y' =
            HMAC_{k'_1}(trans_data | r')</tt> on <tt>MD</tt> will fail because the adversary does
            not possess <tt>k'_1</tt>. </li>
          <li> If the malware passes the unmodified fraudulent challenge QR code from <tt>e-Bank</tt>
            to the screen of <tt>UC</tt>, <tt>MD</tt> will verify the HMAC and display the <em>
            actual</em> (fraudulent) beneficiary account and amount on the trusted mobile screen. By
            inspecting <tt>MD</tt>'s screen (WYSIWYS), the customer immediately detects that the
            transaction parameters do not match their intent and cancels the authorization. </li>
          <li> Even if the adversary intercepts the 6-digit response <tt>r_hat</tt> entered by the
            customer on <tt>UC</tt> for a legitimate transaction <tt>m_1</tt>, the adversary cannot
            reuse <tt>r_hat</tt> to authorize a different transaction <tt>m_2</tt>, because <tt>r</tt>
            is generated for a single challenge and is bound on the server to <tt>m_1</tt> and to
            its <tt>Nonce</tt>. </li>
        </ul>
      </section>

      <section anchor="replay">
        <name>Replay Protection and Challenge Expiration</name>
        <t> Each challenge incorporates a fresh <tt>Nonce</tt> (inside <tt>trans_data</tt>),
          transaction parameters <tt>trans_data</tt>, and a single-use random code <tt>r</tt> with a
          strict server-enforced lifespan of at most 120 seconds. Once an authorizer code <tt>r</tt>
          is verified or its 120-second timer expires or the attempt limit is reached, the server
          immediately invalidates the challenge context, preventing replay attacks. </t>
        <t> The generation timestamp is inside <tt>trans_data</tt> and is therefore covered by the
          HMAC under <tt>k'_1</tt>: an attacker cannot refresh an old challenge by changing its
          timestamp without knowing <tt>k'_1</tt>. A QR code that was photographed, captured, or
          retained and presented to <tt>MD</tt> more than 120 seconds after its generation is
          discarded by <tt>MD</tt> before the transaction is shown and before the authorizer code is
          revealed. This reduces the opportunity for social-engineering attacks that persuade the
          user to scan an old QR code. The check on <tt>MD</tt> depends on the device clock, which
          is not trusted by the protocol, and it does not include the time the user needs to review
          the data and type the code. For these reasons it is complementary, and the server-side
          120-second limit remains mandatory. A device with a wrong clock may reject valid
          challenges, in which case <tt>MD</tt> asks the user to check the date and time of the
          device. </t>
        <t>
          <tt>MD</tt> does not communicate with <tt>e-Bank</tt>, so it cannot know whether a
          challenge has already been used. Within the 120-second lifespan, the same QR code can
          therefore be scanned and its authorizer code displayed more than once. This does not
          weaken the protocol, because <tt>e-Bank</tt> accepts the code of a challenge only once and
          invalidates it afterwards (<xref target="completion" />). To make a repeated presentation
          visible to the user, <tt>MD</tt>
          <bcp14>SHOULD</bcp14> keep the <tt>Nonce</tt> of each
          challenge whose authorizer code it has displayed for at least 120 seconds, and <bcp14>
          SHOULD</bcp14> warn the user when it receives a challenge with the same <tt>Nonce</tt>
          again. </t>
      </section>

      <section anchor="attempts">
        <name>Limits on Authorizer Code Attempts</name>
        <t> The authorizer code <tt>r</tt> has only 10^6 possible values (<tt>000000</tt> to <tt>
          999999</tt>). An adversary that controls <tt>UC</tt> can submit candidate codes
          automatically, and can do so for a transaction that the adversary itself initiated in a
          fraudulent session, without any action of the customer. With <tt>N</tt> attempts for one
          challenge, the probability of success is <tt>N / 10^6</tt>, so the number of attempts
          needs to be bounded. To keep this probability low, <tt>e-Bank</tt> <bcp14>SHOULD</bcp14>: </t>
        <ul spacing="normal">
          <li>
            accept at most three attempts to submit the code for a challenge
            within its 120-second lifespan, and invalidate the challenge and
            cancel the transaction after the third failed attempt;
          </li>
          <li>
            limit the number of pending transactions per customer, and limit
            the number of failed or cancelled challenges per customer in a
            time window, taking a further action (such as a temporary block of
            financial transactions, a new customer authentication, or an alert
            to the customer) when the limit is reached; and
          </li>
          <li> compare the submitted code with <tt>r</tt> in constant time. </li>
        </ul>
        <t>
          The cumulative limit per customer is a recommendation of this
          document and no value is specified; a deployment may also choose
          not to block the customer after failed or cancelled challenges, and
          to rely on monitoring instead. The specific limits are a policy of
          the financial institution. A
          lower limit reduces the probability of a successful guess but
          cancels more transactions because of typing mistakes by the
          customer.
        </t>
      </section>

      <section anchor="keyshares">
        <name>Key Exchange QR Codes</name>
        <t> The QR codes of the code "001" (<xref target="keyqr" />) carry the shares <tt>k_1</tt>
          and <tt>k_2</tt> without a tag or a signature, because <tt>MD</tt> does not yet hold a
          key. An adversary that controls <tt>UC</tt> can therefore replace the QR code of <tt>k_1</tt>
          by one of its own choice. <tt>MD</tt> does not detect the substitution when it captures
          the share, nor when it computes <tt>k</tt>, but the key of <tt>MD</tt> then differs from
          the key of <tt>e-Bank</tt>. The activation (Step 5 of <xref target="steps" />) fails,
          because <tt>MD</tt> either cannot verify the tag of the activation challenge or, when only the second half of <tt>k</tt> differs, cannot decrypt <tt>r'</tt> into six decimal digits, and <tt>e-Bank</tt> does not
          mark <tt>MD</tt> as enabled. The same holds for a modified <tt>k_2</tt>. The check value
          of the QR code detects only reading errors and does not protect against an adversary. The
          enrollment identifier prevents the combination of shares of different enrollments but is
          not secret. For these reasons, <tt>e-Bank</tt>
          <bcp14>MUST NOT</bcp14> treat <tt>MD</tt> as
          a valid authorizer before a successful activation, and the user needs to be told to repeat
          the enrollment if the activation fails. </t>
      </section>

      <section anchor="ebankkeys">
        <name>Protection of Key Material at e-Bank</name>
        <t> The <tt>HSM</tt> computes only <tt>k_2</tt> (<xref target="derivation" />). The key
          <tt>k</tt> and the subkeys <tt>k'_1</tt> and <tt>k'_2</tt> exist in the working memory of
          <tt>e-Bank</tt> while a challenge is built. The data stored by <tt>e-Bank</tt> do not
          allow the computation of <tt>k</tt> without the <tt>HSM</tt>, but an adversary who
          controls the <tt>e-Bank</tt> process, or the service that sends requests to the <tt>HSM</tt>,
          can obtain <tt>k_2</tt> for any customer. With <tt>k</tt> and the credentials of the
          customer, that adversary can start a transaction, recover <tt>r</tt> from <tt>r'</tt>,
          and authorize the transaction without <tt>MD</tt>, for as long as it holds the keys. To
          reduce this exposure, <tt>e-Bank</tt>: </t>
        <ul spacing="normal">
          <li>
            <bcp14>SHOULD</bcp14> run the code that requests <tt>k_2</tt> and handles <tt>k</tt> in
            a service isolated from the components that face <tt>UC</tt>, with no direct access
            from the Internet; </li>
          <li>
            <bcp14>SHOULD</bcp14> allow requests for <tt>k_2</tt> only on behalf of a pending
            challenge or activation, limit their rate per customer and in total, and audit them,
            raising an alert for requests that have no corresponding transaction; </li>
          <li>
            <bcp14>SHOULD</bcp14> erase <tt>k_2</tt>, <tt>k</tt>, <tt>k'_1</tt>, and <tt>k'_2</tt>
            from memory immediately after use, prevent them from reaching swap space and memory
            dumps, and <bcp14>MUST NOT</bcp14> write them, or <tt>r</tt>, to logs; </li>
          <li>
            <bcp14>SHOULD</bcp14> keep the database of the shares <tt>k_1</tt> under an access
            control that is distinct from that of the service that requests <tt>k_2</tt>, so that
            the compromise of one of them does not give <tt>k</tt>; and </li>
          <li>
            <bcp14>MAY</bcp14> perform the operations that use <tt>k</tt> inside the <tt>HSM</tt>
            (the <tt>e-Bank</tt> sends <tt>k_1</tt>, <tt>r</tt>, the <tt>IV</tt>, and <tt>trans_data</tt>
            to the <tt>HSM</tt>, which returns <tt>r'</tt> and <tt>y</tt>), so that <tt>k</tt> never
            leaves it. </li>
        </ul>
      </section>

      <section anchor="dos">
        <name>Denial of Service</name>
        <t> An adversary that controls <tt>UC</tt>, or that has the static credentials of a
          customer, can start transactions and exhaust the three attempts, which cancels legitimate
          transactions of the customer. The adversary can also create many pending transactions,
          which consumes resources of <tt>e-Bank</tt>, including the <tt>HSM</tt>, that recomputes <tt>k_2</tt> for each challenge. <tt>e-Bank</tt> <bcp14>SHOULD</bcp14>
          limit the number of pending transactions and the rate of challenges per customer and per
          source, and <bcp14>SHOULD</bcp14> dimension the <tt>HSM</tt> for the expected load. </t>
      </section>

      <section anchor="templates">
        <name>Transaction Templates</name>
        <t> The templates embedded in the DAP application determine how <tt>MD</tt> presents the
          authenticated <tt>trans_data</tt> to the user, so they are part of the trusted base of <tt>
          MD</tt>. A modified template could display values in the wrong positions even when the
          HMAC verification succeeds. The template file is digitally signed by the financial
          institution as a CMS SignedData structure <xref target="RFC5652" />. The DAP application <bcp14>
          MUST</bcp14> verify this signature, using the public certificate of the financial
          institution embedded in the application, before installing or using the file, and <bcp14>
          MUST</bcp14> reject a file whose signature is missing or invalid. Because ";" is the field
          delimiter, <tt>e-Bank</tt> <bcp14>MUST NOT</bcp14> include ";" in any field value, and <tt>
          MD</tt> <bcp14>MUST</bcp14> reject challenges whose transaction code is unknown or whose
          number of fields does not match the template. </t>
      </section>

      <section anchor="formal">
        <name>Formal Verification</name>
        <t> An earlier version of the DAP protocol was formally verified with respect to smartphone,
          agent, and server operations using Paulson's inductive method <xref target="Paulson1998" />
          in Isabelle/HOL <xref target="Oliveira2019" /> <xref target="DAPRepo2024" />. That
          verification does not cover the elements specified in this document that were added or
          refined afterwards, namely the transaction templates, the generation timestamp and its
          check on <tt>MD</tt>, the Nonce, and the signed template file. Those elements have not
          been formally verified. </t>
      </section>

      <section anchor="risks">
        <name>Residual Risks and Human Factors</name>
        <t> Because, under the adversary model of <xref target="adversary" />, DAP does not allow
          automated technical forgery of transaction authorizations on <tt>UC</tt>, adversaries are
          forced to resort to active social engineering, persuading the human customer to scan a
          challenge QR code, ignore the fraudulent transaction details displayed on <tt>MD</tt>, and
          read back the resulting 6-digit code <tt>r_hat</tt>. While this requires continuous,
          real-time human cooperation for every single transaction (making large-scale automated
          fraud considerably harder), financial institutions <bcp14>SHOULD</bcp14> combine DAP with
          clear User Interface (UI) warnings on <tt>MD</tt> emphasizing that the user needs to
          verify the beneficiary and amount before pressing <tt>Confirm</tt>. </t>
        <t> Malware on <tt>MD</tt> itself is outside the adversary model of <xref target="adversary" />
          and remains a residual risk. Such malware could cover the screen of the DAP application
          with an overlay, use the accessibility services of the operating system to read or press
          controls, or share the screen with the adversary, which would expose the transaction
          details and the authorizer code. The DAP application <bcp14>SHOULD</bcp14> use the
          protections of the operating system against overlays and screen capture, and the user
          needs to keep the device free of untrusted applications. </t>
      </section>
    </section>

    <section anchor="privacy">
      <name>Privacy Considerations</name>
      <t> This section follows the guidance of <xref target="RFC6973" />. </t>
      <ul spacing="normal">
        <li>
          <em>Data in the QR code.</em> The field <tt>trans_data</tt> is sent in cleartext and can
          contain account numbers, names, and amounts. Anyone who can see or photograph the screen
          of <tt>UC</tt> when the code is displayed can read them. The transaction details are
          already known to <tt>UC</tt>, but they are also exposed to observers. The confidentiality
          of the transaction data on the visual channel is not a goal of DAP, which protects the
          integrity of <tt>trans_data</tt> and the confidentiality of the authorizer code <tt>r</tt>.
          Templates <bcp14>SHOULD</bcp14> include only the fields that the user needs to verify the
          transaction. </li>
        <li>
          <em>Data stored on MD.</em> <tt>MD</tt> stores the key <tt>k</tt> and the signed template
          file. The DAP application <bcp14>SHOULD NOT</bcp14> keep the contents of <tt>trans_data</tt>
          after the transaction ends, and <bcp14>SHOULD NOT</bcp14> write them in logs. </li>
        <li>
          <em>Data stored on e-Bank.</em> For each customer, <tt>e-Bank</tt> keeps <tt>k_1</tt>, <tt>key_id</tt>, <tt>key_version</tt>, <tt>ID</tt>, and <tt>key_timestamp</tt>. These values are
          identifiers and key material, and <tt>e-Bank</tt> <bcp14>SHOULD</bcp14> protect them and
          limit their retention to the period in which the enrollment is active, subject to the
          legal requirements that apply to the financial institution. </li>
        <li>
          <em>Customer identifier.</em> The <tt>ID</tt> of the customer is personal data. It is kept
          on the server and is never carried in a challenge or shown in a QR code. </li>
        <li>
          <em>Applicable law.</em> The processing of personal data by the financial institution is
          subject to the data protection law that applies to it. This document does not define legal
          requirements. </li>
      </ul>
    </section>

    <section anchor="iana">
      <name>IANA Considerations</name>
      <t>
        This document has no IANA actions.
      </t>
    </section>
  </middle>

  <back>
    <references>
      <name>References</name>

      <references>
        <name>Normative References</name>

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2104.xml" />

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml" />

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4648.xml" />
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3629.xml" />
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml" />
        <reference anchor="XML" target="https://www.w3.org/TR/xml/">
          <front>
            <title>Extensible Markup Language (XML) 1.0 (Fifth Edition)</title>
            <author>
              <organization>World Wide Web Consortium</organization>
            </author>
            <date month="November" year="2008" />
          </front>
          <refcontent>W3C Recommendation</refcontent>
        </reference>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5652.xml" />
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6234.xml" />

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml" />

        <reference anchor="FIPS197" target="https://doi.org/10.6028/NIST.FIPS.197-upd1">
          <front>
            <title>Advanced Encryption Standard (AES)</title>
            <author>
              <organization>National Institute of Standards and Technology (NIST)</organization>
            </author>
            <date month="May" year="2023" />
          </front>
          <seriesInfo name="FIPS" value="197" />
        </reference>

        <reference anchor="SP800-38A" target="https://doi.org/10.6028/NIST.SP.800-38A">
          <front>
            <title>Recommendation for Block Cipher Modes of Operation: Methods and Techniques</title>
            <author>
              <organization>National Institute of Standards and Technology (NIST)</organization>
            </author>
            <date month="December" year="2001" />
          </front>
          <seriesInfo name="NIST Special Publication" value="800-38A" />
          <seriesInfo name="DOI" value="10.6028/NIST.SP.800-38A" />
        </reference>

        <reference anchor="ISO18004">
          <front>
            <title>Information technology - Automatic identification and data capture techniques -
              QR Code bar code symbology specification</title>
            <author>
              <organization>International Organization for Standardization (ISO)</organization>
            </author>
            <date month="August" year="2024" />
          </front>
          <seriesInfo name="ISO/IEC" value="18004:2024" />
          <annotation>This specification is available for purchase from ISO.</annotation>
        </reference>
      </references>

      <references>
        <name>Informative References</name>

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4086.xml" />
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4226.xml" />
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6238.xml" />
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6973.xml" />

        <reference anchor="WebAuthn2" target="https://www.w3.org/TR/webauthn-2/">
          <front>
            <title>Web Authentication: An API for accessing Public Key Credentials Level 2</title>
            <author>
              <organization>World Wide Web Consortium</organization>
            </author>
            <date month="April" year="2021" />
          </front>
          <refcontent>W3C Recommendation</refcontent>
        </reference>

        <reference anchor="PSD2RTS" target="https://eur-lex.europa.eu/eli/reg_del/2018/389/oj">
          <front>
            <title>Commission Delegated Regulation (EU) 2018/389 supplementing Directive (EU)
              2015/2366 with regard to regulatory technical standards for strong customer
              authentication and common and secure open standards of communication</title>
            <author>
              <organization>European Commission</organization>
            </author>
            <date month="November" year="2017" />
          </front>
        </reference>


        <reference anchor="Melo2024" target="https://doi.org/10.3390/cryptography8040051">
          <front>
            <title>A Secure Approach Out-of-Band for e-Bank with Visual Two-Factor Authorization
              Protocol</title>
            <author fullname="Laerte Peotta de Melo" initials="L. P." surname="de Melo" />
            <author fullname="Dino Macedo Amaral" initials="D. M." surname="Amaral" />
            <author fullname="Robson de Oliveira Albuquerque" initials="R. O." surname="Albuquerque" />
            <author fullname="Rafael Timoteo de Sousa Junior" initials="R. T."
              surname="de Sousa Junior" />
            <author fullname="Ana Lucila Sandoval Orozco" initials="A. L." surname="Sandoval Orozco" />
            <author fullname="Luis Javier Garcia Villalba" initials="L. J."
              surname="Garcia Villalba" />
            <date month="November" year="2024" />
          </front>
          <seriesInfo name="Cryptography" value="Vol. 8, No. 4, 51" />
          <seriesInfo name="DOI" value="10.3390/cryptography8040051" />
        </reference>

        <reference anchor="Melo2012">
          <front>
            <title>DAP (Dynamic Authorization Protocol): Secure Approach Out-of-Band for E-Bank with
              a Two-Factor Visual Authentication</title>
            <author fullname="Laerte Peotta de Melo" initials="L. P." surname="de Melo" />
            <date year="2012" />
          </front>
          <seriesInfo name="Ph.D. Thesis" value="University of Brasilia, Brasilia, Brazil" />
        </reference>

        <reference anchor="Oliveira2019">
          <front>
            <title>Verification of the Dynamic Authorization Protocol</title>
            <author fullname="Felipe Rodopoulos de Oliveira" initials="F. R." surname="de Oliveira" />
            <date year="2019" />
          </front>
          <seriesInfo name="M.Sc. Thesis" value="University of Brasilia, Brasilia, Brazil" />
        </reference>

        <reference anchor="DAPRepo2024" target="https://github.com/rodopoulos/dap-verification">
          <front>
            <title>Formal Verification Repository for DAP</title>
            <author fullname="Felipe Rodopoulos de Oliveira" initials="F. R." surname="de Oliveira" />
            <date month="July" year="2024" />
          </front>
        </reference>

        <reference anchor="Paulson1998" target="https://doi.org/10.3233/JCS-1998-61-205">
          <front>
            <title>The Inductive Approach to Verifying Cryptographic Protocols</title>
            <author fullname="Lawrence C. Paulson" initials="L. C." surname="Paulson" />
            <date year="1998" />
          </front>
          <seriesInfo name="Journal of Computer Security" value="Vol. 6, pp. 85-128" />
        </reference>

        <reference anchor="Starnberger2009" target="https://doi.org/10.1109/ARES.2009.96">
          <front>
            <title>QR-TAN: Secure Mobile Transaction Authentication</title>
            <author fullname="Guenther Starnberger" initials="G." surname="Starnberger" />
            <author fullname="Lorenz Froihofer" initials="L." surname="Froihofer" />
            <author fullname="Karl M. Goeschka" initials="K. M." surname="Goeschka" />
            <date month="March" year="2009" />
          </front>
          <seriesInfo name="Proceedings of ARES 2009" value="pp. 578-583" />
        </reference>

        <reference anchor="Shannon1949" target="https://doi.org/10.1002/j.1538-7305.1949.tb00928.x">
          <front>
            <title>Communication Theory of Secrecy Systems</title>
            <author fullname="Claude E. Shannon" initials="C. E." surname="Shannon" />
            <date month="October" year="1949" />
          </front>
          <seriesInfo name="Bell System Technical Journal" value="Vol. 28, No. 4, pp. 656-715" />
        </reference>

        <reference anchor="Bellare1994" target="https://doi.org/10.1007/3-540-48329-2_21">
          <front>
            <title>Entity Authentication and Key Distribution</title>
            <author fullname="Mihir Bellare" initials="M." surname="Bellare" />
            <author fullname="Phillip Rogaway" initials="P." surname="Rogaway" />
            <date year="1994" />
          </front>
          <seriesInfo name="Advances in Cryptology - CRYPTO '93" value="pp. 232-249" />
        </reference>

      </references>
    </references>
  </back>
</rfc>