CN114745114A - Key agreement method, device, equipment and medium based on password derivation - Google Patents

Key agreement method, device, equipment and medium based on password derivation Download PDF

Info

Publication number
CN114745114A
CN114745114A CN202210438132.7A CN202210438132A CN114745114A CN 114745114 A CN114745114 A CN 114745114A CN 202210438132 A CN202210438132 A CN 202210438132A CN 114745114 A CN114745114 A CN 114745114A
Authority
CN
China
Prior art keywords
bit string
authentication
time
varying parameter
session key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210438132.7A
Other languages
Chinese (zh)
Other versions
CN114745114B (en
Inventor
贺礼云
张国栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Ningsi Software Co ltd
Original Assignee
Sichuan Ningsi Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Ningsi Software Co ltd filed Critical Sichuan Ningsi Software Co ltd
Priority to CN202210438132.7A priority Critical patent/CN114745114B/en
Publication of CN114745114A publication Critical patent/CN114745114A/en
Application granted granted Critical
Publication of CN114745114B publication Critical patent/CN114745114B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD

Abstract

The application relates to a password derivation-based key agreement method, a password derivation-based key agreement device, password derivation-based key agreement equipment and a password derivation-based key agreement medium, wherein the method comprises the steps of obtaining preset authentication data, generating an authentication request based on the preset authentication data, and sending the authentication request to authentication equipment; receiving a first bit string returned by the authentication equipment, wherein the first bit string is formed by splicing a first time-varying parameter and a random bit string; if the first time-varying parameter does not exceed a first time-varying parameter threshold value, generating a session key of a management device based on the random bit string, the preset authentication data and a session key derivation rule; encrypting the random bit string by using the session key of the management equipment, acquiring a second time-varying parameter of the random bit string, and splicing the second time-varying parameter and the encrypted random bit string to obtain a second bit string; transmitting the second bit string to the authentication device. The method and the device have the effect of realizing lightweight implementation of key agreement.

Description

Key agreement method, device, equipment and medium based on password derivation
Technical Field
The present application relates to the field of information security technologies, and in particular, to a password derivation based key agreement method, apparatus, device, and medium.
Background
In order to protect the security of the service data transmitted by both communication parties, a session key symmetric encryption system is usually adopted to encrypt the service data, wherein the session key is generated through a key agreement mode.
At present, session Key agreement is usually performed based on a Public Key crypto Infrastructure (PKI) system, and the session Key agreement is completed by certificate exchange and by combining an asymmetric crypto system and a symmetric crypto system in a hybrid agreement manner.
However, in the management interaction of the software cryptographic module, when a PKI system is used for key agreement, a certificate management facility and a key management facility need to be deployed, so that the interaction times in the agreement process are too many, and the lightweight implementation is difficult.
Disclosure of Invention
In order to implement lightweight implementation of key agreement, the application provides a password derivation-based key agreement method, device, equipment and medium.
In a first aspect, the present application provides a password derivation-based key agreement method, which is applied to a management device, and adopts the following technical scheme:
a password derivation-based key agreement method is applied to management equipment and comprises the following steps:
acquiring preset authentication data, generating an authentication request based on the preset authentication data, and sending the authentication request to authentication equipment;
receiving a first bit string returned by the authentication equipment, wherein the first bit string is formed by splicing a first time-varying parameter and a random bit string;
if the first time-varying parameter does not exceed a first time-varying parameter threshold value, generating a session key of a management device based on the random bit string, the preset authentication data and a session key derivation rule;
encrypting the random bit string by using the session key of the management equipment, acquiring a second time-varying parameter of the random bit string, and splicing the second time-varying parameter and the encrypted random bit string to obtain a second bit string;
transmitting the second bit string to the authentication device.
By adopting the technical scheme, the session key of the management equipment is generated through the preset authentication data of the management equipment, the random bit string returned by the authentication equipment and the key derivation rule, and compared with the process of generating the session key by adopting a PKI system, the method has the advantages that the dependence on basic key management facilities is removed, the interaction times in the negotiation process are reduced, and the lightweight implementation of key negotiation is realized.
Optionally, before the obtaining of the preset authentication data, the method further includes:
acquiring a first external password and an authentication state of the authentication equipment, and carrying out Hash operation on the first password to obtain a first abstract value;
judging whether the authentication state is non-primary authentication or not;
if so, taking the first abstract value as the preset identification data;
if not, generating a temporary session key of the management equipment based on the first digest value and a session key derivation rule;
acquiring a second external password, performing hash operation on the second external password to obtain a second abstract value, and taking the second abstract value as the preset authentication data;
encrypting the second digest value based on a block cipher operation rule and a temporary session key of the management device, acquiring a third time-varying parameter of the management device, and splicing the third time-varying parameter and the encrypted second digest value to obtain a third bit string;
transmitting the third bit string to the authentication device.
By adopting the technical scheme, the security of the session key generated by the management equipment is enhanced by changing the preset authentication data during initialization.
Optionally, the generating a session key of a management device based on the random bit string, the preset authentication data, and a session key derivation rule includes:
performing algebraic transformation on the preset authentication data based on a preset rule to obtain a first key dispersion factor;
and performing key dispersion operation on the random bit string by using the first key dispersion factor and a block cipher algorithm to obtain a session key of the management device.
In a second aspect, the present application provides a key agreement method based on password derivation, which is applied to an authentication device and adopts the following technical solutions:
a password derivation-based key agreement method applied to authentication equipment comprises the following steps:
receiving an authentication request sent by management equipment, and triggering a random number generator to generate a random bit string;
generating a session key of the authentication device based on preset authentication data, the random bit string and a session key derivation rule;
acquiring a first time-varying parameter of the management device, splicing the first time-varying parameter with the random bit string to obtain a first bit string, and sending the first bit string to the management device;
receiving a second bit string returned by the management equipment, wherein the second bit string is formed by splicing a second time-varying parameter and a random bit string encrypted by the management equipment;
if the second time-varying parameter does not exceed a second time-varying parameter threshold value, decrypting a random bit string in the second bit string by using a session key of the authentication device;
judging whether the random bit string is decrypted successfully or not;
if yes, the key agreement is successful, otherwise the key agreement fails.
By adopting the technical scheme, the session key of the authentication device is generated through the preset authentication data of the authentication device, the random bit string generated by the authentication device and the key derivation rule, compared with the process of generating the session key by adopting a PKI system, a certificate management facility and a key management facility are not required to be deployed, the interaction times in the negotiation process are reduced, and the lightweight implementation of key negotiation is realized.
Optionally, after receiving the third bit string sent by the management device, the method further includes:
generating a temporary session key of the authentication device based on preset authentication data and a key derivation rule;
when the third time-varying parameter does not exceed the third time-varying parameter threshold value, decrypting the third bit string by using the temporary session key of the authentication device to obtain a second digest value;
updating the preset authentication data to the second digest value;
and the third bit string is formed by splicing a third time-varying parameter and a second digest value encrypted by the management equipment.
Optionally, the generating a session key of an authentication device based on preset authentication data, the random bit string, and a session key derivation rule includes:
performing algebraic transformation on the preset authentication data based on a preset rule to obtain a second key dispersion factor;
and performing key dispersion operation on the random bit string by using the second key dispersion factor and a block cipher algorithm to obtain a session key of the authentication device.
In a third aspect, the present application provides a key agreement apparatus derived based on a password, which is applied to a management device, and adopts the following technical scheme:
a key agreement device based on password derivation is applied to management equipment and comprises the following components:
the authentication device comprises an acquisition and sending module, a processing module and an authentication module, wherein the acquisition and sending module is used for acquiring preset authentication data, generating an authentication request based on the preset authentication data and sending the authentication request to authentication equipment;
the first receiving module is used for receiving a first bit string returned by the authentication equipment, and the first bit string is formed by splicing a first time-varying parameter and a random bit string;
a first generation module, configured to generate a session key of a management device based on the random bit string, the preset authentication data, and a session key derivation rule if the first time-varying parameter does not exceed a first time-varying parameter threshold;
the encryption splicing module is used for encrypting the random bit string by using the session key of the management equipment, acquiring a second time-varying parameter of the encryption splicing module, and splicing the second time-varying parameter and the encrypted random bit string to obtain a second bit string;
a sending module, configured to send the second bit string to the authentication device.
In a fourth aspect, the present application provides a key agreement apparatus derived based on a password, which is applied to an authentication device, and adopts the following technical solutions:
a key agreement device based on password derivation is applied to authentication equipment and comprises:
the receiving triggering module is used for receiving the authentication request sent by the management equipment and triggering the random number generator to generate a random bit string;
the second generation module is used for generating a session key of the authentication device based on preset authentication data, the random bit string and a session key derivation rule;
the acquisition splicing module is used for acquiring a first time-varying parameter of the acquisition splicing module, splicing the first time-varying parameter with the random bit string to obtain a first bit string, and sending the first bit string to the management equipment;
the second receiving module is used for receiving a second bit string returned by the management equipment, and the second bit string is formed by splicing a second time-varying parameter and a random bit string encrypted by the management equipment;
a decryption module, configured to decrypt, by using a session key of the authentication device, a random bit string in the second bit string if the second time-varying parameter does not exceed a second time-varying parameter threshold;
and the judging module is used for judging whether the random bit string is decrypted successfully or not, the key agreement is successful, and otherwise, the key agreement fails.
In a fifth aspect, the present application provides a management device, which adopts the following technical solution:
a management device comprising a memory and a processor, the memory having stored thereon a computer program that can be loaded by the processor and that performs the method of any of the first or second aspects.
In a sixth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solutions:
a computer readable storage medium storing a computer program that can be loaded by a processor and executed to perform the method of any of the first or second aspects.
Drawings
Fig. 1 is a flowchart illustrating a password derivation-based key agreement method applied to a management device in an embodiment of the present application.
Fig. 2 is a schematic flow chart of a session key generation process of a management device in an embodiment of the present application.
Fig. 3 is a flowchart illustrating a password derivation-based key agreement method applied to an authentication device in an embodiment of the present application.
Fig. 4 is a block diagram of a configuration of a password derivation-based key agreement apparatus 300 according to an embodiment of the present application.
Fig. 5 is a block diagram of a configuration of a password derivation-based key agreement apparatus 400 according to an embodiment of the present application.
Fig. 6 is a block diagram of an electronic device 500 embodied in an embodiment of the present application.
Detailed Description
The present application is described in further detail below with reference to the attached drawings.
The present embodiment is only for explaining the present application, and it is not limited to the present application, and those skilled in the art can make modifications of the present embodiment without inventive contribution as needed after reading the present specification, but all of them are protected by patent law within the scope of the claims of the present application.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
In addition, the term "and/or" herein is only one kind of association relationship describing the association object, and means that there may be three kinds of relationships, for example, a and/or B, and may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship, unless otherwise specified.
The embodiments of the present application will be described in further detail with reference to the drawings attached hereto.
The embodiment of the application provides a password derivation-based key agreement method, which can be executed by an electronic device, wherein the electronic device can be a server or a terminal device, the server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services. The terminal device may be, but is not limited to, a smart phone, a tablet computer, a desktop computer, etc.
As shown in fig. 1, a password derivation-based key agreement method is applied to a management device, and the main flow of the method is described as follows (steps S101 to S105):
step S101, acquiring preset authentication data, generating an authentication request based on the preset authentication data, and sending the authentication request to authentication equipment;
step S102, receiving a first bit string returned by the authentication equipment, wherein the first bit string is formed by splicing a first time-varying parameter and a random bit string;
after the management device obtains the preset authentication data, an authentication request is generated and sent to the authentication device to trigger a key agreement action between the management device and the authentication device, and after receiving the authentication request, the authentication device sends a first character string to the management device for key agreement, wherein the first character string is formed by splicing a first time-varying parameter and a random bit string.
It should be noted that the first time-varying parameter includes, but is not limited to, interrupt data of an operating system of the authentication device, a CPU state value, and timestamp data, and in this embodiment, the timestamp data is taken as an example for description.
The following description is made with respect to preset authentication data of the management apparatus.
The setting of the preset authentication data specifically includes the following steps (steps S1021 to S1027):
step S1021, acquiring a first external password and an authentication state of authentication equipment, and performing hash operation on the first password to obtain a first abstract value;
in this embodiment, the worker inputs the external password by using a mouse, a keyboard, a touch screen, and the like of the management device, where the external password includes a first external password and a second external password, where the external password may be input by using an artificial character, may also be input by using a text, and is not limited specifically.
Step S1022, determine whether the authentication status is non-initial authentication, if yes, go to step S1023, otherwise go to step S1024;
step S1023, the first abstract value is used as preset identification data;
step S1024, generating a temporary session key of the management device based on the first digest value and the session key derivation rule;
step S1025, acquiring a second external password, carrying out hash operation on the second external password to obtain a second abstract value, and taking the second abstract value as preset authentication data;
step S1026, encrypting the second digest value based on the block cipher operation rule and the temporary session key of the management device, acquiring a third time-varying parameter of the second digest value, and splicing the third time-varying parameter and the encrypted second digest value to obtain a third bit string;
step S1027, sending the third bit string to the authentication device.
In this embodiment, the management device generates the session key of the management device based on the first digest value, the process of generating the session key is consistent with steps S101 to S103, the first digest value in this step is the preset authentication data in step S101, and the process of generating the session key is described in detail in steps S101 to S103. After the management equipment generates a session key, acquiring the authentication state of the authentication equipment, and when the authentication state is non-primary authentication, taking the first digest value as preset authentication data of the management equipment; when the authentication state is first authentication, a session key generated based on the first digest value is used as a temporary session key of the management device, a second external password is obtained, Hash operation is carried out on the second external password to obtain a second digest value, the second digest value is used as preset authentication data of the management device, after the second digest value is generated, the management device encrypts the second digest value by using the temporary session key and a session derivation rule, and current third time-varying parameters of the management device are collected to be used for the authentication device to verify a third bit string, so that the possibility of malicious data interference is reduced. And sending the encrypted second digest value and the third time-varying parameter to the authentication equipment to change the preset authentication data of the authentication equipment.
In the initialization process of the software password, the management device can change the authentication device and the preset authentication data of the management device through the temporary session key, and the security of the session key generated by the management device and the authentication device is enhanced, so that the security of the service data transmitted by both communication parties is protected.
It should be noted that the hash operation includes, but is not limited to, SHA-256, SM3, and the block cipher operation rules include, but are not limited to, AES (Advanced Encryption Standard), SM4 algorithm, and TDES (Triple Data Encryption Standard). The third time-varying parameter is interrupt data, a CPU state value, and timestamp data of the management device operating system after the second digest value is encrypted, and the timestamp data is taken as an example in this embodiment for description.
The following is a description of the authentication state of the authentication device:
specifically, an authentication state is stored in the authentication device, and the authentication state may be a control word or key data, which is not specifically limited. In this embodiment, the authentication states are described by taking 0 and 1 as examples, when the module is not initialized, the authentication state is 0, and after the initial authentication between the management device and the authentication device is completed, the management device updates the authentication state to 1, where it is to be noted that the initial authentication is that the management device and the authentication device perform key agreement for the first time.
Step S103, if the first time-varying parameter does not exceed the first time-varying parameter threshold, generating a session key of the management device based on the random bit string, the preset authentication data and the session key derivation rule;
in this embodiment, a first time-varying parameter in a first bit string returned by the authentication device is checked, for example, when the time of the current management device is 9:01, the threshold of the first time-varying parameter is 2s, and when the timestamp data received by the management device is 9:02, the first time parameter is successfully verified; when the time stamp data received by the management apparatus is 9:05, the first time parameter is failed to be verified.
When the management apparatus succeeds in verifying the first time-varying parameter, the following steps are performed (steps S1031 to S1032):
step S1031, performing algebraic transformation on preset identification data based on a preset rule to obtain a first key dispersion factor;
step S1032 performs key distribution operation on the random bit string by using the first key distribution factor and the block cipher algorithm, to obtain the session key of the management device.
As shown in fig. 2, the preset authentication data of the management device is divided into four fields, a first field, a second field, a third field and a fourth field, in this embodiment, the lengths of the first field, the second field, the third field and the fourth field are the same as an example for explanation, where in this embodiment, the preset rule refers to performing an exclusive or operation on two fields to obtain a dispersion factor. For example, A, B, C, D the four fields, a and B are xored to obtain E, E and C are xored to obtain F, and F and D are xored to obtain G, which is the first dispersion factor, and it should be noted that the operation sequence of the above xor operation is only an example.
After the management device obtains the dispersion factor, performing an inverse operation on the dispersion factor, and splicing the dispersion factor and the inverse dispersion factor to obtain a new field, where for example, the dispersion factor is a, the inverse dispersion factor is b, and the spliced new field may be ab or ba, which is not limited specifically. And finally, the random bit string and the new field are operated by the SM4 to obtain the session key of the management device.
Step S104, encrypting the random bit string by using the session key of the management equipment, acquiring a second time-varying parameter of the random bit string, and splicing the second time-varying parameter and the encrypted random bit string to obtain a second bit string;
step S105, the second bit string is sent to the authentication device.
In the present embodiment, the encryption rule for encrypting the random bit string is constructed based on the SM4 block cipher algorithm approved by the national commercial cipher administration. The block cipher algorithm may include, but is not limited to, AES (Advanced Encryption Standard), SM4 algorithm, and TDES (Triple Data Encryption Standard), among others.
It should be noted that the third time-varying parameter refers to interrupt data, a CPU state value, and timestamp data of the management device operating system after encryption of the random bit string is completed, and in this embodiment, the timestamp data is taken as an example for description, the second character string may be cd or dc, which is not specifically limited, where c is the second time-varying parameter, and d is the encrypted random character string.
As shown in fig. 3, a password derivation-based key agreement method is applied to a management device, and the main flow of the method is described as follows (steps S201 to S207):
step S201, receiving an authentication request sent by a management device, and triggering a random number generator to generate a random bit string;
step S202, generating a session key of the authentication device based on preset authentication data, a random bit string and a session key derivation rule;
in this embodiment, after the authentication device receives the authentication request sent by the management device, the software random number generator is triggered to generate a random bit string, where the random bit string is generated by the software random number generator meeting the requirements of the relevant standards of the national code administration, in this embodiment, the length of the random bit string is described by taking 128 bits as an example, the random bit string is used for generating session keys of the management device and the authentication device, and it needs to be described that the preset authentication data in this step is consistent with the preset authentication data in step S101.
The steps of generating the session key of the authentication device are as follows:
step S2021, performing algebraic transformation on preset authentication data based on a preset rule to obtain a second key dispersion factor;
step S2022, performing key distribution operation on the random bit string by using the second key distribution factor and the block cipher algorithm to obtain a session key of the authentication device.
In this embodiment, step S2021 is identical to step S1031, and step S2022 is identical to step S1032, which are not repeated herein.
Step S203, collecting a first time-varying parameter of the self, splicing the first time-varying parameter with a random bit string to obtain a first bit string, and sending the first bit string to a management device;
in this embodiment, the timestamp data is taken as an example for explanation, and the first time-varying parameter is spliced with the random bit string to obtain a first bit string, and the first bit string is sent to the management device, where it should be noted that the first bit string may be 12 or 21, where 1 is the first time-varying parameter and 2 is the random bit string.
Step S204, receiving a second bit string returned by the management equipment, wherein the second bit string is formed by splicing a second time-varying parameter and a random bit string encrypted by the management equipment;
step S205, if the second time-varying parameter does not exceed the second time-varying parameter threshold, the random bit string in the second bit string is decrypted by using the session key of the authentication device;
step S206, judging whether the random bit string is decrypted successfully;
if yes, go to step S207, otherwise go to step S208;
step S207, the key agreement is successful;
in step S208, the key agreement fails.
In this embodiment, after the management device receives the first bit string, a second bit string is sent to the authentication device, and when the authentication device receives the second bit string, the second bit string is decrypted by using the session key of the authentication device.
It should be noted that the decryption rule of the second bit string is constructed based on the SM4 block cipher algorithm approved by the national commercial cipher administration. The block cipher algorithm may include, but is not limited to, AES (Advanced Encryption Standard), SM4 algorithm, and TDES (Triple Data Encryption Standard).
When the session key of the authentication device successfully decrypts the second character string, the management device successfully negotiates with the key of the authentication device, and the successful decryption means that the second bit string is decrypted to obtain a random bit string; when the decryption fails, the authentication apparatus transmits authentication failure information to the management apparatus, and the management apparatus proceeds to step S101.
Before module initialization, a preset authentication data is preset on the authentication device, in the implementation, the preset authentication data of the authentication device is the first abstract value, and when the authentication device and the management device perform initial authentication, the preset authentication data needs to be changed, so that when the authentication device receives a third bit string, the authentication device and the management device are proved to be initial authentication.
Specifically, a temporary session key of the authentication device is generated based on preset authentication data; when the third time-varying parameter does not exceed the third time-varying parameter threshold value, decrypting the third bit string by using a temporary session key of the authentication device to obtain a second digest value; updating the preset identification data into a second abstract value; and the third bit string is formed by splicing a third time-varying parameter and the second digest value encrypted by the management equipment.
The process of generating the temporary session key of the authentication device is consistent with step S1031 and step S1032, which is not described in detail herein.
When the third time-varying parameter does not exceed the second time-varying parameter threshold value, decrypting the third bit string by using a temporary session key of the authentication device to obtain a second digest value; and updating the preset authentication data into a second abstract value, thereby finishing the change of the preset authentication data when the management equipment and the authentication equipment authenticate for the first time.
Fig. 4 is a block diagram illustrating a configuration of a password-derived key agreement apparatus 300 according to the present application, where the password-derived key agreement apparatus 300 is applied to a management device.
As shown in fig. 4, a password-derived key agreement apparatus 300 applied to a management device, the password-derived key agreement apparatus 300 includes:
an obtaining and sending module 301, configured to obtain preset authentication data, generate an authentication request based on the preset authentication data, and send the authentication request to an authentication device;
a first receiving module 302, configured to receive a first bit string returned by the authentication device, where the first bit string is formed by splicing a first time-varying parameter and a random bit string;
a first generating module 303, configured to generate a session key of the management device based on the random bit string, the preset authentication data, and the session key derivation rule if the first time-varying parameter does not exceed the first time-varying parameter threshold;
the encryption splicing module 304 is configured to encrypt the random bit string by using a session key of the management device, acquire a second time-varying parameter of the encryption splicing module, and splice the second time-varying parameter with the encrypted random bit string to obtain a second bit string;
a sending module 305, configured to send the second bit string to the authentication device.
As an optional implementation manner of this embodiment, the first generating module 304 includes:
the first replacement obtaining submodule is used for carrying out algebraic transformation on preset identification data based on a preset rule to obtain a first key dispersion factor;
and the first operation obtaining submodule is used for carrying out key dispersion operation on the random bit string by utilizing the first key dispersion factor and the block cipher algorithm to obtain the session key of the management equipment.
As an optional implementation manner of this embodiment, the password-derived key agreement apparatus 300 further includes:
the state acquisition module is used for acquiring a first external password and the authentication state of the authentication equipment before acquiring preset authentication data, and carrying out hash operation on the first password to obtain a first abstract value;
the state judgment module is used for judging whether the authentication state is non-primary authentication or not, if so, the first digest value is used as preset authentication data, and if not, a temporary session key of the management equipment is generated based on the first digest value and a session key derivation rule;
the password acquisition module is used for acquiring a second external password, carrying out hash operation on the second external password to obtain a second abstract value, and taking the second abstract value as preset authentication data;
the acquisition and splicing module is used for encrypting the second digest value based on the block cipher operation rule and the temporary session key of the management equipment, acquiring a third time-varying parameter of the acquisition and splicing the third time-varying parameter and the encrypted second digest value to obtain a third bit string;
and the bit string sending module is used for sending the third bit string to the authentication equipment.
The functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part. The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product, stored in a storage medium, including instructions for causing an electronic device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of a vehicle driving data fusion method according to various embodiments of the present application.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the apparatus and the module described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 5 is a block diagram illustrating a configuration of a password-derived key agreement apparatus 400, where the password-derived key agreement apparatus 400 is applied to an authentication device.
As shown in fig. 5, a password-derived key agreement apparatus 400 applied to an authentication device, the password-derived key agreement apparatus 400 includes:
a receiving triggering module 401, configured to receive an authentication request sent by a management device, and trigger a random number generator to generate a random bit string;
a second generating module 402, configured to generate a session key of the authentication device based on preset authentication data, the random bit string, and a session key derivation rule;
the acquisition and splicing module 403 is configured to acquire a first time-varying parameter of the acquisition module, splice the first time-varying parameter with the random bit string to obtain a first bit string, and send the first bit string to the management device;
a second receiving module 404, configured to receive a second bit string returned by the management device, where the second bit string is formed by splicing a second time-varying parameter and a random bit string encrypted by the management device;
a decryption module 405, configured to decrypt, by using a session key of the authentication device, a random bit string in the second bit string if the second time-varying parameter does not exceed the second time-varying parameter threshold;
the determining module 406 is configured to determine whether decryption of the random bit string is successful, if so, the key agreement is successful, otherwise, the key agreement is failed.
As an optional implementation manner of this embodiment, the second generating module 402 includes:
the second replacement obtaining submodule is used for carrying out algebraic transformation on the preset identification data based on the preset rule to obtain a second key dispersion factor;
and the second operation obtaining submodule is used for carrying out key dispersion operation on the random bit string by utilizing the second key dispersion factor and a block cipher algorithm to obtain a session key of the authentication equipment.
As an optional implementation manner of this embodiment, the password-derived key agreement apparatus 300 further includes:
the temporary session key generation module is used for generating a temporary session key of the authentication device based on preset authentication data and a key derivation rule after receiving the third bit string sent by the management device;
a decryption obtaining module, configured to decrypt the third bit string by using a temporary session key of the authentication device when the third time-varying parameter does not exceed the third time-varying parameter threshold, so as to obtain a second digest value;
and the fourth sending module is used for updating the preset authentication data into a second digest value, wherein the third bit string is formed by splicing a third time-varying parameter and the second digest value encrypted by the management equipment.
The functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part. The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, or portions of the technical solutions, may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable an electronic device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of a vehicle driving data fusion method according to various embodiments of the present application.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the apparatus and the module described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 6 is a block diagram of an electronic device 500 according to an embodiment of the present disclosure. As shown in fig. 6, the electronic device 500 includes a memory 501, a processor 502, and a communication bus 503; the memory 501 and the processor 502 are connected by a communication bus 503. The memory 501 has stored thereon a password derivation-based key agreement method that can be loaded and executed by the processor 502 as provided in the above embodiments.
The memory 501 may be used to store instructions, programs, code sets, or instruction sets. The memory 501 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, instructions for implementing a password-derived key agreement method provided by the above embodiments, and the like; the storage data area may store data and the like involved in a password derivation-based key agreement method provided in the above embodiments.
Processor 502 may include one or more processing cores. The processor 502 executes various functions and processes data of the present application by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 501 to invoke data stored in the memory 501. The Processor 502 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understood that the electronic devices for implementing the above-described processing 502 functions may be other devices, and the embodiments of the present application are not limited thereto.
The communication bus 503 may include a path that conveys information between the aforementioned components. The communication bus 503 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus 503 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
Embodiments of the present application provide a computer-readable storage medium, which stores a computer program that can be loaded by a processor and executes a password derivation-based key agreement method as provided in the above embodiments.
In this embodiment, the computer readable storage medium may be a tangible device that retains and stores instructions for use by an instruction execution device. The computer readable storage medium may be, but is not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any combination of the foregoing. In particular, the computer readable storage medium may be a portable computer diskette, a hard disk, a U-disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a podium random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, an optical disk, a magnetic disk, a mechanical coding device, and any combination thereof.
The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the application referred to in the present application is not limited to the embodiments with a particular combination of the above-mentioned features, but also encompasses other embodiments with any combination of the above-mentioned features or their equivalents without departing from the spirit of the application. For example, the above features may be replaced with (but not limited to) features having similar functions as those described in this application.

Claims (10)

1. A password derivation-based key agreement method applied to a management device, the method comprising:
acquiring preset authentication data, generating an authentication request based on the preset authentication data, and sending the authentication request to authentication equipment;
receiving a first bit string returned by the authentication equipment, wherein the first bit string is formed by splicing a first time-varying parameter and a random bit string;
if the first time-varying parameter does not exceed a first time-varying parameter threshold value, generating a session key of a management device based on the random bit string, the preset authentication data and a session key derivation rule;
encrypting the random bit string by using the session key of the management equipment, acquiring a second time-varying parameter of the random bit string, and splicing the second time-varying parameter and the encrypted random bit string to obtain a second bit string;
transmitting the second bit string to the authentication device.
2. The method according to claim 1, further comprising, prior to said obtaining preset authentication data:
acquiring a first external password and an authentication state of the authentication equipment, and performing hash operation on the first password to obtain a first abstract value;
judging whether the authentication state is non-primary authentication or not;
if so, taking the first abstract value as the preset identification data;
if not, generating a temporary session key of the management equipment based on the first digest value and a session key derivation rule;
acquiring a second external password, performing hash operation on the second external password to obtain a second abstract value, and taking the second abstract value as the preset authentication data;
encrypting the second digest value based on a block cipher operation rule and a temporary session key of the management device, acquiring a third time-varying parameter of the management device, and splicing the third time-varying parameter and the encrypted second digest value to obtain a third bit string;
transmitting the third bit string to the authentication device.
3. The method according to claim 1 or 2, wherein the generating a session key for a management device based on the random bit string, the preset authentication data, and a session key derivation rule comprises:
algebraic transformation is carried out on the preset identification data based on a preset rule to obtain a first key dispersion factor;
and performing key dispersion operation on the random bit string by using the first key dispersion factor and a block cipher algorithm to obtain a session key of the management device.
4. A password derivation-based key agreement method, applied to an authentication device, the method comprising:
receiving an authentication request sent by management equipment, and triggering a random number generator to generate a random bit string;
generating a session key of the authentication device based on preset authentication data, the random bit string and a session key derivation rule;
acquiring a first time-varying parameter of the management equipment, splicing the first time-varying parameter with the random bit string to obtain a first bit string, and sending the first bit string to the management equipment;
receiving a second bit string returned by the management equipment, wherein the second bit string is formed by splicing a second time-varying parameter and a random bit string encrypted by the management equipment;
if the second time-varying parameter does not exceed a second time-varying parameter threshold value, decrypting a random bit string in the second bit string by using a session key of the authentication device;
judging whether the random bit string is decrypted successfully or not;
if yes, the key agreement is successful, otherwise the key agreement fails.
5. The method of claim 4, further comprising, after receiving a third bit string sent by the management device:
generating a temporary session key of the authentication device based on preset authentication data and a key derivation rule;
when the third time-varying parameter does not exceed the third time-varying parameter threshold value, decrypting the third bit string by using the temporary session key of the authentication device to obtain a second digest value;
updating the preset authentication data to the second digest value;
and the third bit string is formed by splicing a third time-varying parameter and a second digest value encrypted by the management equipment.
6. The method of claim 4 or claim 5, wherein generating a session key for authenticating the device based on the pre-set authentication data, the random bit string, and a session key derivation rule comprises:
performing algebraic transformation on the preset authentication data based on a preset rule to obtain a second key dispersion factor;
and performing key dispersion operation on the random bit string by using the second key dispersion factor and a block cipher algorithm to obtain a session key of the authentication device.
7. A password derivation-based key agreement apparatus, applied to a management device, includes:
the authentication device comprises an acquisition and sending module, a processing module and an authentication module, wherein the acquisition and sending module is used for acquiring preset authentication data, generating an authentication request based on the preset authentication data and sending the authentication request to authentication equipment;
the first receiving module is used for receiving a first bit string returned by the authentication equipment, and the first bit string is formed by splicing a first time-varying parameter and a random bit string;
a first generation module, configured to generate a session key of a management device based on the random bit string, the preset authentication data, and a session key derivation rule if the first time-varying parameter does not exceed a first time-varying parameter threshold;
the encryption splicing module is used for encrypting the random bit string by using the session key of the management equipment, acquiring a second time-varying parameter of the encryption splicing module, and splicing the second time-varying parameter and the encrypted random bit string to obtain a second bit string;
a sending module, configured to send the second bit string to the authentication device.
8. A password derivation-based key agreement apparatus, applied to an authentication device, includes:
the receiving triggering module is used for receiving the authentication request sent by the management equipment and triggering the random number generator to generate a random bit string;
the second generation module is used for generating a session key of the authentication device based on preset authentication data, the random bit string and a session key derivation rule;
the acquisition splicing module is used for acquiring a first time-varying parameter of the acquisition splicing module, splicing the first time-varying parameter with the random bit string to obtain a first bit string, and sending the first bit string to the management equipment;
the second receiving module is used for receiving a second bit string returned by the management equipment, and the second bit string is formed by splicing a second time-varying parameter and a random bit string encrypted by the management equipment;
a decryption module, configured to decrypt, by using a session key of the authentication device, a random bit string in the second bit string if the second time-varying parameter does not exceed a second time-varying parameter threshold;
and the judging module is used for judging whether the random bit string is decrypted successfully or not, the key agreement is successful, and otherwise, the key agreement fails.
9. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program that can be loaded by the processor and that executes the method according to any of claims 1 to 6.
10. A computer-readable storage medium, in which a computer program is stored which can be loaded by a processor and which executes the method of any one of claims 1 to 6.
CN202210438132.7A 2022-04-25 2022-04-25 Key agreement method, device, equipment and medium based on password derivation Active CN114745114B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210438132.7A CN114745114B (en) 2022-04-25 2022-04-25 Key agreement method, device, equipment and medium based on password derivation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210438132.7A CN114745114B (en) 2022-04-25 2022-04-25 Key agreement method, device, equipment and medium based on password derivation

Publications (2)

Publication Number Publication Date
CN114745114A true CN114745114A (en) 2022-07-12
CN114745114B CN114745114B (en) 2022-11-08

Family

ID=82284244

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210438132.7A Active CN114745114B (en) 2022-04-25 2022-04-25 Key agreement method, device, equipment and medium based on password derivation

Country Status (1)

Country Link
CN (1) CN114745114B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116132043A (en) * 2023-04-20 2023-05-16 北京智芯微电子科技有限公司 Session key negotiation method, device and equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107864139A (en) * 2017-11-09 2018-03-30 北京科技大学 A kind of cryptography attribute base access control method and system based on dynamic rules
CN111259353A (en) * 2020-01-15 2020-06-09 江苏芯盛智能科技有限公司 Identity authentication method and device based on SM9 algorithm and computer equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107864139A (en) * 2017-11-09 2018-03-30 北京科技大学 A kind of cryptography attribute base access control method and system based on dynamic rules
CN111259353A (en) * 2020-01-15 2020-06-09 江苏芯盛智能科技有限公司 Identity authentication method and device based on SM9 algorithm and computer equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116132043A (en) * 2023-04-20 2023-05-16 北京智芯微电子科技有限公司 Session key negotiation method, device and equipment

Also Published As

Publication number Publication date
CN114745114B (en) 2022-11-08

Similar Documents

Publication Publication Date Title
CN110378139B (en) Data key protection method, system, electronic equipment and storage medium
US10142107B2 (en) Token binding using trust module protected keys
CN108809646B (en) Secure shared key sharing system
US11930103B2 (en) Method, user device, management device, storage medium and computer program product for key management
CN110401615B (en) Identity authentication method, device, equipment, system and readable storage medium
CN106416123B (en) Certification based on password
CN111371549B (en) Message data transmission method, device and system
US10171235B2 (en) User-initiated migration of encryption keys
CN107317677B (en) Secret key storage and equipment identity authentication method and device
US10880100B2 (en) Apparatus and method for certificate enrollment
WO2021103802A1 (en) Methods and apparatuses for encrypting and decrypting data, storage medium and encrypted file
CN108347404B (en) Identity authentication method and device
CN105721153B (en) Key exchange system and method based on authentication information
US20190140819A1 (en) System and method for mekle puzzles symeteric key establishment and generation of lamport merkle signatures
CN108199847B (en) Digital security processing method, computer device, and storage medium
JP2020530726A (en) NFC tag authentication to remote servers with applications that protect supply chain asset management
CN108809633B (en) Identity authentication method, device and system
KR101608815B1 (en) Method and system for providing service encryption in closed type network
KR101739203B1 (en) Password-based user authentication method using one-time private key-based digital signature and homomorphic encryption
CN111435913A (en) Identity authentication method and device for terminal of Internet of things and storage medium
CN109194474A (en) A kind of data transmission method and device
CN112740615A (en) Multi-party computed key management
CN111526007B (en) Random number generation method and system
CN111614621A (en) Internet of things communication method and system
CN106941404A (en) Cryptographic key protection method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant