Encryption transmission method of IPv6 device identifier
By using a block cipher algorithm and key update mechanism that supports 64-bit packet length, the problem of asymmetric cipher systems in IPv6 device identifier encryption transmission is solved, and the encryption identification is achieved every time the connection is achieved The uniqueness and security of the symbol.
Patent Information
- Application Number
- CN202411027107.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-29
AI Technical Summary
There are two main problems in the encryption transmission method of IPv6 device identifiers in the prior art: First, the asymmetric cryptographic system cannot meet the requirements of 64-bit encryption length; second, the fixed key encryption design is vulnerable to replay attacks and lacks independent security. Certification capability.
The block cipher algorithm that supports 64-bit packet length is used to encrypt and decrypt IPv6 device identifiers, and the encryption and decryption key is updated every time the terminal device is connected. The key wrapping or ECDH algorithm ensures that the encrypted identifiers are different each time. , prevent replay attacks.
The encryption transmission method suitable for IPv6 device identifiers is implemented, ensuring that the encrypted identifiers are unique and secure every time they are connected, eliminating the possibility of replay attacks, and improving the security of authentication.
Smart Images

Figure CN119051849A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the fields of computer network, cryptography and identity authentication, and in particular relates to an encryption transmission method for an IPv6 device identifier. Background Art
[0002] The IPv6 (Internet Protocol Version 6) device identifier uses the characteristics of the terminal device's last 64 bits of the IPv6 address (also known as the interface identifier) in the IPv6 stateless address autoconfiguration (SLAAC) scheme to be self-selected, and uses the terminal's IMSI code, PUF identifier and other attributes to generate a unique 64-bit identifier, which is used as the interface identifier of the terminal's IPv6 address. The attributes such as the IMSI code and PUF identifier are unique in themselves, so the IPv6 device identifier generated by these attributes is also unique, and is used for terminal device authentication in the aforementioned patent.
[0003] Since the IPv6 source address is located in the IPv6 header of the network layer during data packet transmission and will not be encrypted, in order to prevent the data packet from being monitored or intercepted, which may lead to the theft of the IPv6 device identifier and the misuse of the terminal identity, the original IPv6 device identifier needs to be encrypted and the encrypted identifier used as the interface identifier of the IPv6 address.
[0004] There are two main problems with the encryption transmission method of IPv6 device identifier in the prior art:
[0005] 1. Different from the general data encryption scenario, the encrypted IPv6 device identifier needs to be used as the interface identifier of the IPv6 address, and the length of the IPv6 interface identifier is fixed to 64 bits. The algorithm used to encrypt the plaintext IPv6 device identifier must meet two conditions: it can encrypt data with a length of 64 bits; the length of the encrypted ciphertext is the same as the length of the plaintext (both are 64 bits). However, the two mainstream asymmetric cryptographic systems are the RSA cryptographic algorithm and the ECC cryptographic algorithm. Although the commonly used configurations of the two (RSA-2048, RSA-4096, ECC-256, etc.) meet the requirement of being able to encrypt data with a length of 64 bits, the length of the encrypted ciphertext exceeds 64 bits (the ciphertext lengths of the above three configurations are 2048 bits, 4096 bits, and 256 bits, respectively). Therefore, although it is theoretically feasible to use an asymmetric cryptographic system to encrypt IPv6 device identifiers, in practice there is no suitable cryptographic system available.
[0006] 2. The prior art only proposes the need to encrypt the plaintext IPv6 device identifier, but does not mention whether it is necessary to regularly replace the key and change the encrypted IPv6 interface identifier. Currently, the products that use the IPv6 device identifier technology in the prior art also use a fixed key to encrypt the plaintext IPv6 identifier, and the encrypted identifier remains unchanged. However, this design will cause the identity authentication method based on the IPv6 device identifier to be broken by a replay attack. Since the IPv6 interface identifier in the network layer header will not be encrypted twice by the upper layer protocol, once the attacker hijacks the network connection between the terminal device using the IPv6 identifier and the device management platform, he can use the middleman identity to intercept the traffic, obtain the fixed IPv6 device identifier, and then set the same IPv6 device identifier for the fake device. When the fake device sends an authentication request to the device management platform, in the existing design, as long as the encrypted device identifier in the IPv6 address is the same, the identity authentication can be passed. Therefore, the fake device does not need to obtain the plaintext device identifier before encryption and can directly pass the IPv6 device identifier authentication with a replay attack. In the actual implementation projects, since the device management platform needs to first authenticate the IMSI code of the terminal device and query the relevant information of the IPv6 device identifier authentication verification through the IMSI code, and the SIM card itself has a strong security authentication mechanism, the IMSI code is difficult to forge, and the existing devices do not have serious risks. However, the above analysis shows that the current fixed key encrypted IPv6 device identifier design does not have independent security authentication capabilities and can be easily broken by mainstream attack methods.
[0007] The above two problems lead to two major defects in the existing technology:
[0008] First, there are no clear regulations on how to encrypt and decrypt identifiers, and the method of using asymmetric cryptographic systems to encrypt IPv6 device identifiers is not practical.
[0009] Secondly, the existing IPv6 device identifiers are used in applications with fixed keys to encrypt and decrypt identifiers, and the keys are changed irregularly, which means that this authentication method can be hacked by replay attacks and has low security. The existing encryption transmission scheme for IPv6 interface identifiers has obvious security risks. Summary of the invention
[0010] In view of the above deficiencies in the prior art, the purpose of the invention is to provide an encrypted transmission method for an IPv6 device identifier, thereby ensuring that the encrypted IPv6 interface identifier is different and independent of each other each time the device connects to a management platform, and that an attacker cannot obtain an IPv6 device identifier for future use through a previously intercepted IPv6 device identifier, thereby eliminating the possibility of a replay attack.
[0011] The present invention proposes an encrypted transmission method for an IPv6 device identifier, comprising:
[0012] S1, configure the cryptographic system used for encryption and decryption of the IPv6 device identifier to be a block cipher algorithm that supports a 64-bit block length;
[0013] S2, according to the block cipher algorithm configured in S1, further updating the encryption and decryption key of the IPv6 device identifier, so that the key is updated each time the terminal device connects to the device management platform, and the next time the terminal device connects to the platform, the new key is used to encrypt the plaintext IPv6 device identifier to generate a new ciphertext; when the updated key is independent and random, it is ensured that the encrypted IPv6 interface identifier is different and independent each time the device connects to the management platform;
[0014] The method of updating the encryption and decryption key of the IPv6 device identifier, and the method of updating the encryption and decryption key of the IPv6 device identifier using the key package, include:
[0015] (1) Determine the block cipher algorithm A0 used to encrypt the plaintext IPv6 device identifier and the block cipher algorithm A1 used for key wrapping;
[0016] (2) During initial configuration, the terminal and the platform pre-store the same encryption and decryption key k1 for algorithm A1 and the initial encryption and decryption key k1 for algorithm A0. 0,0 , where k1 and k 0,0 They should all be randomly generated and independent of each other;
[0017] For each terminal authentication, take the following actions:
[0018] (3) When the terminal connects to the platform for the nth time for identity authentication, it uses algorithm A0 and key k 0,n-1 Encrypt plaintext IPv6 identifiers using algorithm A0 and key k on the platform side 0,n-1 Decrypt the ciphertext IPv6 identifier for authentication; where n>=1;
[0019] (4) After the nth authentication succeeds, the terminal randomly generates a new key of length L for algorithm A0, denoted as k 0,n ;
[0020] (5) The terminal uses algorithm A1 and key k1 to encrypt k 0,n , the encrypted k 0,n Transmit to the platform; the platform uses algorithm A1 and key k1 to decrypt and obtain k 0,n And store to complete the key update.
[0021] Furthermore, in S1, the IPv6 device identifier is encrypted and decrypted using the TEA algorithm, the XTEA algorithm or the Blowfish algorithm.
[0022] Furthermore, when the TEA algorithm or the XTEA algorithm is used to encrypt the IPv6 device identifier, it is ensured that different keys generated are independent of each other and have no correlation.
[0023] Furthermore, in the S2, for the method of updating the IPv6 device identifier encryption and decryption key using key wrapping, the packet length of the block cipher algorithm used for key wrapping is not less than the key length to be encrypted and transmitted.
[0024] Furthermore, a block cipher algorithm with a block length of 128 bits is selected for key wrapping of TEA and XTEA algorithms;
[0025] Select a block cipher with a block length of 128 or 256 bits for key wrapping in the Blowfish algorithm;
[0026] For block cipher algorithms with a packet length of 128 bits, select AES-128 or SM4.
[0027] For a block cipher algorithm with a block length of 256 bits, select the AES-256 algorithm.
[0028] Furthermore, in the S2, in the method of updating the IPv6 device identifier encryption and decryption key using key wrapping, the working mode of the selected block cipher algorithm is configured as CTR mode or ECB mode.
[0029] Furthermore, in S2, the method of updating the encryption and decryption key of the IPv6 device identifier further includes: using the ECDH algorithm to update the encryption and decryption key of the IPv6 device identifier, including the following steps:
[0030] (1) Determine the block cipher algorithm A0 for encrypting the plaintext IPv6 device identifier and the elliptic curve parameter P for the ECDH algorithm, wherein a set of elliptic curve parameters P with a prime field size greater than L and secure is determined, and the size of the prime field in the parameter P is denoted as L p ;
[0031] (2) The terminal and the platform store the same elliptic curve parameter P and the same initial encryption and decryption key k for algorithm A0 during initial configuration. 0,0 , where the initial key k 0,0 is randomly generated;
[0032] For each terminal authentication, take the following actions:
[0033] (3) When the terminal connects to the platform for the nth time for identity authentication, it uses algorithm A0 and key k 0,n-1 Encrypt plaintext IPv6 identifiers using algorithm A0 and key k on the platform side 0,n-1 Decrypt the ciphertext IPv6 identifier for authentication; where n>=1;
[0034] (4) After the nth authentication is successful, the terminal randomly generates a public key R based on the parameter P n,1 and private key r n,1 , the platform randomly generates a public key R based on the parameter P n,2 and private key r n,2 ;
[0035] (5) After the public key-private key pair is generated, the terminal and the platform perform ECDH key exchange. After the key exchange, each obtains a key of length L. p The key K n,1 , K n,2 , where K n,1 =K n,2 , denoted as K n ;
[0036] (6) Terminal and platform end take K n The first L bits of , as the key k for the next encryption and decryption of algorithm A0 0,n , complete the key update.
[0037] Furthermore, in S2, in the method of updating the IPv6 device identifier encryption and decryption key using the ECDH algorithm, the elliptic curve parameter P adopts the elliptic curve parameter of the SM2 algorithm or the elliptic curve parameter of the Curve25519 algorithm.
[0038] Furthermore, in S2, for the method of updating the IPv6 device identifier encryption and decryption key using key wrapping and the method of updating the IPv6 device identifier encryption and decryption key using the ECDH algorithm, the data security protocol part of the protocol used when the terminal communicates with the platform is enabled, a secure session is established between the terminal and the platform, and each time a new key is generated, it is ensured that the generated keys are random and independent of each other.
[0039] Furthermore, in S2, for the method of updating the IPv6 device identifier encryption and decryption key using key wrapping and the method of updating the IPv6 device identifier encryption and decryption key using the ECDH algorithm, the encryption and decryption key of the plaintext IPv6 device identifier is updated each time the terminal device is authenticated, so that the encrypted IPv6 identifier transmitted on the Internet is different each time.
[0040] The beneficial effects of the present invention are as follows:
[0041] (1) It clarifies the types of cryptographic systems that are suitable for encrypting plaintext IPv6 device identifiers, solving the problem that the existing asymmetric cryptographic systems are not suitable for encrypting IPv6 identifiers.
[0042] (2) A method for updating the encryption and decryption keys of IPv6 device identifiers is proposed. This method can update the keys each time the terminal device connects to the device management platform. The next time the terminal device connects to the platform, the new key is used to encrypt the plaintext IPv6 device identifier to generate a new ciphertext. When the updated key is independent and random, this method can ensure that the encrypted IPv6 interface identifiers are different and independent of each other each time the device connects to the management platform. Attackers cannot obtain the IPv6 device identifiers used in the future through the previously intercepted IPv6 device identifiers, thereby eliminating the possibility of replay attacks.
[0043] (3) A block cipher algorithm with a packet length of 64 bits is used to encrypt and decrypt the IPv6 device identifier, which solves the problem that the encryption and decryption methods of the IPv6 device identifier in the prior art are unclear and the proposed method of using an asymmetric cryptographic system to encrypt and decrypt the IPv6 device identifier is not practical. It is determined that the most suitable method for encrypting and decrypting the IPv6 device identifier is a block cipher algorithm with a packet length of 64 bits.
[0044] (4) Two methods of updating the encryption and decryption keys of the IPv6 device identifier include: using key wrapping to update the encryption and decryption keys of the IPv6 device identifier; using the ECDH algorithm to update the encryption and decryption keys of the IPv6 device identifier. This method solves the problem that the method of using a fixed key to encrypt and decrypt the IPv6 device identifier in the prior art can be hacked by replay attacks. By updating the key, the IPv6 device identifier changes dynamically each time the terminal initiates authentication, and cannot be hacked by replay attacks. The encryption and decryption keys can be safely updated to prevent replay attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0046] Figure 1 A flow chart of an encrypted transmission method of an IPv6 device identifier according to an embodiment of the present invention;
[0047] Figure 2 A flowchart of using key wrapping to update the encryption and decryption key of an IPv6 device identifier according to an embodiment of the present invention;
[0048] Figure 3The ECDH algorithm is used to update the IPv6 device identifier encryption and decryption key in an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0050] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0051] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0052] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.
[0053] The technical terms involved in the present invention are explained below:
[0054] PUF (Physical Unclonable Function): A PUF is a hardware function implementation circuit that relies on chip characteristics. It is unique and random. It extracts the process parameter deviations that are inevitably introduced during the chip manufacturing process to achieve a unique correspondence between the challenge signal and the response signal.
[0055] IMSI (International Mobile Subscriber Identity): an identification code used to distinguish different users in a cellular network and is unique in all international cellular networks.
[0056] IPv6 device identifier: A unique 64-bit IPv6 port identifier generated by a terminal device using a physical unclonable function, an international mobile subscriber identity number, device type, and other information.
[0057] Symmetric encryption system: A cryptographic system based on a symmetric encryption algorithm that uses the same key for encryption and decryption.
[0058] Asymmetric encryption system: also known as public key encryption system, a cryptographic system based on asymmetric encryption algorithms, using a set of different public keys and private keys, using the public key to encrypt plaintext and the private key to decrypt ciphertext.
[0059] Block cipher: also known as block cipher, a symmetric encryption algorithm that divides plaintext into fixed-length blocks for encryption and decryption. The SM4 algorithm in the national encryption algorithm is a block cipher algorithm.
[0060] Key wrap: also known as key encapsulation, it uses a symmetric cryptographic system to encrypt keys and can be used for encrypted transmission and exchange of keys.
[0061] ECDH (Elliptic Curve Diffie-Hellman): A Diffie-Hellman key exchange algorithm based on the elliptic curve asymmetric cryptographic system. The SM2 algorithm in the national cryptographic algorithm is an asymmetric cryptographic algorithm based on elliptic curves and can be used for ECDH.
[0062] TLS (Transport Layer Security): An Internet security protocol used in the transport layer of the TCP / IP protocol stack. It is widely used in various network security fields such as HTTPS and network identity authentication.
[0063] In order to solve the problems existing in the prior art, the encrypted transmission method of the IPv6 device identifier in the embodiment of the present invention proposes the following two technical solutions:
[0064] 1. Use a block cipher algorithm with a packet length of 64 bits to encrypt and decrypt IPv6 device identifiers
[0065] 2. There are two ways to update the encryption and decryption keys of IPv6 device identifiers:
[0066] (1) Use key wrapping to update the IPv6 device identifier encryption and decryption keys;
[0067] (2) Use the ECDH algorithm to update the IPv6 device identifier encryption and decryption keys.
[0068] Combine the following Figures 1 to 3 The encrypted transmission method of the IPv6 device identifier of the present invention is described.
[0069] like Figure 1 As shown, the encrypted transmission method of the IPv6 device identifier of the embodiment of the present invention includes the following steps:
[0070] S1, configure the cryptographic system used for encryption and decryption of the IPv6 device identifier to be a block cipher algorithm that supports a 64-bit block length.
[0071] Specifically, the fixed 64-bit length of IPv6 device identifiers requires the cryptographic system to meet two conditions:
[0072] (1) Can encrypt data with a length of 64 bits;
[0073] (2) The length of the encrypted ciphertext is the same as the length of the plaintext (both are 64 bits).
[0074] Taking these two requirements into consideration, the present invention concludes that the most suitable cryptographic system for encryption and decryption of IPv6 device identifiers is a block cipher algorithm that supports a 64-bit block length.
[0075] Among the mainstream cryptographic systems, asymmetric cryptographic systems do not meet the second condition. Regardless of the length of the plaintext, the length of the ciphertext is always a fixed value and is greater than 64 bits. Symmetric cryptographic systems generally meet the second condition, so the second condition limits the applicable cryptographic systems to symmetric cryptographic systems. More specifically, symmetric cryptographic systems can be divided into two categories: block ciphers and stream ciphers. Block cipher systems use fixed keys to encrypt and decrypt plaintext of fixed length; stream cipher systems treat plaintext as a continuous data stream, use a fixed key to generate a continuous key stream, and use the key stream to encrypt the plaintext data stream. Since the length of the IPv6 device identifier is fixed to 64 bits, it does not need to be regarded as a data stream, and only needs to be encrypted once. The block cipher system is more suitable for the encryption of the IPv6 device identifier than the stream cipher system. In summary, the second condition shows that the block cipher system in the symmetric cryptographic system should be used to encrypt the IPv6 device identifier.
[0076] Mainstream block cipher algorithms include TEA, XTEA, AES, SM4, etc. Although AES and SM4 are more secure than TEA and XTEA, their minimum block length is 128 bits, and their minimum ciphertext length is also 128 bits, which does not meet the first condition. Therefore, the present invention proposes that block cipher algorithms such as TEA and XTEA that support 64-bit block length should be used for encryption and decryption of IPv6 device identifiers.
[0077] In addition, the Blowfish algorithm is also a block cipher algorithm that supports a 64-bit packet length. However, the Blowfish algorithm requires a long initialization operation each time the key is changed, which is not suitable for the scenario in which the key needs to be changed each time the terminal device initiates authentication in the present invention. However, the key can be selected up to 448 bits, and the upper limit of security is relatively high. The XTEA algorithm is an improvement on the TEA algorithm and is more secure than the TEA algorithm. Both use 128-bit keys. Therefore, the XTEA algorithm is recommended, and the Blowfish algorithm can be considered when the terminal performance is strong and the algorithm speed requirement is not high.
[0078] In summary, in the embodiments of the present invention, the TEA algorithm, the XTEA algorithm or the Blowfish algorithm is used to encrypt and decrypt the IPv6 device identifier.
[0079] When the TEA algorithm and the XTEA algorithm use different keys for encryption, if the generated keys are not independent of each other, the security of the algorithm will be reduced. Therefore, if the TEA algorithm or the XTEA algorithm is used to encrypt the IPv6 device identifier, it is necessary to ensure that the generated keys are independent of each other and have no correlation.
[0080] In addition, when selecting the working mode of the block cipher algorithm, since the same key will only be used to encrypt a 64-bit IPv6 device identifier once, there is no need to worry about the problem of the same key encrypting a large amount of data and making it easy to be hacked. It is recommended to directly use the CTR mode or ECB mode for encryption and decryption.
[0081] S2, according to the block cipher algorithm configured in S1, further updates the encryption and decryption key of the IPv6 device identifier, so that the key is updated each time the terminal device connects to the device management platform. The next time the terminal device connects to the platform, the new key is used to encrypt the plaintext IPv6 device identifier to generate a new ciphertext; when the updated key is independent and random, it is ensured that the encrypted IPv6 interface identifier is different and independent of each other each time the device connects to the management platform.
[0082] Specifically, the method of encrypting and decrypting IPv6 device identifiers using fixed keys in the prior art can be broken by replay attacks. In order to prevent the IPv6 device identifier authentication from being subjected to replay attacks, it is necessary to update the encryption and decryption keys of the plaintext IPv6 device identifier each time the terminal device is authenticated, so that the encrypted IPv6 identifier transmitted on the Internet is different each time. The prior art does not mention the need for key updates and how to update the keys. Based on the best practices of the TLS security protocol and the relevant content of the national secret algorithm, the present invention proposes the following two secure methods suitable for updating the encryption and decryption keys of IPv6 device identifiers. For both methods, it is first necessary to determine the block cipher algorithm used to encrypt the plaintext IPv6 device identifier (denoted as algorithm A0) and the key length L of this algorithm, in bits.
[0083] Based on the best practices of the TLS security protocol and the national encryption algorithm, two secure methods suitable for updating the encryption and decryption keys of IPv6 device identifiers are proposed:
[0084] Method 1: Update IPv6 device identifier encryption and decryption keys using key wrapping
[0085] The key wrapping algorithm uses a symmetric encryption algorithm to protect the key. The symmetric encryption algorithm has a smaller amount of computation than the asymmetric encryption algorithm and a faster calculation speed. Therefore, terminals with weaker computing power or devices that need to frequently establish connections to the platform and update keys are more suitable for using the key wrapping algorithm to update the encryption and decryption keys of the IPv6 micro-identifier (i.e., IPv6 device identifier).
[0086] Method 2: Use the ECDH algorithm to update the IPv6 device identifier encryption and decryption key
[0087] The ECDH algorithm uses the elliptic curve asymmetric encryption algorithm to protect the key. Devices with strong computing power or devices that connect to the platform and update keys infrequently are more suitable for using the ECDH algorithm to update the encryption and decryption keys of IPv6 micro-identifiers.
[0088] In addition, the key wrapping algorithm requires the pre-configuration of the shared key between the terminal and the platform before use, while the ECDH algorithm does not require the pre-configuration of the shared key and can directly generate new IPv6 micro-identity encryption and decryption keys. Therefore, if you need to simplify the configuration information of the terminal and the platform, it is more suitable to use the ECDH algorithm to update the encryption and decryption keys of the IPv6 micro-identity.
[0089] The specific steps of the two encryption and decryption key methods are described below.
[0090] like Figure 2 As shown, the method of updating the encryption and decryption key of the IPv6 device identifier using key wrapping includes the following steps:
[0091] (1) Determine a block cipher algorithm A0 for encrypting the plaintext IPv6 device identifier and a block cipher algorithm A1 for key wrapping. Determine a block cipher algorithm that supports a block length of L, denoted as algorithm A1.
[0092] (2) During initial configuration, the terminal and the platform pre-store the same encryption and decryption key k1 for algorithm A1 and the initial encryption and decryption key k1 for algorithm A0. 0,0 , where k1 and k 0,0 They should all be randomly generated and independent of each other;
[0093] For each terminal authentication, take the following actions:
[0094] (3) When the terminal connects to the platform for the nth time for identity authentication, it uses algorithm A0 and key k 0,n-1 Encrypt plaintext IPv6 identifiers using algorithm A0 and key k on the platform side 0,n-1 Decrypt the ciphertext IPv6 identifier for authentication; where n>=1;
[0095] (4) After the nth authentication succeeds, the terminal randomly generates a new key of length L for algorithm A0, denoted as k 0,n ;
[0096] (5) The terminal uses algorithm A1 and key k1 to encrypt k 0,n , the encrypted k 0,n Transmit to the platform; the platform uses algorithm A1 and key k1 to decrypt and obtain k 0,n And store to complete the key update.
[0097] In an embodiment of the present invention, in a method of updating an IPv6 device identifier encryption and decryption key using key wrapping, the working mode of the selected block cipher algorithm is configured as a CTR mode or an ECB mode.
[0098] (1) CTR mode
[0099] For all preferred block cipher algorithms, it is recommended to use the more secure counter (CTR) working mode.
[0100] (2)ECB mode
[0101] If the non-volatile storage resources of the terminal device are not easy to access and it is not convenient to store the state of the CTR mode for a long time, the ECB working mode can be used. However, it is necessary to ensure that the random key generated each time is not repeated to prevent the encryption algorithm from being cracked due to vulnerabilities in the ECB mode.
[0102] Specifically, in the method of using key wrapping to update the encryption and decryption keys of the IPv6 device identifier, a block cipher algorithm needs to be selected for encryption and decryption in the key wrapping. For the algorithms mentioned in S1, the key length of the TEA and XTEA algorithms is 128 bits, and the key length of the Blowfish algorithm is 32-448 bits. The block length of the block cipher algorithm used for key wrapping needs to be no less than the key length of the encrypted transmission. Therefore, it is recommended to select a block cipher algorithm with a block length of 128 bits for the key wrapping of the TEA and XTEA algorithms, and a block cipher algorithm with a block length of 128 bits or 256 bits for the key wrapping of the Blowfish algorithm. For block cipher algorithms with a block length of 128 bits, it is recommended to give priority to the AES-128 algorithm or the SM4 algorithm. For block cipher algorithms with a block length of 256 bits, it is recommended to give priority to the AES-256 algorithm.
[0103] like Figure 3 As shown, using the ECDH algorithm to update the IPv6 device identifier encryption and decryption key includes the following steps:
[0104] (1) Determine the block cipher algorithm A0 for encrypting the plaintext IPv6 device identifier and the elliptic curve parameter P for the ECDH algorithm, wherein a set of elliptic curve parameters P with a prime field size greater than L and secure is determined, and the size of the prime field in the parameter P is denoted as L p , the unit is bit.
[0105] (2) The terminal and the platform store the same elliptic curve parameter P and the same initial encryption and decryption key k for algorithm A0 during initial configuration. 0,0 , where the initial key k 0,0 is randomly generated;
[0106] For each terminal authentication, take the following actions:
[0107] (3) When the terminal connects to the platform for the nth time for identity authentication, it uses algorithm A0 and key k 0,n-1 Encrypt plaintext IPv6 identifiers using algorithm A0 and key k on the platform side 0,n-1 Decrypt the ciphertext IPv6 identifier for authentication; where n>=1.
[0108] (4) After the nth authentication is successful, the terminal randomly generates a public key-private key pair (public key R n,1 and private key r n,1 ), the platform randomly generates a set of public key-private key pairs (public key R n,2 and private key r n,2 ).
[0109] (5) After the public key-private key pair is generated, the terminal and the platform perform ECDH key exchange. After the key exchange, each obtains a key of length L. p The key K n,1 , K n,2 Among them, the ECDH algorithm ensures that K n,1 =K n,2 , denoted as K n .
[0110] (6) Terminal and platform end take K n The first L bits of , as the key k for the next encryption and decryption of algorithm A0 0,n , complete the key update.
[0111] Regarding the ECDH algorithm to update the encryption and decryption key of the IPv6 device identifier, the present invention selects the elliptic curve algorithm for key exchange in the asymmetric cryptographic system, mainly for the following reasons:
[0112] (1) Elliptic curve algorithms are more secure than other asymmetric cryptographic algorithms such as RSA at the same key length. They can achieve high security with a shorter key length. The security of a 256-bit elliptic curve algorithm is equivalent to that of a 128-bit AES algorithm, while an RSA algorithm of equal security requires a 3072-bit key.
[0113] (2) Due to the short key length, the storage space of IoT terminal devices is saved.
[0114] (3) The complexity of the elliptic curve algorithm is lower than that of other asymmetric algorithms and is more suitable for terminal devices with low performance.
[0115] In an embodiment of the present invention, when using the ECDH algorithm to update the IPv6 device identifier encryption and decryption key, the elliptic curve parameter P adopts the elliptic curve parameter of the SM2 algorithm in the national secret algorithm or the elliptic curve parameter of Curve 25519 (Curve25519) with higher computational efficiency.
[0116] It should be noted that for the method of updating the IPv6 device identifier encryption and decryption key using key wrapping and the method of updating the IPv6 device identifier encryption and decryption key using the ECDH algorithm, both methods enable the data security protocol part of the protocol used when the terminal communicates with the platform, establish a secure session between the terminal and the platform, and each time a new key is generated, ensure that the generated keys are random and independent of each other.
[0117] Specifically, both key update methods can only prevent the exchanged keys from being obtained by middlemen, but they do not have the functions of identity authentication and data integrity assurance. Directly transmitting key update data in plain text may make the information tampered by middlemen. In actual use, key wrapping or ECDH key exchange data cannot be sent in plain text. The data security protocol part of the protocol used when the terminal communicates with the platform should still be enabled to establish a secure session between the terminal and the platform to ensure that the data transmission itself is secure, authentic, and not tampered with. For example, when the IoT device terminal uses the LwM2M protocol to communicate with the platform, the DTLS or OSCORE security protocol supported by the LwM2M protocol should be enabled.
[0118] In addition, for the method of updating the encryption and decryption keys of the IPv6 device identifier using key wrapping and the method of updating the encryption and decryption keys of the IPv6 device identifier using the ECDH algorithm, these two methods update the encryption and decryption keys of the plaintext IPv6 device identifier each time the terminal device is authenticated, so that the encrypted IPv6 identifier transmitted on the Internet is different each time.
[0119] Each time a new key is generated, it is necessary to ensure that the generated keys are random and independent of each other, and it is impossible to predict the keys to be generated in the future by using the past keys. This is mentioned in the specific embodiment of invention point 1. There are two main random number methods that can ensure that the generated keys are random and independent of each other:
[0120] (1) Generate all keys using a hardware-based true random number generation algorithm.
[0121] (2) Use a hardware-based true random number generation algorithm to generate a true random seed, and then use a cryptographically secure pseudo-random number generation algorithm (CSPRNG) to generate a difficult-to-crack pseudo-random number sequence from the true random seed as the key.
[0122] Specifically, the commonly used hardware for generating true random numbers mainly includes:
[0123] (1) The CPU's built-in true random number generator. For example, the instruction set of the x86 / x86_64 architecture includes true random number generation instructions. Intel and AMD also include dedicated hardware for implementing true random number generation instructions in their CPUs. The TrustZone security technology of the ARM architecture also includes dedicated hardware for true random number generation.
[0124] (2) External TPM security chip. TPM chips are widely used in computers with x86 and x86_64 architectures, providing a set of standardized hardware security interfaces, including hardware true random number generation.
[0125] (3) Physically Unclonable Function (PUF) Chip. For example, a PUF chip based on SRAM can read the initial value determined by the random physical properties when the SRAM is initialized, and generate a true random number based on this value. In addition, most PUF chips also have the functions of random key generation, storage and management.
[0126] Commonly used cryptographically secure pseudo-random number generation algorithms (CSPRNG) mainly include:
[0127] (1) CTR_DRBG random number generation algorithm based on the block cipher algorithm CTR operation mode. Both AES algorithm and SM4 algorithm can be used for this generation algorithm.
[0128] (2) Random number generation algorithm based on stream cipher algorithm.
[0129] (3) Hash_DRBG random number generation algorithm based on cryptographically secure hash functions (also known as hash algorithms).
[0130] (4) HMAC_DRBG random number generation algorithm based on HMAC (Hash-based Message Authentication Code) algorithm.
[0131] In addition, there are comprehensive pseudo-random number generation algorithms that combine the generation and selection of CSPRNG and true random number seeds, mainly including the Yarrow algorithm and the Fortuna algorithm.
[0132] In summary, the encrypted transmission method of the IPv6 device identifier proposed in the present invention can be applied to the encrypted identity authentication of the Internet of Things terminal devices.
[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for encrypting and transmitting an IPv6 device identifier. It is characterized in that include: S1, configure the cryptographic system used for encryption and decryption of the IPv6 device identifier to be a block cipher algorithm that supports a 64-bit block length; S2, according to the block cipher algorithm configured in S1, further updating the encryption and decryption key of the IPv6 device identifier, so that the key is updated each time the terminal device connects to the device management platform, and the next time the terminal device connects to the platform, the new key is used to encrypt the plaintext IPv6 device identifier to generate a new ciphertext; when the updated key is independent and random, it is ensured that the encrypted IPv6 interface identifier is different and independent each time the device connects to the management platform; The method of updating the encryption and decryption key of the IPv6 device identifier, and the method of updating the encryption and decryption key of the IPv6 device identifier using the key package, include: (1) Determine the block cipher algorithm A used to encrypt the plaintext IPv6 device identifier 0 and the block cipher algorithm A used for key wrapping 1 ; (2) When the terminal and the platform are initially configured, they pre-store the same 1 The encryption and decryption key k 1 and for algorithm A 0 The initial encryption and decryption key k 0,0 , where k 1 and k 0,0 They should all be randomly generated and independent of each other; For each terminal authentication, take the following actions: (3) When the terminal connects to the platform for the nth time for identity authentication, algorithm A is used 0 and key k 0,n-1 Encrypt plaintext IPv6 identifiers, using algorithm A on the platform side 0 and key k 0,n-1 Decrypt the ciphertext IPv6 identifier for authentication; where n>=1; (4) After the nth authentication is successful, the terminal randomly generates a new length L for algorithm A 0 The key is denoted as k 0,n ; (5) Terminal uses algorithm A 1 and key k 1 Encryption k 0,n , the encrypted k 0,n Transmit to the platform; the platform uses algorithm A 1 and key k 1 Decryption, get k 0,n And store to complete the key update.
2. The method for encrypting and transmitting an IPv6 device identifier according to claim 1, It is characterized in that In S1, the IPv6 device identifier is encrypted and decrypted using the TEA algorithm, the XTEA algorithm or the Blowfish algorithm.
3. The method for encrypting and transmitting an IPv6 device identifier according to claim 2, It is characterized in that When using the TEA algorithm or the XTEA algorithm to encrypt the IPv6 device identifier, ensure that the different keys generated are independent of each other and have no correlation.
4. The method for encrypting and transmitting an IPv6 device identifier according to claim 1, It is characterized in that In the S2, in the method of updating the IPv6 device identifier encryption and decryption key using key wrapping, the packet length of the block cipher algorithm used for key wrapping is not less than the key length to be encrypted and transmitted.
5. The method for encrypting and transmitting an IPv6 device identifier according to claim 4, It is characterized in that Select a block cipher algorithm with a block length of 128 bits for key wrapping of TEA and XTEA algorithms; Select a block cipher with a block length of 128 or 256 bits for key wrapping in the Blowfish algorithm; For block cipher algorithms with a packet length of 128 bits, select AES-128 or SM4. For a block cipher algorithm with a block length of 256 bits, select the AES-256 algorithm.
6. The method for encrypting and transmitting an IPv6 device identifier according to claim 1, It is characterized in that In the S2, in the method of updating the IPv6 device identifier encryption and decryption key using key wrapping, the working mode of the selected block cipher algorithm is configured as CTR mode or ECB mode.
7. The method for encrypting and transmitting an IPv6 device identifier according to claim 1, It is characterized in that In S2, the method of updating the encryption and decryption key of the IPv6 device identifier further includes: using the ECDH algorithm to update the encryption and decryption key of the IPv6 device identifier, including the following steps: (1) Determine the block cipher algorithm A used to encrypt the plaintext IPv6 device identifier 0 And the elliptic curve parameter P used for the ECDH algorithm, where a set of prime field size greater than L and secure elliptic curve parameters P is determined, and the size of the prime field in this parameter P is recorded as L p ; (2) The terminal and the platform store the same elliptic curve parameters P and the same algorithm A in advance during initial configuration. 0 The initial encryption and decryption key k 0,0 , where the initial key k 0,0 is randomly generated; For each terminal authentication, take the following actions: (3) When the terminal connects to the platform for the nth time for identity authentication, algorithm A is used 0 and key k 0,n-1 Encrypt plaintext IPv6 identifiers, using algorithm A on the platform side 0 and key k 0,n-1 Decrypt the ciphertext IPv6 identifier for authentication; where n>=1; (4) After the nth authentication is successful, the terminal randomly generates a public key R based on the parameter P n,1 and private key r n,1 , the platform randomly generates a public key R based on the parameter P n,2 and private key r n,2 ; (5) After the public key-private key pair is generated, the terminal and the platform perform ECDH key exchange. After the key exchange, each obtains a key of length L. p The key K n,1 , K n,2 , where K n,1 =K n,2 , denoted as K n ; (6) Terminal and platform end take K n The first L bits of algorithm A 0 The key k for the next encryption and decryption 0,n , complete the key update.
8. The method for encrypting and transmitting an IPv6 device identifier according to claim 7, It is characterized in that In S2, in the method of updating the IPv6 device identifier encryption and decryption key using the ECDH algorithm, the elliptic curve parameter P adopts the elliptic curve parameter of the SM2 algorithm or the elliptic curve parameter of the Curve25519 algorithm.
9. The method for encrypting and transmitting an IPv6 device identifier according to claim 7, It is characterized in that In S2, for both the method of updating the IPv6 device identifier encryption and decryption key using key wrapping and the method of updating the IPv6 device identifier encryption and decryption key using the ECDH algorithm, the data security protocol part of the protocol used when the terminal communicates with the platform is enabled, a secure session is established between the terminal and the platform, and each time a new key is generated, it is ensured that the generated keys are random and independent of each other.
10. The method for encrypting and transmitting an IPv6 device identifier according to claim 7, It is characterized in that In S2, for the method of updating the IPv6 device identifier encryption and decryption key using key wrapping and the method of updating the IPv6 device identifier encryption and decryption key using the ECDH algorithm, the encryption and decryption key of the plaintext IPv6 device identifier is updated each time the terminal device is authenticated, so that the encrypted IPv6 identifier transmitted on the Internet is different each time.
