Infrastructure-free security communication method and system based on temporary identity

This infrastructure-free secure communication method, which generates temporary elliptic curve cryptography key pairs and temporary identifiers locally on the device, solves the problems of communication interruption and information leakage in extreme scenarios, achieves anonymous communication and high reliability, and is suitable for infrastructure-free environments in disaster sites and sensitive areas.

CN121151879APending Publication Date: 2025-12-16王义珂
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511529939.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

Existing communication technologies lack sufficient security and adaptability in extreme scenarios, especially when network infrastructure is damaged or cut off, leading to communication interruptions or information leaks, and failing to meet the critical needs of disaster relief and military operations.

Method used

An infrastructure-free secure communication method based on temporary identities is adopted. Temporary elliptic curve cryptography key pairs are generated locally on the device to generate temporary identifiers that do not contain persistent identity information. Device discovery is performed using wireless communication broadcast identifiers, and a shared key is calculated using elliptic curve algorithms. Session keys are used for encrypted and authenticated transmission. The session keys are stored only in the device memory and are automatically destroyed after the communication ends or times out.

Benefits of technology

It enables anonymous communication, prevents the theft of historical communication content, improves communication reliability and flexibility, and is suitable for device-to-device communication in environments without network infrastructure. It is especially suitable for temporary rescue teams in disaster sites and sensitive areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121151879A_ABST
    Figure CN121151879A_ABST
Patent Text Reader

Abstract

The invention discloses a temporary identity-based non-infrastructure secure communication method and system, and the method comprises the steps: enabling a device to locally and periodically generate a temporary elliptic curve cryptographic key pair, deriving a temporary identifier which does not contain any persistent identity information, guaranteeing the communication anonymity from the source, and effectively overcoming the limitation of dependence on a preset social chain; the core security mechanism lies in the temporary and short life cycle of session keys: all keys are only stored in an equipment memory and are automatically destroyed after communication is finished or overtime, and perfect forward secrecy is realized in combination with periodic updating of temporary key pairs, so that decryption cannot be performed even if the keys are leaked in the future for a long time and historical sessions cannot be performed; a one-time random number verification mechanism is introduced in the key negotiation stage, and replay attacks are effectively resisted; the method does not depend on fixed infrastructures such as a base station and the Internet, a point-to-point or mesh network is constructed through a wireless module of equipment, and a communication link can still be kept available in an extreme environment that the infrastructures are paralyzed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of secure communication, in particular to a temporary identity-based infrastructure-free secure communication method and system. BACKGROUND

[0002] In today's society, communication technology plays a crucial role in daily life and work. Especially in extreme scenarios such as natural disaster rescue, military operation execution, and sensitive area operation, the stability and reliability of communication are particularly critical. Traditional communication applications such as Signal and WhatsApp can meet daily needs, but when the network infrastructure is damaged, cut off or interfered, such applications will completely fail, directly leading to poor transmission of rescue instructions, interruption of military deployment or leakage of sensitive information, causing serious consequences.

[0003] Currently, there are some offline communication solutions on the market, such as Bridgefy based on Bluetooth Mesh and Briar relying on social relationship chain or Tor network. However, these solutions have obvious defects. Bridgefy, although feasible in some scenarios, lacks perfect forward secrecy mechanism and is vulnerable to replay attacks, leading to theft or tampering of historical communication content, and even identity spoofing. This can pose a huge security risk to the transmission of critical command instructions in disaster rescue or communication between devices in military operations.

[0004] In contrast, applications such as Briar can run in social relationship chains or Tor networks, but they are very vulnerable in temporary networking or anonymous communication scenarios. This is particularly disadvantageous in scenarios such as temporary rescue teams in disaster sites or anonymous information exchange in sensitive areas. In such cases, device users often cannot build social associations in advance, and communication relying on Tor networks limits the immediacy and flexibility of anonymous communication, which may ultimately lead to communication interruption or coordination obstruction, seriously delaying critical treatment opportunities.

[0005] In summary, existing communication technologies still have many shortcomings in terms of security protection capability and scenario adaptability, especially in extreme scenarios, which may pose substantial risks, and therefore more perfect solutions are urgently needed. SUMMARY

[0006] To address the shortcomings of the prior art described above, the present application aims to provide a temporary identity-based infrastructure-free secure communication method and system to solve the problems raised in the background art.

[0007] To solve the above technical problems, the present application adopts the following technical solutions: The present application provides a temporary identity-based infrastructure-free secure communication method, comprising the following steps: S1. The communication device periodically generates a temporary elliptic curve cryptography key pair locally, the temporary elliptic curve cryptography key pair is a temporary public key, a temporary identifier is obtained by performing cryptographic hash processing on the temporary public key, and the temporary identifier is broadcasted through wireless communication; Wherein the temporary identifier does not contain any persistent identity information; S2. When two devices complete mutual discovery through the temporary identifier, the temporary public keys of both parties are exchanged, a shared key is calculated based on an elliptic curve algorithm, and one or more session keys are derived from the shared key through a key derivation function; S3. The session keys are used for encrypted and authenticated transmission of communication data, the session keys are only temporarily cached in the memory of the device, and key erasure and cache destruction operations are automatically performed after the communication ends or a preset timeout period is exceeded.

[0008] In one or more embodiments of the present application, in S1, the step of obtaining a temporary identifier by performing cryptographic hash processing on a temporary public key specifically includes: The temporary identifier TempID is defined by the following formula: Wherein, is the public key in the temporary elliptic curve cryptography key pair; is a cryptographic secure hash function for mapping input data of any length to a hash value of a fixed length; is a truncation function for extracting the first x bits of the hash value as the final temporary identifier; is the generated temporary identifier, and the length of the temporary identifier is defined by

[0009] In one or more embodiments of the present application, before the temporary identifier is calculated, a key serialization step is further included: the public key is first converted into a standard byte sequence format, and then the hash processing is performed.

[0010] In one or more embodiments of the present application, the function is any one of SHA-256, SHA-384 or SM3, and the length x of the temporary identifier is in the range of 16-64 bits.

[0011] ​In one or more embodiments of the present application, in S2, the step of exchanging the serialized temporary public key by both parties further comprises an anti-replay verification process: the sender synchronously appends a randomly generated nonce when transmitting the serialized temporary public key; the receiver receives the serialized temporary public key and the nonce, and first queries the local nonce cache list. If the nonce does not exist in the cache list, the verification is passed, the nonce is added to the cache list, and the subsequent shared key calculation step is performed. If the nonce already exists in the cache list, it is determined as a repeated request, and the temporary public key is rejected.

[0012] In one or more embodiments of the present application, in S1, the step of periodically generating a temporary elliptic curve cryptography key pair by the communication device specifically comprises: the communication device presets a key update period T, triggers a local elliptic curve cryptography algorithm to perform a key generation operation every interval T to obtain a new temporary elliptic curve cryptography key pair, and automatically destroys the temporary elliptic curve cryptography key pair generated in the last period to ensure that the temporary public keys generated by the same communication device in different periods have no relevance.

[0013] In one or more embodiments of the present application, in S2, the step of deriving one or more session keys from the shared key by a key derivation function specifically comprises: the key derivation function is HKDF, the shared key is used as the input key material of HKDF, and the spliced byte sequence of the serialized temporary public keys of both parties is used as a salt value. The extraction stage and the expansion stage of HKDF are sequentially executed to derive at least two session keys, which are respectively used for encryption operation and authentication operation of communication data.

[0014] In one or more embodiments of the present application, in S3, the step of using the session keys to encrypt and authenticate the transmission of communication data specifically comprises: using AES-GCM or ChaCha20-Poly1305 algorithm, using the session key for encryption operation to encrypt the communication data to obtain ciphertext data, and using the session key for authentication operation to generate a message authentication code (MAC) for the ciphertext data. The receiver receives the ciphertext data and the message authentication code, and uses the corresponding session key to verify the validity of the message authentication code. If the verification is passed, the ciphertext data is decrypted to obtain the original communication data. If the verification fails, the ciphertext data is directly discarded. The preset timeout time is in the range of 5-30 minutes.

[0015] This invention provides an infrastructure-free secure communication system based on temporary identities, comprising a temporary key generation module, an identifier processing module, a broadcast module, a device discovery module, a key negotiation module, an encrypted transmission module, and a key management module. The temporary key generation module periodically generates temporary elliptic curve cryptography key pairs locally on the communication device, and performs key serialization processing on the temporary public key in the temporary elliptic curve cryptography key pair to obtain a temporary public key in a standard byte sequence format. The identifier processing module performs cryptographic hash processing on the serialized temporary public key, extracting the first x bits of the hash value using a truncation function to obtain a temporary identifier, which does not contain any persistent identity information. The broadcast module is used for... The temporary identifier is broadcast wirelessly. The device discovery module is used to discover the two communication devices through the temporary identifier. The key negotiation module is used to control the two parties to exchange their serialized temporary public keys after the two communication devices discover each other. The shared key is calculated based on the elliptic curve algorithm on the exchanged temporary public keys, and one or more session keys are derived from the shared key through the key derivation function. The encrypted transmission module is used to encrypt and authenticate the transmission of communication data using the session key. The key management module is used to temporarily cache the session key in the memory of the communication device and automatically perform key erasure and cache destruction operations after the communication ends or after a preset timeout period.

[0016] In one or more embodiments of the present invention, the temporary key generation module presets a key update period T, triggers a local elliptic curve cryptography algorithm to generate a new temporary elliptic curve cryptography key pair every interval T, and automatically destroys the key pair of the previous period; the temporary key generation module adopts the SEC1 or x.509 standard format to convert the temporary public key from the native data format of the elliptic curve cryptography algorithm into a unified byte sequence; the identifier processing module calculates the temporary identifier using the following formula: in, This is a temporary public key that has been serialized. Use SHA-256, SHA-384 or SM3 hash functions. The first 16-64 bits of the hash value are extracted as a temporary identifier. When the key negotiation module controls the exchange of temporary public keys between the two parties, it synchronously appends a randomly generated one-time random number. The receiver performs anti-replay verification by querying its local one-time random number cache list. Furthermore, the key negotiation module uses the HKDF algorithm, with the shared key as input key material and the concatenated byte sequence of the serialized temporary public keys of both parties as salt, to derive at least two session keys for encryption and authentication, respectively. The encrypted transmission module uses the AES-GCM or ChaCha20-Poly1305 algorithm, encrypting the communication data with the session keys to obtain ciphertext and generating a message authentication code. The receiver first verifies the MAC validity; if the verification is successful, the ciphertext is decrypted; if the verification fails, the data is discarded. The key management module supports manual configuration by the user or setting a preset timeout of 5-30 minutes using system default values. It automatically erases the session keys in memory and destroys the cache after communication ends or the timeout occurs.

[0017] The beneficial effects of this invention are as follows: by periodically generating temporary elliptic curve cryptography key pairs locally on the device, and deriving temporary identifiers that do not contain any persistent identity information based on these pairs, the association between the communication session and the device's real identity is severed from the source, thus achieving true anonymous communication. The core security mechanism lies in the temporary nature and short lifespan of the session key: all keys are stored only in the device memory and are automatically destroyed after the communication ends or times out. Combined with the periodic updates of the key pair, perfect forward confidentiality is achieved, effectively solving the risk of easy theft during historical communication. Introducing a one-time random number verification mechanism during the key negotiation phase can effectively identify and reject replay attacks, significantly improving communication reliability. At the same time, this invention does not rely on fixed network infrastructure at all, and maintains communication availability in extreme environments through direct device connection. It also uses efficient cryptographic algorithms to achieve the best balance between security and resource consumption, making it particularly suitable for mobile portable devices. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a temporary key periodic generation process in one embodiment of the present invention; Figure 2 This is a temporary identifier generation process in one embodiment of the present invention; Figure 3This is a device discovery process in one embodiment of the present invention; Figure 4 This is an anti-replay verification process in one embodiment of the present invention; Figure 5 This is the ECDH shared key calculation process in one embodiment of the present invention; Figure 6 This is an embodiment of the HKDF session key derivation process of the present invention; Figure 7 This is an embodiment of the encrypted transmission and key destruction process of the present invention. Detailed Implementation

[0020] 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 only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Example 1: like Figures 1-7 As shown in one embodiment of the present invention, a secure communication method for infrastructure-free communication based on temporary identities is characterized by the communication device first independently and periodically generating temporary elliptic curve cryptography (ECC) key pairs locally. This key pair contains a temporary public key and a temporary private key. To achieve higher security and anonymity, the key pair update cycle T can be preset by the user according to security requirements, for example, set to 10 minutes. When the cycle expires, the device automatically generates a brand new ECC key pair and immediately and securely destroys the key pair used in the previous cycle, ensuring that the keys used in different time periods are completely unrelated, thus laying the foundation for perfect forward secrecy.

[0022] After generating the temporary public key, it needs to be processed to obtain a temporary identifier (TempID) for device discovery. A key preprocessing step is key serialization, which first converts the native public key data format of the elliptic curve cryptography algorithm into a standard byte sequence. Commonly used serialization standards include SEC1 or x.509. After serialization, a cryptographic hash is calculated on the resulting public key byte string. The hash function can be SHA-256, SHA-384, or the Chinese national cryptographic algorithm SM3, generating a fixed-length hash value. To further shorten the identifier length for broadcast communication, the hash value is usually truncated, for example, by extracting the first 32 or 64 bits as the final TempID. This TempID is a unique identifier that does not contain the device's MAC address, IMEI, serial number, or any user account information, ensuring anonymity of communication from the outset.

[0023] The device periodically sends this TempID in the form of a broadcast message via its wireless communication module (such as Bluetooth Low Energy (BLE) or Wi-Fi Direct). The structure of the broadcast message is carefully designed to explicitly omit all information elements that may be associated with the device's persistent identity.

[0024] When two devices enter each other's communication range and discover each other by listening to the TempID in the broadcast message, a secure key negotiation process is initiated. This process begins with the exchange of serialized temporary public keys between the two parties. To effectively defend against replay attacks, the sender simultaneously appends a randomly generated one-time random number (NonceA) when transmitting its serialized public key. Upon receiving the data packet, the receiver first checks its local one-time random number cache list. If NonceA does not exist in the list, the verification is successful, and device B stores NonceA in its cache and replies with its own public key and another one-time random number (NonceB) for device A to verify. If a duplicate one-time random number is detected, it is immediately determined to be a malicious replay attack, and the session is terminated.

[0025] After public key exchange and verification, both parties calculate the shared key based on the Elliptic Curve Diffie-Hellman (ECDH) algorithm. Device A uses its own temporary private key and Device B's temporary public key to calculate the shared secret point S. Device B performs a symmetric operation, using its temporary public and private keys to obtain the same point S. Encoding the coordinates of this point into a byte sequence yields the shared secret.

[0026] The key exchange is implemented using Curve 25519 elliptic curves. In each communication session, both parties generate a temporary key pair and share the secret calculation formula. Reasons for choosing Curve25519: high performance, security level equivalent to 128-bit, and mobile-friendly.

[0027] Subsequently, a session key used for communication encryption and authentication is derived from the shared secret using a key derivation function. This invention preferably employs an HMAC-based key derivation function. The process consists of two stages: extraction and expansion. In the extraction stage, the shared secret is used as the input key material, and the concatenated byte sequence of the serialized temporary public keys of both parties is used as the salt. A fixed-length pseudo-random key is calculated using HMAC. In the expansion stage, the pseudo-random key is expanded according to the required key length and number. Typically, two 256-bit session keys can be derived: one as the encryption key for encrypting communication data; and the other as the authentication key for generating message authentication codes. This derivation method ensures the uniqueness of the session key for each session.

[0028] After a secure session is established, communication data is protected using a derived session key. The sender uses the encryption key and an authentication encryption algorithm to encrypt the plaintext communication data, generating ciphertext. Simultaneously, the authentication key is used to calculate the message authentication code for the ciphertext. Upon receiving the data, the receiver first verifies the validity of the message authentication code using the same authentication key. If verification fails, it indicates that the data may have been tampered with, and the receiver will discard the data packet directly without performing any decryption, effectively preventing attacks. If verification succeeds, the encryption key is used to decrypt the ciphertext, obtaining the original communication data.

[0029] All session-related key materials, including temporary ECC key pairs, shared secrets, and derived session keys, are strictly restricted to being stored only in the volatile storage area of ​​the device's memory. The system sets a timeout timer, the duration of which can be configured according to the security sensitivity of the actual application scenario, typically between 5 and 30 minutes. Once the communication session ends naturally or the timer expires, the key management module immediately and automatically triggers a secure erasure procedure, completely deleting all related keys from memory. Combined with the aforementioned periodic temporary key update mechanism, this constitutes a defense-in-depth system, ensuring that even if long-term key materials are leaked at some point in the future, the content of historical communication sessions will not be decrypted, achieving perfect forward confidentiality.

[0030] The system implementation corresponding to the above method comprises several modules that work collaboratively. The temporary key generation module is responsible for periodically generating ECC key pairs. The identifier processing module performs public key serialization, hash calculation, and truncation to generate TempIDs. The broadcast module is responsible for sending TempID broadcast messages. The device discovery module scans and identifies the TempIDs of nearby devices. The key negotiation module manages public key exchange, replay protection verification, shared key calculation, and session key derivation. The encrypted transmission module uses session keys to perform data encryption, decryption, and integrity verification. The key management module is responsible for the lifecycle management of session keys and securely destroys all keys upon timeout or session termination. All these modules interact and exchange data through interfaces provided by the device's operating system, collectively achieving secure communication in an infrastructure-less environment.

[0031] This invention periodically generates temporary elliptic curve cryptography key pairs locally on the device and derives temporary identifiers without any persistent identity information for device discovery and communication. This approach severs the link between the communication session and the device's true identity at the source, preventing external observers from tracking the long-term behavior of the device or user through intercepted communication data. This effectively solves the problem of applications like Briar relying on pre-set social chains rather than true anonymity in temporary networking scenarios. It is particularly suitable for scenarios requiring high anonymity, such as temporary disaster relief teams and operations in sensitive areas.

[0032] The core mechanism of this invention lies in the temporary nature and short lifespan of session keys. All session keys used for encryption and authentication originate from one-time temporary key pairs and are stored only in the device's memory, automatically and completely destroyed after communication ends or a preset timeout period. Simultaneously, the device's temporary key pairs are updated periodically. This means that even if an attacker compromises the device and obtains its long-term key at some point in the future, they cannot decrypt the content of any historical communication session, thus fundamentally solving the security vulnerability of similar Bridgefy schemes, which lack perfect forward secrecy and are prone to theft of historical communications. Forward secrecy (PFS) strategy: Lifecycle of ephemeral session keys: It expires automatically after 15 minutes of inactivity; or it is destroyed immediately when the communication link is disconnected; it is not written to disk, but only stored in memory.

[0033] Destruction mechanism: The memory erase function overwrites the key area; after releasing the cache, it is randomly filled to prevent residue.

[0034] Optional digital signature mechanisms: Supports ECDSA signing based on session temporary ECC keys; calculates hashes and signs payloads encoded with CustomProto; enhances message auditability and anti-forgery; signature keys are destroyed synchronously with session keys to prevent cross-session association.

[0035] During the key negotiation phase, this invention introduces a one-time random number verification mechanism. When exchanging temporary public keys, both communicating parties must include a randomly generated one-time random number, which the receiver verifies by querying its local cache list. This design effectively identifies and rejects maliciously replayed data packets, preventing attackers from deceiving or interfering with communication by repeatedly sending old messages, thus enhancing communication reliability in security-sensitive scenarios such as military operations and rescue command. Completely independent of any fixed network infrastructure such as base stations or the internet, it can build point-to-point or mesh networks using only the device's built-in wireless communication module. This decentralized architecture ensures the availability of communication links even in extreme scenarios such as infrastructure paralysis due to natural disasters, lack of network coverage in remote areas, or infrastructure damage during military operations, overcoming the fundamental failure problem of traditional communication applications like Signal and WhatsApp in such environments.

[0036] This invention employs elliptic curve cryptography and a highly efficient authentication and encryption algorithm. While providing strong security, it requires less computation and shorter key length compared to traditional algorithms such as RSA, significantly reducing the device's computing resources and energy consumption. This makes it highly suitable for mobile portable devices where computing power, storage space, and battery power are typically limited. Furthermore, by dynamically adjusting encryption strength and intelligently managing data transmission frequency, resource utilization is further optimized, ensuring extended battery life for devices in emergency scenarios.

[0037] Example 2: The generation of TempID is the cornerstone of the entire scheme for achieving anonymous device discovery and secure communication. Its core formula is defined as: The following section will elaborate on the technical details, design principles, and collaborative working methods of each component in this formula.

[0038] Preprocessing of the temporary public key (PublicKey): The input PublicKey in the formula is the public key portion of a temporary elliptic curve cryptography (ECC) key pair that the communication device periodically generates locally. Before being substituted into the formula for calculation, the public key must be serialized, converting it from the native data representation of the elliptic curve cryptography algorithm into a standard, compact byte sequence. Commonly used serialization standards include SEC1 or x.509 standard formats. This serialization step ensures the uniformity of the data format and is a prerequisite for subsequent hash calculations.

[0039] Additionally, TempID generation uses a truncated hash value (e.g., SHA-256 with the first 8 bytes truncated) calculated from a temporary ECC public key as the broadcast identity. Broadcasting and discovery are achieved through periodic broadcasting of TempID via BLE or Wi-FiDirect for anonymous discovery. An ECDH handshake exchanges temporary public keys and calculates a shared secret. Session key derivation uses HKDF to derive K_enc / K_mac. Message encryption and encapsulation use a CustomProto structure to package messages and encrypt them using AES-GCM. Upon sending and acknowledgment, the receiver returns an encrypted ACK (containing the message UUID) to confirm delivery. Session destruction clears the temporary key, session cache, and memory upon timeout or disconnection.

[0040] CustomProto encoding / decoding layer: Used for structured encapsulation of encrypted messages. The format includes fields such as version number, type, session ID, timestamp, encrypted payload, and authentication token. Zlib or Brotli compression can be enabled to reduce message size. Compatible with JSON and binary encodings. Includes a MITM attack protection mechanism.

[0041] Introduce a challenge-response mechanism during the handshake phase: A sends a random challenge cA; B returns MAC_Ktmp(cA) and sends its own challenge cB; A returns MAC_Ktmp(cB) for two-way confirmation; Ktmp is a temporary confirmation key derived from the shared secret.

[0042] Optional temporary ECDSA signatures can be enabled to strengthen verification.

[0043] Applications and selection of cryptographic hash functions: The serialized public key byte string is then fed into the cryptographic hash function Hash() for processing. The core responsibility of this function is to map input data of arbitrary length to a fixed-length, seemingly random hash value, or message digest. To ensure security, the chosen hash function must satisfy several key properties: first, one-wayness, meaning it is computationally infeasible to deduce the original input data from the hash value, protecting the privacy of the temporary public key; second, collision resistance, meaning it is difficult to find two different inputs that produce the same hash value, ensuring that temporary public keys generated by different devices will produce different TempIDs; and third, avalanche effect, meaning that small changes in the input data can lead to significant changes in the output hash value.

[0044] In practice, the SHA-256 algorithm can be used, which produces a 256-bit hash value. Other options include SHA-384, SHA-3, or the SM3 algorithm approved by the State Cryptography Administration of China. The hash calculation process first padded the input data to meet the algorithm's length requirements, then processed by multiple rounds of compression functions to finally generate a fixed-length digest. The role and parameter selection of the truncation function (Truncate_x): The output of a cryptographic hash function is relatively long, and using it directly as a broadcast identifier would consume significant wireless resources. Therefore, it is necessary to extract the first x bits of the generated hash value using the truncation function Truncate_x() as the final temporary identifier TempID.

[0045] The value of parameter x needs to be carefully balanced between the uniqueness of the identifier and transmission efficiency. A larger x value results in more bits in the TempID, lowering the probability of collisions, but increasing broadcast overhead; a smaller x value results in higher transmission efficiency, but correspondingly increases the risk of collisions. Based on an assessment of device density and communication frequency in a specific application scenario, the typical range of x values ​​can be set from 16 bits to 64 bits. For example, in scenarios with moderate device density, a 32-bit (4-byte) TempID usually provides sufficient uniqueness for most temporary, short-term communication scenarios. In programming implementation, the truncation operation can be accomplished by slicing the byte array corresponding to the hash value.

[0046] Output and characteristics of the Temporary Identifier (TempID): The final generated TempID is a string of length x, typically represented as a hexadecimal string or a direct sequence of bytes. It is periodically broadcast within the communication scope as a temporary "digital identity" for the device. Since it originates entirely from the hash value of the temporary public key, and the temporary public key is unrelated to any persistent identifiers such as the device's MAC address, IMEI, serial number, or user account information, the TempID itself does not contain any persistent identity information, thus ensuring the anonymity of the communication initiator from the outset. Furthermore, because the temporary key pair is updated periodically, the TempID also changes frequently, further increasing the difficulty for external attackers to perform long-term tracking and correlation analysis of the device.

[0047] In summary, this temporary identifier generation formula, through the one-wayness and collision resistance of cryptographic hash functions, effectively hides the public key while ensuring a strong association between the temporary identifier and the temporary public key. The truncation function optimizes communication efficiency while maintaining security. This design together lays a solid foundation for secure and anonymous communication in environments without infrastructure.

[0048] Example 3: Regarding the key derivation function, although Example 1 explicitly uses an HMAC-based key derivation function, this is not the only option. The key derivation function can also be replaced with other algorithms that conform to cryptographic security standards, such as key derivation functions based on Chinese national cryptographic algorithms, such as KDF based on SM2, SM3, or SM4 algorithms, or key derivation schemes following the NIST standard SP 800-56C series. The key to choosing these alternatives is that they must be able to securely derive a session key with sufficient randomness and independence from the shared secret in essentially the same way.

[0049] Secondly, regarding the generation of temporary identifiers, the choice of hash function is not limited to SHA-256, SHA-384, or SM3. Any cryptographic hash function with strong collision resistance and one-wayness, such as the SHA-3 family of algorithms, or a lighter-weight hash function proven in certain specific application scenarios, can be used as an equivalent replacement. Similarly, the value of the truncation length x is a balance between collision probability and transmission efficiency. Those skilled in the art can adjust the specific value within this range according to the device density and broadcast packet size in the actual network environment without affecting the essence of the present invention.

[0050] Regarding encryption and authentication algorithms, apart from AES-GCM and ChaCha20-Poly1305, other Authentication Encryption (AEAD) schemes that can provide both confidentiality and authentication functions, such as AES-CCM, or schemes that use the traditional combination of "encryption followed by MAC", such as AES-CBC encryption combined with HMAC, should be considered equivalent technical means as long as they can ensure the confidentiality and integrity of the data.

[0051] In terms of structural design, the periodic update mechanism for temporary key pairs can dynamically adjust the update period T according to the device's computing power and security requirements. Furthermore, the one-time random number used to resist replay attacks is not limited to a pure random number generator; it can also be implemented using a counter-based pseudo-random number generator, as long as its uniqueness and unpredictability are guaranteed.

[0052] Finally, the wireless communication method is not limited to Bluetooth Low Energy (BLE) or Wi-Fi Direct. Any protocol that enables direct, peer-to-peer communication between devices, such as ZigBee or future new near-field communication protocols, as long as it can carry the broadcast of temporary identifiers and subsequent data exchange, is an equivalent alternative to this invention. In specific implementations, the functional modules can be integrated or separated at the software level according to the device's operating system and hardware resources. Such implementation optimizations and variations should also be included within the scope of protection of this invention.

[0053] Example 4: This invention discloses a secure communication system for devices without infrastructure based on temporary identities, enabling secure and anonymous direct communication in extreme environments where no network infrastructure is available. The system implements the methods disclosed in Embodiments 1 and 2 through the collaborative work of multiple software modules. The system architecture, the functions of each module, and their interaction flow will be described in detail below.

[0054] The system is deployed on each communication device, and its core lies in its modular software design, which systematizes the processes of temporary identity generation, secure key negotiation, and encrypted communication. The system mainly includes a temporary key generation module, an identifier processing module, a broadcast module, a device discovery module, a key negotiation module, an encrypted transmission module, and a key management module. These modules are typically implemented in software, running on the device's operating system, and achieve their functions by calling the cryptographic libraries provided by the operating system and wireless communication interfaces such as Bluetooth and Wi-Fi Direct drivers. All modules share a secure memory area for temporarily storing sensitive data such as keys, which is cleaned up by the key management module after communication ends, ensuring no persistent residue remains.

[0055] The temporary key generation module is responsible for periodically creating temporary elliptic curve cryptography (ECC) key pairs locally on the device. This module predetermines a key update cycle T and enhances randomness using the device's hardware random number generator or a quantum random number generator to ensure key unpredictability. Every cycle T, the module triggers a key generation operation, producing a new public and private key pair using standard elliptic curve cryptography. After generating a new key pair, the module immediately and securely destroys the key pair used in the previous cycle, ensuring no correlation between keys and laying the foundation for perfect forward secrecy. Furthermore, this module is responsible for serializing the generated temporary public key, converting it from the native mathematical format of the ECC algorithm to a standard byte sequence format. Common serialization standards include SEC1 or X.509, facilitating subsequent transmission and processing.

[0056] Key update cycle T control: TempID is updated every 30–60 seconds; Each update adds a random offset of ±5 seconds to prevent time fingerprinting; TempID does not contain permanent information such as the device's MAC address, IMEI, serial number, or account ID.

[0057] Broadcast load minimization: Broadcasts only include: TempID, protocol version number, and feature flags; There are no traceable fields.

[0058] Anonymous discovery mechanism: The receiver only caches the temporary identifier of the current session and does not save long-term identities or historical records.

[0059] The identifier processing module receives a serialized temporary public key byte stream from the temporary key generation module and generates a temporary identifier (TempID) for device discovery. This module strictly follows the formula: The calculation is performed. First, it processes the input public key byte stream using a cryptographically secure hash function to generate a fixed-length hash value. Then, it applies the truncation function `Truncate_x()` to extract the first `x` bits of the hash value as the final TempID. The value of `x` typically ranges from 16 to 64 bits; for example, 32 bits are chosen to balance collision probability and transmission efficiency. This TempID is a calculated anonymous identifier that does not contain any persistent identity information such as device MAC address, IMEI, serial number, or user account.

[0060] The broadcast module directly interfaces with the identifier processing module to obtain the generated TempID and encapsulates it in a specific broadcast message for periodic broadcasting via the device's wireless communication interface. The structure of the broadcast message is carefully designed, explicitly omitting all information elements that may be associated with the device's persistent identity, and only containing the necessary protocol header and the TempID itself, thereby maximizing the protection of device privacy.

[0061] The device discovery module continuously scans and listens for broadcast messages from surrounding devices. When it captures a TempID, it considers it to have discovered a potential communication peer. This module maintains a temporary list of discovered devices and initiates a discovery session for each discovered device. Once two devices have mutually recognized each other's TempIDs, the initial mutual discovery is complete, establishing the connection basis for subsequent key negotiation.

[0062] The key negotiation module is activated after the device discovery module confirms mutual discovery. This module manages the exchange of serialized temporary public keys between the two devices. To defend against replay attacks, this module requires the sender to append a randomly generated one-time nonce when coordinating the public key exchange. Upon receiving the data packet, the receiver checks its local nonce cache list for verification. If the nonce has not been used, the verification passes and it is added to the cache; if a duplicate is found, it is considered an attack and the session is terminated.

[0063] After the public key exchange and verification are successful, both parties calculate a shared secret using their respective temporary private keys and the received public key from the other party, based on the Elliptic Curve Diffie-Hellman (ECDH) algorithm. Subsequently, this module uses a key derivation function, such as the HMAC-based HKDF algorithm, to derive the actual session key from this shared secret. During the derivation process, the shared secret is used as the input key material, and the concatenated byte sequence of the serialized temporary public keys from both parties is used as the salt. Through two stages—extraction and expansion—at least two session keys can be derived, used for subsequent data encryption and message authentication, respectively.

[0064] The key derivation algorithm HKDF derives two independent keys from the shared secret S using HKDF. K_enc: Used for message encryption; K_mac: Used for message authentication.

[0065] HKDF input materials include: Salt value: salt = PubA‖PubB (concatenation of public keys at both ends); The information string info="UVChatView-Session"; The output length is 64 bytes (the first 32 bytes are used for AES, and the last 32 bytes are used for HMAC).

[0066] The encrypted transmission module begins operation after the session key is successfully derived. It uses the session key provided by the key negotiation module and employs an efficient authentication encryption algorithm to protect communication data. When sending data, the module uses the encryption session key to encrypt the plaintext data, generating ciphertext, and simultaneously uses the authentication session key to calculate the message authentication code for the ciphertext. When receiving data, it first verifies the validity of the message authentication code; if the verification is successful, it decrypts the ciphertext. If the message authentication code verification fails, the data packet is discarded directly, effectively preventing data tampering attacks.

[0067] The key management module, acting as the system's security guardian, is responsible for managing the entire lifecycle of session keys. It strictly restricts all session keys derived from the key negotiation module, as well as temporary private keys generated by the temporary key generation module, to temporary caching in the volatile storage area of ​​the device's memory. This module allows users to manually configure or use the system default value to set a timeout period, typically between 5 and 30 minutes. Once the communication session ends naturally, or the caching time exceeds the preset timeout, the module immediately and automatically triggers a secure erasure procedure, completely clearing all relevant keys from memory and destroying the cache. This dynamic management mechanism, combined with the periodic updates of temporary keys, constitutes a defense-in-depth system, ensuring forward confidentiality of communication.

[0068] It should be noted that the functionality of the above modules is not limited to a specific technical path. For example, the temporary key generation module can also use other cryptographically secure random number sources while ensuring periodic updates and strong randomness. The key derivation function, besides HKDF, can also be replaced with other algorithms that meet security standards, such as key derivation functions based on national cryptographic algorithms. The authentication encryption algorithm used by the encrypted transmission module can also be equivalently replaced by AES-CCM or other AEAD modes that provide confidentiality and authentication functions. These equivalent substitutions or variations are all based on the basic inventive concept of this invention and aim to achieve the same or similar technical effects; therefore, they should be considered to fall within the protection scope of this invention.

[0069] In summary, through the precise coordination and collaborative work of the above modules, this system has successfully achieved secure communication based on temporary identities in environments without infrastructure, providing reliable technical support for extreme scenarios such as disaster relief and military operations.

[0070] Obviously, the above-described embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. 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 or all of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention also intends to include these modifications and variations.

Claims

1. A method for secure communication without infrastructure based on temporary identity, characterized in that, Includes the following steps: S1. The communication device periodically generates temporary elliptic curve cryptography key pairs locally. The temporary elliptic curve cryptography key pairs are temporary public keys. The temporary public keys are used to perform cryptographic hashing to obtain temporary identifiers, and the temporary identifiers are broadcast wirelessly. The temporary identifier mentioned therein does not contain any persistent identity information; S2. After the two devices complete mutual discovery through the temporary identifier, they exchange their respective temporary public keys, calculate the shared key based on the elliptic curve algorithm, and derive one or more session keys from the shared key through the key derivation function. S3. Use the session key to encrypt and authenticate the transmission of communication data. The session key is only temporarily cached in the device memory. After the communication ends or the preset timeout period is exceeded, the key erasure and cache destruction operations are automatically performed.

2. The infrastructure-free secure communication method based on temporary identity as described in claim 1, characterized in that, In S1, the step of obtaining a temporary identifier by cryptographically hashing the temporary public key specifically includes: The temporary identifier Defined by the following formula: in, The public key in the temporary elliptic curve cryptography key pair; A cryptographically secure hash function is used to map input data of arbitrary length to a hash value of fixed length. This is a truncation function used to extract the first part of the hash value. This bit serves as the final temporary identifier; The generated temporary identifier has a length determined by definition.

3. The infrastructure-free secure communication method based on temporary identity as described in claim 2, characterized in that, Before calculating the temporary identifier, a key serialization step is included: first converting the public key into a standard byte sequence format, and then performing the hash processing.

4. The infrastructure-free secure communication method based on temporary identity as described in claim 2, characterized in that, The The function is any one of SHA-256, SHA-384, or SM3, and the length of the temporary identifier is... The value range is 16-64 bits.

5. A method for secure communication without infrastructure based on temporary identity as described in claim 2, characterized in that, In S2, the step of exchanging the serialized temporary public keys between the two parties also includes a replay protection verification process: when transmitting the serialized temporary public key, the sender synchronously appends a randomly generated one-time random number; After receiving the serialized temporary public key and the one-time random number, the receiver first queries the local one-time random number cache list. If the one-time random number does not exist in the cache list, the verification is successful, the one-time random number is added to the cache list, and the subsequent shared key calculation steps are executed. If the one-time random number already exists in the cache list, it is determined to be a duplicate request, and the temporary public key is rejected.

6. The infrastructure-free secure communication method based on temporary identity as described in claim 1, characterized in that, In S1, the step of the communication device periodically generating temporary elliptic curve cryptography key pairs specifically includes: The communication device has a preset key update period T. Every time interval T, the local elliptic curve cryptography algorithm is triggered to perform a key generation operation to obtain a new temporary elliptic curve cryptography key pair. At the same time, the temporary elliptic curve cryptography key pair generated in the previous cycle is automatically destroyed to ensure that the temporary public keys generated by the same communication device in different cycles are unrelated.

7. The infrastructure-free secure communication method based on temporary identity as described in claim 1, characterized in that, In S2, the steps of deriving one or more session keys from the shared key using the key derivation function specifically include: The key derivation function is HKDF. The shared key is used as the input key material of HKDF, and the concatenated byte sequence of the temporary public keys of both parties after serialization is used as the salt value. The extraction stage and expansion stage of HKDF are executed in sequence to derive at least two session keys, which are used for encryption and authentication operations of communication data, respectively.

8. The infrastructure-free secure communication method based on temporary identity as described in claim 1, characterized in that, In S3, the step of encrypting and authenticating the transmission of communication data using the session key specifically includes: The communication data is encrypted using the AES-GCM or ChaCha20-Poly1305 algorithm and the session key used for encryption operations is used to generate ciphertext data. At the same time, the session key used for authentication operations is used to generate a message authentication code (MAC) from the ciphertext data. After receiving the encrypted data and message authentication code, the receiver first verifies the validity of the message authentication code using the corresponding session key. If the verification is successful, the encrypted data is decrypted to obtain the original communication data; if the verification fails, the encrypted data is discarded directly. The preset timeout period ranges from 5 to 30 minutes.

9. A temporary identity-based, infrastructure-free secure communication system, characterized in that, Used to perform the infrastructure-free secure communication method based on temporary identity as described in any one of claims 1 to 8; The infrastructure-free secure communication system based on temporary identity includes: A temporary key generation module is used to periodically generate temporary elliptic curve cryptography key pairs locally on the communication device, and to perform key serialization processing on the temporary public key in the temporary elliptic curve cryptography key pair to obtain a temporary public key in standard byte sequence format. The identifier processing module is used to perform cryptographic hashing on the serialized temporary public key, and extract the first x bits of the hash value through a truncation function to obtain a temporary identifier, which does not contain any persistent identity information. The broadcast module is used to broadcast the temporary identifier wirelessly. The device discovery module is used to enable mutual discovery between two communication devices through the temporary identifier. The key negotiation module is used to control the two parties to exchange their respective serialized temporary public keys after the two communication devices discover each other, calculate the shared key based on the exchanged temporary public keys using the elliptic curve algorithm, and then derive one or more session keys from the shared key through the key derivation function. An encrypted transmission module is used to encrypt and authenticate the transmission of communication data using the session key; The key management module is used to temporarily cache the session key in the memory of the communication device, and automatically perform key erasure and cache destruction operations after the communication ends or after a preset timeout period.

10. A temporary identity-based, infrastructure-free secure communication system as described in claim 9, characterized in that, The temporary key generation module presets a key update period T. Every interval T, it triggers a local elliptic curve cryptography algorithm to generate a new temporary elliptic curve cryptography key pair and automatically destroys the key pair from the previous period. The temporary key generation module adopts the SEC1 or x.509 standard format to convert the temporary public key from the native data format of elliptic curve cryptography algorithm into a unified byte sequence; The identifier processing module calculates the temporary identifier using the following formula: in, This is a temporary public key that has been serialized. Use SHA-256, SHA-384 or SM3 hash functions. Extract the first 16-64 bits of the hash value as a temporary identifier; When the key negotiation module controls the two parties to exchange temporary public keys, it synchronously appends a randomly generated one-time random number. The receiver performs anti-replay verification by querying the local one-time random number cache list. Furthermore, the key negotiation module adopts the HKDF algorithm, using the shared key as the input key material and the concatenated byte sequence of the serialized temporary public keys of both parties as the salt value, to derive at least two session keys for encryption and authentication, respectively. The encrypted transmission module uses the AES-GCM or ChaCha20-Poly1305 algorithm, uses the session key to encrypt the communication data to obtain ciphertext, and generates a message authentication code; the receiver first verifies the validity of the MAC, and decrypts the ciphertext after the verification is successful, and discards the data if the verification fails. The key management module allows users to manually configure or set a preset timeout of 5-30 minutes using the system default value. It automatically erases the session key in memory and destroys the cache after communication ends or the timeout occurs.