An offline CAPTCHA authentication method, device, and medium based on the privacy commitment of elliptic curve finite field.

By generating hardware-bound asymmetric key pairs and performing offline elliptic curve operations in a trusted execution environment, the problems of shared key leakage and device binding in mobile secondary authentication are solved, achieving high-security, low-power offline verification code generation and verification.

CN123122833APending Publication Date: 2026-11-17CHINA UNICOM DIGITAL TECNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611484364.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-22
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing mobile two-factor authentication technologies have problems such as the risk of shared key leakage, difficulties in device binding and revocation, difficulty in generating offline verification codes, and insufficient security when the device is offline.

Method used

A privacy-preserving commitment method based on elliptic curve finite field is adopted. Hardware-bound asymmetric key pairs are generated in a trusted execution environment. The server calculates the cryptographic commitment and issues a unique identifier and a random salt value. The client generates a verification code in an offline environment and generates a standard short verification code through elliptic curve group operations and finite field operations. The server performs offline verification.

Benefits of technology

It achieves high-security, low-power CAPTCHA generation and verification in offline environments, avoids the risk of shared key leakage, supports device-level identity binding and revocation management, and is compatible with existing login interaction systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123122833A_ABST
    Figure CN123122833A_ABST
Patent Text Reader

Abstract

This invention discloses an offline CAPTCHA authentication method, device, and medium based on elliptic curve finite field privacy protection commitments. The method includes: the server generating a private key `Secret` and calculating the commitment in a TEE (Trusted Execution Environment); and the client-side TEE generating a hardware-sealed key `hwSK` and deriving a device-binding key `DevSeed`. In a network-free environment, the client-side TEE performs elliptic curve group operations and finite field nonlinear transformations based on the commitment points to generate a standard short CAPTCHA. The server offline verifies the correctness of the hardware key participation through bilinear pairing equations and recalculates the CAPTCHA to complete consistency verification. This invention constructs a three-trust-domain security model consisting of a server-side key domain, a client-side public data domain, and a device hardware domain. If any single domain is compromised, the CAPTCHA cannot be forged. Forward confidentiality is achieved through time-varying witness values, and cryptographic binding of device revocation status is implemented through a dual MMR architecture. This method is suitable for high-security offline authentication scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mobile secondary authentication technology, specifically to an offline verification code authentication method, device, and medium based on elliptic curve finite field privacy protection commitment. Background Technology

[0002] Traditional Active Password (OTP) authentication systems suffer from a shared secret dependency problem: TOTP and HOTP schemes require pre-configuration of shared keys between user devices and servers, increasing the complexity of key distribution, storage, and management. The server needs to store the shared keys for all users; if the server is attacked, a large number of user keys may be simultaneously leaked. In isolated network environments, the initial distribution and synchronous updating of shared keys face technical challenges. Once the shared key is leaked, attackers can forge any valid OTP.

[0003] Current mobile two-factor authentication (2FA) and offline CAPTCHA solutions generally suffer from the following technical shortcomings: First, both TOTP (Time-based Sync) and HOTP (Count-based Sync) follow RFC standards. Their core logic involves the server and mobile client pre-negotiating and synchronously storing the same symmetric key. During authentication, both parties use a timestamp or counter as a variable factor, generating a 6-digit dynamic verification code through HMAC hashing to complete the comparison and verification. This scheme requires the client to persistently store the complete key locally. Once the mobile device is stolen, cracked, or maliciously implanted with malware, the shared key can be easily exported. After obtaining the key, attackers can arbitrarily forge legitimate verification codes within any time window, bypassing account login verification, and there is no device binding or revocation traceability capability.

[0004] Second, existing technologies include offline OTP schemes based on ECDH shared secrets, where the client needs to hold the user's private key to participate in the operation. Although the server only stores the user's public key, the client's private key is still stored in software. Once the client's operating system is compromised, the private key can be extracted, and the attacker can completely reproduce the OTP generation process based on it. Such schemes do not achieve zero private key storage on the client side, and their security fails in scenarios where the client is compromised.

[0005] Third, existing technologies include schemes that use elliptic curve commitments to achieve key fragmentation and isolation, where the terminal and server each hold a fragment of the private key and securely negotiate the key through the commitment value; however, such schemes require online interaction and collaboration between the two parties for online decryption key derivation, and cannot be applied to offline verification code generation scenarios; moreover, the verification of the correctness of the commitment depends on online zero-knowledge proof interaction, which is not suitable for completely offline short verification code authentication.

[0006] Fourth, existing technologies include schemes that generate dynamic passwords within secure elements or trusted execution environments, with seed keys stored in secure hardware; however, such schemes still employ a symmetric seed architecture and do not introduce elliptic curve commitments for device identity binding. The server cannot achieve device-level identity verification and revocation status cryptographic binding through commitment values, and its verification process does not support offline verification under server-side key isolation.

[0007] Fifth, existing zero-knowledge proofs used for identity authentication (such as Groth16 and Marlin) require the pre-construction of large-scale arithmetic constraint circuits. The proof generation stage involves massive finite field multiplication and pairing operations. The time taken for a single proof generation on a mobile device can reach hundreds of milliseconds, significantly increasing device power consumption. At the same time, the output is an extremely long proof string, which cannot be compressed to generate the standard 6-8 character short verification code commonly used in business, and is incompatible with the existing login verification code interaction system.

[0008] Sixth, existing offline authentication mostly relies on local self-verification by the client, and the server cannot uniformly manage the entire lifecycle of device registration, invalidation, and revocation; even if the device is lost, a valid verification code can still be generated offline, making it impossible to achieve a complete closed loop of server-uniformly issued device credentials, client-side offline generation, and server-side secure verification. Summary of the Invention

[0009] This invention proposes an offline CAPTCHA authentication method, device, and medium based on elliptic curve finite field privacy protection commitment to solve the problems mentioned in the background.

[0010] To achieve the above objectives, the present invention adopts the following technical solution: An offline CAPTCHA authentication method based on elliptic curve finite field privacy protection commitment, comprising the following steps: S1. The server generates an elliptic curve private key in the Trusted Execution Environment (TEE). The client device's TEE generates a hardware-bound asymmetric key pair (hwPK, hwSK), where hwSK is sealed by the TEE hardware root trust and can never be read or exported by the rich operating system. The client uploads hwPK to the server. S2. The server-side cryptographic commitment binds the device's unique identifier, random salt value, and hardware public key cryptographically to the commitment; the server only sends the cryptographic commitment, unique identifier, and random salt value to the client, and does not send the private key. S3. In a network-free environment, the client uses the hardware-sealed private key to perform elliptic curve scalar multiplication on the commitment and extracts DevSeed as the device binding derived key. S4. The client-side trusted execution environment uses the commitment point as the base point for elliptic curve scalar multiplication. Based on DevSeed, time slice, revocation root, and time-varying witness value pushed by the server, it performs elliptic curve group operation and finite field nonlinear transformation to generate standard short verification codes, and outputs verification anchor points at the same time. S5. The client submits the verification code and verification anchor to the server. The server uses a bilinear pairing equation to verify the correctness of the verification anchor offline. After the verification is successful, DevSeed is extracted and the verification code is recalculated to complete the consistency check.

[0011] Preferably, the specific computational chain for generating the verification code in the client-side TEE during step S4 is as follows: Calculate dynamic scalars ; Perform elliptic curve scalar multiplication with the Commit point as the base point. ,in To add a scalar, instantly change the witness value; Deterministically map the point Q of the elliptic curve to elements of a finite field. ; Calculate the modulo exponent ; Performing modular exponentiation in a finite field , where p is the prime number of the elliptic curve scalar field; Perform hash operation ; Perform non-continuous interleaving truncation on the hash result to generate a standard short verification code.

[0012] Preferably, the time-varying witness value Calculated by the server in fixed time window epochs:

[0013] That is, perform a scalar multiplication between the server's private key (Secret) and the hash-to-curve mapping point of the current revocation root and epoch number, and take the x-coordinate of the result point; for each epoch... Different, the old epoch Unable to be used for CAPTCHA generation in new epochs; The revocation root certificate is pushed to the client along with the signature.

[0014] Preferably, the server uses a bilinear pairing equation. verify The correctness is verified by the following principle: left ,right Both sides are equal if and only if ; The pairing verification is performed offline on the server side, without requiring online interaction from the client, and the server does not need to hold the hwSK to cryptographically prove that the DevPoint is generated from the hwSK in the client's TEE.

[0015] Preferably, the server uses a dual Merkle Mountain Range structure to maintain the device revocation status: the valid device MMR records all registered devices, and the revoked device MMR records all revoked devices; the concatenated hash of the dual MMR root hashes is calculated according to a fixed time window as the revocation root RevokeRoot, which is then distributed to the client after being digitally signed by the server's private key using ECDSA; RevokeRoot indirectly participates in elliptic curve group operations through the time-varying witness value W_epoch, making the verification code generation cryptographically bound to the current revocation status.

[0016] Preferably, the server performs a commitment rotation at a fixed period: Input HashToG1 and compute the rotation commitment This makes the commitments of each epoch cryptographically non-interchangeable; commitments of older epochs are marked as expired, and the server accepts commitments of the current epoch and the previous epoch as a fault tolerance window during verification.

[0017] Preferably, the server-side verification performs triple verification: Commitment consistency verification: Recalculate the commitment using the Secret and compare it with the commitment submitted by the client; Revocation status legality verification: Verify the validity of the revocation root signature, the version number anti-rollback, and the timeliness. Verify that the device has not been revoked by proving that the device's MMR is not included. CAPTCHA consistency verification: Traversing the fault-tolerant time slice set The same algorithm used by the client is used to recalculate and compare the verification code.

[0018] Preferably, the private key is never sent to the client, and the hwSK never leaves the client's trusted execution environment, thus constructing a three-trust domain security model consisting of the server-side key domain, the client-side public data domain, and the device hardware domain.

[0019] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.

[0020] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.

[0021] As can be seen from the above technical solution, the present invention provides an offline CAPTCHA authentication method based on the privacy-preserving commitment of elliptic curve finite field. Compared with the prior art, the present invention has the following advantages: 1. This invention constructs a three-trust domain security model: server-side key domain, client-side public data domain, and device hardware domain. If the server is compromised but has no hwSK, it cannot be forged; if the client operating system is compromised but has no hwSK, it cannot be forged; if the client TEE is compromised but has no Secret, it cannot be forged. All three domains must be compromised simultaneously for the verification code to be forged, significantly improving the security level.

[0022] 2. This invention uses the Commit point as the base point for elliptic curve scalar multiplication to perform group operations, so that the correct generation of the verification code requires solving the elliptic curve discrete logarithm problem. The nonlinearity has cryptographic significance rather than just a format change.

[0023] 3. The present invention Each time window is different; even if an attacker obtains all client data (including...) within a certain time window... Furthermore, data can only be forged within this window, and it automatically expires after the window ends. Combined with the commitment cycle rotation, the available window for data leakage is further limited to one epoch period.

[0024] 4. This invention utilizes the pairing-friendly characteristics of the BN254 curve to transform the participation proof of the TEE hardware key into an offline verifiable pairing equation. The server can achieve trusted verification without holding the hwSK, without requiring online interaction from the client.

[0025] 5. The RevokeRoot of this invention, through... It indirectly participates in elliptic curve group operations, forming an unbypassable link for the generation of revocation status, server private key, witness value, and verification code; even if a revoked device holds all client data, it cannot generate a valid verification code that matches the current revocation root using the old revocation root.

[0026] 6. The client of this invention only needs to perform basic cryptographic operations native to the terminal, such as elliptic curve multiplication, hashing, and modular exponentiation. It requires no complex arithmetic circuitry, with computation time in the microsecond range and low device power consumption. Bilinear pairing operations are only performed during server-side verification and do not affect client performance. It natively outputs a standard 6-8 digit short verification code, compatible with existing login interaction systems.

[0027] 7. The client of this invention only uploads the verification code, the public commitment value, and the verification anchor point DevPoint. Sensitive information such as account and device identifiers are all masked locally through cryptographic commitments. The server-side verification does not require the collection of the user's original privacy data, and there is no risk of leakage due to packet capture during transmission.

[0028] 8. This invention integrates four major modules: server-side credential issuance, client-side TEE offline computation, server-side bilinear pairing verification and triple verification, and device lifecycle management, filling the architectural gap in existing technologies that cannot simultaneously address offline availability, three-domain security, and global management. Attached Figure Description

[0029] Figure 1 This is a flowchart illustrating an offline CAPTCHA authentication method based on elliptic curve finite field privacy protection commitment according to the present invention.

[0030] Figure 2 This is a flowchart of the revocation root generation process in this invention.

[0031] Figure 3 This is a flowchart of the server-side verification process in this invention. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0033] like Figure 1 As shown in this embodiment, an offline CAPTCHA authentication method based on elliptic curve finite field privacy commitment includes: The device registration process includes the following steps: S1: Server-side private key generation; The server generates a random scalar `Secret` on the elliptic curve BN254 within the Trusted Execution Environment (TEE) as its core private key. This private key is generated, stored, and computed only within the TEE and does not participate in any network transmission. The server calculates the corresponding public key `PubServer = Secret · G`, where G is the base point of the G1 group of the BN254 curve. Simultaneously, the server assigns a globally unique device identifier `DevID` to each device to be registered and generates a random salt value `Salt` (a 256-bit random number).

[0034] S1.5: Client TEE hardware key generation and upload; The Trusted Execution Environment (TEE) of the client device (such as ARM TrustZone or Android StrongBox) internally generates a hardware-bound asymmetric key pair (hwPK, hwSK): a scalar hwSK is randomly selected from the BN254 curve G1 group as the hardware private key, and hwPK = hwSK·G is calculated as the hardware public key; hwSK is stored in a sealed manner by the TEE hardware root trust and can never be read or exported by the rich operating system. The client uploads hwPK to the server through an encrypted channel, and the server stores the (DevID, hwPK) mapping relationship.

[0035] S2: Server-side computational cryptographic commitment; The server incorporates the hardware public key into the commitment calculation formula, thus binding the commitment to the device hardware identity cryptography:

[0036] HashToG1 is a hash-to-curve mapping function conforming to RFC9380, which deterministically maps an input of arbitrary length to a point on the BN254 curve G1 group. Commit is a point on an elliptic curve and has the following properties: (1) One-way hiding: Knowing Commit, DevID, Salt, and hwPK, it is impossible to inversely deduce Secret, which is equivalent to solving the Elliptic Curve Discrete Logarithm Problem (ECDLP); (2) Device binding: DevID, Salt, and hwPK are bound together, so that the commitment corresponds one-to-one with a specific device hardware.

[0037] S3: The server distributes public data; The server sends public data—DevID, Salt, and Commit—to the client via an encrypted channel (such as TLS 1.3). No Secret is sent, and the client does not store any sensitive keys. The client's operating system stores DevID, Salt, and Commit locally.

[0038] S3.5: Initial time base synchronization for the client; During registration or the first network connection, the client synchronizes standard UTC base time T0 from the server and permanently caches the base time and the local device clock value Clock0 at the synchronization time locally. Synchronization is only performed once during the initial network connection; subsequent offline synchronization does not require another network connection.

[0039] like Figure 2 As shown, the process for revoking the root and generating and pushing the witness value is as follows: S4: Dual MMR pin architecture maintenance; The server uses a dual Merkle Mountain Range (MMR) structure to maintain the equipment's decommissioning status. Valid Device MMR: When a device is registered, the Hash (DevID‖Salt) is appended as a leaf node to the Valid Device MMR.

[0040] Revoking Device MMR: When a device is revoked, Hash(DevID‖revoke_reason) is appended as a leaf node to the revoked device MMR.

[0041] The two MMRs are physically isolated and each maintains its own root hash independently.

[0042] Step S4.5: Calculation and signature of the revocation root; The server calculates based on a fixed time window (e.g., 1 hour as one epoch):

[0043] Use the ECDSA signing key corresponding to the server's private key Secret to digitally sign RevokeRoot and generate SigRevokeRoot.

[0044] Step S4.6: Calculation of time-varying witness value; The server calculates the time-varying witness value in the current epoch:

[0045] That is, perform a scalar multiplication between the server's private key (Secret) and the hash-to-curve mapping point of the current revocation root and epoch number, and take the x-coordinate of the result point; for each epoch... Different, the old epoch Unable to be used for CAPTCHA generation in new epochs; The revocation root certificate is pushed to the client along with the signature; It is a scalar field element (254-bit integer), essentially a cryptographic signature authorization by the server using a Secret for the "current revocation status and time window". Each epoch... They are different, and the client cannot calculate them on its own. (Missing Secret).

[0046] Step S4.7: Push and Synchronize; The server will Pushed to the client through the following channels: Online synchronization: Internet-connected devices retrieve the latest data every 24 hours via HTTPS, with emergency push notifications supported for security incidents. Online data is cached locally for 72 hours, after which it expires.

[0047] Intranet Offline Pre-configuration: For isolated intranet devices that have no external network access for a long time, during the device registration phase, the administrator exports a long-term data packet signed by the server, and the validity period can be customized from several months to several years.

[0048] After receiving the data, the client first verifies the validity of the ECDSA signature of SigRevokeRoot. No earlier than the historical version cached locally (to prevent rollback), and stored in the local cache after successful verification.

[0049] The client generates the verification code in a completely offline state. All password operations are completed within the TEE, and the rich operating system is only responsible for passing in public parameters and receiving the final verification code.

[0050] Step S5.1: Time slice calculation; The client obtains the local time and calculates the time slice. The fixed time slice granularity is set to 60 seconds (1 minute), and the calculation rule is: divide the device's local Unix timestamp by 60 and round down to obtain the current local time slice value Tlocal.

[0051] The offline time base calculation method is as follows: In the long-term network outage state, the client relies on the device's local RTC hardware clock to keep track of the time. The offline cumulative duration is calculated by the difference between the current local clock Clock and the local device clock value Clock0 at the synchronization time. The base UTC time T0 is added to estimate the current theoretical standard UTC time, and then the standard time slice Tstd is calculated.

[0052] Step S5.2: Derivation of hardware binding key within the TEE; The rich operating system sends an OTP generation request to the TEE, passing in the following parameters: Commit (the commitment point of the current epoch, including x and y coordinates), Tlocal, RevokeRoot, W_epoch, and epoch_number.

[0053] TEE internally performs hardware binding key derivation:

[0054] Where hwSK is the TEE hardware-sealed private key (scalar), and Commit is a point on the elliptic curve (serving as the base point for scalar multiplication). DevPoint is a new elliptic curve point whose discrete logarithm relative to the base point G involves both Secret (hidden in Commit) and hwSK (sealed in TEE). Even if an attacker knows Commit and hwPK, they would need to solve ECDLP to calculate DevPoint without knowing hwSK.

[0055] extract This means that the x-coordinate of the DevPoint is used as the device binding derived key. DevSeed exists only in the TEE memory and is not returned to the rich operating system.

[0056] Step S5.3: Dynamic scalar calculation; TEE calculation of dynamic scalars:

[0057] HashToScalar is a hash function that maps any input to a BN254 scalar field. r binds to the revocation status, time slice, and device hardware key, which are different for each time slice.

[0058] Step S5.4: Elliptic curve group operations; TEE performs elliptic curve scalar multiplication based on the commitment point:

[0059] in The result is the addition in the scalar field, and Commit is the point on the elliptic curve. The time-varying witness value signed by the server is used as an additional scalar in the calculation.

[0060] The technical significance of this step lies in the fact that Q is a new elliptic curve point, and its correct calculation requires: Commit (including Secret, issued by the server); r (requires DevSeed, derived from hwSK, sealed in TEE); (Requires Secret calculation, issued by the server); All three are indispensable. Even if an attacker obtains all publicly available client data (Commit, RevokeRoot, ... Without knowing hwSK, it is also impossible to calculate the correct Q, because obtaining DevSeed requires solving ECDLP.

[0061] Step S5.5: Point-to-finite-field mapping; TEE determinates EC points as elements of a finite field:

[0062] MapToField employs the following deterministic mapping method: it takes the x-coordinate of point Q as the element value of the finite field. This mapping is deterministic; the same input always produces the same output.

[0063] Step S5.6: Modular exponentiation in the finite field; TEE calculates the modulo exponent:

[0064] Perform modular exponentiation in a finite field:

[0065] Where p is a 254-bit prime number in the BN254 scalar field. This modular exponentiation operation introduces cryptographically significant nonlinearity over a finite field—the exponent e is determined by DevID, the time slice, and the revocation root, thus cryptographically isolating the operation results across different devices, times, and revocation states.

[0066] Step S5.7: Hash operation; TEE performs hash calculation:

[0067] The modulo exponentiation result n, the device binding key DevSeed, and the time slice Tlocal are concatenated and then subjected to SHA3-256 hashing, outputting a 32-byte hash string.

[0068] Step S5.8: Discontinuous staggered truncation; TEE performs non-contiguous interleaved truncation on the hash result to generate a standard short verification code: A fixed non-linear interval is preset to extract the index sequence; the 6-bit standard verification code uses the extraction index [2,7,11,16,22,29] to extract the corresponding single byte in sequence; the 8-bit verification code replaces the index sequence with [1,5,9,14,19,24,27,30], and the overall operation logic remains unchanged.

[0069] The byte mapping multi-mode design allows switching of the output character set according to business needs. Mode 1 (default): Pure numeric verification code, single-byte value modulo 10, mapping result 0~9.

[0070] Mode 2: Verification code consisting entirely of uppercase letters. The single-byte value is modulo 26, with 0→A, 1→B, ..., 25→Z.

[0071] Mode 3: A mixed verification code of numbers and uppercase letters. The single-byte value is modulo 36, with 0~9 mapping to numbers and 10~35 mapping to A~Z.

[0072] The extracted bytes are mapped according to the selected character set and concatenated in the order of index extraction to form the final offline verification code.

[0073] Step S5.9: Return the verification code and verification anchor point; TEE returns the final verification code OTP (only the final short verification code is returned, without any intermediate values) and the verification anchor point DevPoint (an elliptic curve point, approximately 64 bytes) to the rich operating system. The rich operating system submits the OTP and DevPoint to the server for verification; the server-side verification process includes verification anchor point verification and triple verification.

[0074] Step S6: Verify the correctness of the anchor point DevPoint (bilinear pairing bridging). like Figure 3 As shown, after the server receives the OTP, DevPoint, and Commit submitted by the client, it first verifies the correctness of the DevPoint.

[0075] Known on the server: Commit (can be recalculated from the local Secret), hwPK (stored during registration).

[0076] Using the bilinear mapping e:G1×G2→GT of the BN254 curve, verify the following pairing equation:

[0077] Verification principle: left: ; right: ; Both sides are equal if and only if DevPoint = hwSK·Commit This pairing verification does not require the server to know hwSK; it can cryptographically prove that the DevPoint was indeed generated by performing a scalar multiplication on the Commit using hwSK within the client's TEE. If the verification fails, it indicates that the DevPoint has been tampered with or forged, and authentication is directly rejected.

[0078] After successful verification, the server extracts... .

[0079] Step S7: Triple verification; The server uses the locally stored Secret to independently perform three verifications: Verification 1: Commitment consistency verification; The server recalculates the commitment for the current epoch: ; The server compares the client's committed commit with the recalculation result. The server accepts commits from both the current epoch and the previous epoch (a fault-tolerant window to accommodate commitment rotation transitions). If they do not match, it indicates the credentials have been tampered with or expired, and authentication is rejected.

[0080] Verification 2: Verification of the legality of the revocation status; Verify the validity of the ECDSA signature of RevokeRoot; check that the epoch_number in RevokeRoot is not earlier than the server's historical records (to prevent rollback attacks); verify that the RevokeRoot generation time is within a reasonable window from the current time; verify that the current device is not on the revocation list using a non-membership proof of the device's MMR. If the device has been revoked or the revocation root has expired / been rolled back, refuse authentication.

[0081] Verification 3: Verification code consistency check; The server uses the same algorithm as the client, based on local standard UTC time, to traverse the fault-tolerant time slice set {Tserver-2, Tserver-1, Tserver, Tserver+1, Tserver+2} (a total of 5 consecutive time slices, each time slice is 60 seconds, and the maximum allowed cumulative clock drift is ±120 seconds), and performs the following recalculation for each candidate time slice Tlocal: 1. Recalculate ; 2. ; 3. ; 4. ; 5. ; 6. ; 7. ; 8. ; Comparison With the OTP submitted by the client. If any time slice If they match, then the verification codes are identical.

[0082] Step S8: Authentication result; If the commitment consistency check passes, the device has not been revoked, and the verification code consistency check passes, then the authentication is successful; otherwise, the authentication fails.

[0083] The commitment cycle rotation process is as follows: Step S9.1: The server initiates a commitment rotation; The server recalculates the rotation commitment at a fixed period (e.g., every 30 days is one commitment epoch):

[0084] in The current commitment period is numbered, and the HashToG1 input makes the commitments of each epoch cryptographically non-interchangeable—the commit values ​​of different epochs are completely different, and it is impossible to derive the commit of one epoch from the commit of another epoch.

[0085] Step S9.2: The old commitment marker has expired; The server marks the commits from the previous epoch as expired. During server verification, the server accepts commits from both the current epoch and the previous epoch (fault tolerance window), allowing the client to use either the old or new commitments during the transition period.

[0086] Step S9.3: The client synchronizes the new commitment; The client synchronizes new data within the network window. (with RevokeRoot, (Synchronous push). The client TEE will automatically use the latest epoch's commit when generating the next OTP.

[0087] Step S9.4: Old data becomes invalid; After an epoch expires, the old ,old None of these methods can be used to generate valid CAPTCHAs. Even if an attacker obtains all client data within a certain epoch, all parameters automatically become invalid after the epoch expires, shortening the available window for data leakage from "permanent" to "one epoch cycle (e.g., 30 days)".

[0088] The offline time synchronization and fault tolerance mechanism is as follows: One-time synchronization of reference time: During the client device registration and initial network connection to obtain public credentials, the standard UTC reference time T0 is synchronized from the server and permanently cached locally along with the local device clock value Clock0 at the synchronization time. This synchronization is performed only once during the initial network connection; subsequent offline synchronization requires no further network connection.

[0089] Offline self-time calculation: In the long-term offline state, the client relies on the device's local RTC hardware clock to keep track of time. The offline cumulative duration Δt = Clock - Clock0 is calculated by using the difference between the current local clock Clock and Clock0, and the current theoretical standard UTC time is estimated. Then calculate the standard time slice. .

[0090] Server-side verification fault tolerance: The server holds standard UTC time. During verification, it simultaneously traverses five consecutive time slices (Tserver-2, Tserver-1, Tserver, Tserver+1, Tserver+2) for comparison. Each time slice is 60 seconds, and the maximum allowed cumulative clock drift for ±2 time slices is ±120 seconds (±2 minutes). This adapts to scenarios where devices are offline for extended periods and RTCs experience slow time offsets. The monthly drift of RTC crystal oscillators in mobile and IoT devices is only tens of seconds, and the cumulative offset over several months of offline operation is typically less than 2 minutes, allowing for successful offline verification.

[0091] Over-limit fallback logic: If the device has been offline for several months and has been in extreme high and low temperature environments for a long time, and the local clock drifts beyond the ±2 minute fault tolerance range, all time slice verification codes will fail to be verified; the user only needs to reconnect to the network and synchronize the base time once to restore the offline generation capability, without having to reissue the device credentials.

[0092] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.

[0093] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.

[0094] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk), etc.

[0095] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0096] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0097] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An offline CAPTCHA authentication method based on elliptic curve finite field privacy commitment, characterized in that, Includes the following steps: S1. The server generates an elliptic curve private key in the Trusted Execution Environment (TEE). The client device's TEE generates a hardware-bound asymmetric key pair (hwPK, hwSK), where hwSK is sealed by the TEE hardware root trust and can never be read or exported by the rich operating system. The client uploads hwPK to the server. S2. The server-side cryptographic commitment binds the device's unique identifier, random salt value, and hardware public key cryptographically to the commitment; the server only sends the cryptographic commitment, unique identifier, and random salt value to the client, and does not send the private key. S3. In a network-free environment, the client uses the hardware-sealed private key to perform elliptic curve scalar multiplication on the commitment and extracts DevSeed as the device binding derived key. S4. The client-side trusted execution environment uses the commitment point as the base point for elliptic curve scalar multiplication. Based on DevSeed, time slice, revocation root, and time-varying witness value pushed by the server, it performs elliptic curve group operation and finite field nonlinear transformation to generate standard short verification codes, and outputs verification anchor points at the same time. S5. The client submits the verification code and verification anchor to the server. The server uses a bilinear pairing equation to verify the correctness of the verification anchor offline. After the verification is successful, DevSeed is extracted and the verification code is recalculated to complete the consistency check.

2. The offline CAPTCHA authentication method based on elliptic curve finite field privacy protection commitment as described in claim 1, characterized in that: The specific computational chain for generating the verification code in the client-side TEE of S4 is as follows: Calculate dynamic scalars ; Perform elliptic curve scalar multiplication with the Commit point as the base point. ,in To add a scalar, instantly change the witness value; Deterministically map the point Q of the elliptic curve to elements of a finite field. ; Calculate the modulo exponent ; Performing modular exponentiation in a finite field , where p is the prime number of the elliptic curve scalar field; Perform hash operation ; Perform non-continuous interleaving truncation on the hash result to generate a standard short verification code.

3. The offline CAPTCHA authentication method based on elliptic curve finite field privacy protection commitment as described in claim 2, characterized in that: The time-varying witness value Calculated by the server in fixed time window epochs: That is, perform a scalar multiplication between the server's private key (Secret) and the hash-to-curve mapping point of the current revocation root and epoch number, and take the x-coordinate of the result point; for each epoch... Different, the old epoch Unable to be used for CAPTCHA generation in new epochs; The revocation root certificate is pushed to the client along with the signature.

4. The offline CAPTCHA authentication method based on elliptic curve finite field privacy protection commitment as described in claim 3, characterized in that: The server uses a bilinear pairing equation. verify The correctness is verified by the following principle: left ,right Both sides are equal if and only if ; The pairing verification is performed offline on the server side, without requiring online interaction from the client, and the server does not need to hold the hwSK to cryptographically prove that the DevPoint is generated from the hwSK in the client's TEE.

5. The offline CAPTCHA authentication method based on elliptic curve finite field privacy protection commitment as described in claim 4, characterized in that: The server uses a dual Merkle Mountain Range structure to maintain the device revocation status: the valid device MMR records all registered devices, and the revoked device MMR records all revoked devices; the concatenated hash of the dual MMR root hashes is calculated according to a fixed time window as the revocation root RevokeRoot, which is then digitally signed by the server's private key using ECDSA and distributed to the client; RevokeRoot indirectly participates in elliptic curve group operations through the time-varying witness value W_epoch, making the verification code generation cryptographically bound to the current revocation status.

6. The offline CAPTCHA authentication method based on elliptic curve finite field privacy protection commitment as described in claim 5, characterized in that: The server performs a commitment rotation at a fixed period: Input HashToG1 and compute the rotation commitment This makes the commitments of each epoch cryptographically non-interchangeable; commitments of older epochs are marked as expired, and the server accepts commitments of the current epoch and the previous epoch as a fault tolerance window during verification.

7. The offline CAPTCHA authentication method based on elliptic curve finite field privacy protection commitment as described in claim 6, characterized in that: The server-side verification process performs triple verification: Commitment consistency verification: Recalculate the commitment using the Secret and compare it with the commitment submitted by the client; Revocation status legality verification: Verify the validity of the revocation root signature, the version number anti-rollback, and the timeliness. Verify that the device has not been revoked by proving that the device's MMR is not included. CAPTCHA consistency verification: Traversing the fault-tolerant time slice set The same algorithm used by the client is used to recalculate and compare the verification code.

8. The offline CAPTCHA authentication method based on elliptic curve finite field privacy protection commitment as described in claim 7, characterized in that: The private key is never sent to the client, and the hwSK never leaves the client's trusted execution environment, thus constructing a three-trust domain security model consisting of the server-side key domain, the client-side public data domain, and the device hardware domain.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 8.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 8.