WO2022110968A1 - 一种动态密钥生成方法和系统 - Google Patents

一种动态密钥生成方法和系统 Download PDF

Info

Publication number
WO2022110968A1
WO2022110968A1 PCT/CN2021/117514 CN2021117514W WO2022110968A1 WO 2022110968 A1 WO2022110968 A1 WO 2022110968A1 CN 2021117514 W CN2021117514 W CN 2021117514W WO 2022110968 A1 WO2022110968 A1 WO 2022110968A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
server
client
protocol
key generation
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.)
Ceased
Application number
PCT/CN2021/117514
Other languages
English (en)
French (fr)
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.)
China Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Publication of WO2022110968A1 publication Critical patent/WO2022110968A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

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/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • 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/0891Revocation or update of secret information, e.g. encryption key update or rekeying

Definitions

  • the invention belongs to the field of encrypted communication, and in particular relates to a dynamic key generation method and system.
  • the Internet black and gray industry obtains the request interface and parameters of the communication between the client and the server through packet capture, reverse analysis, etc., and directly forges the interface protocol and parameters to realize automatic operation, and the secure communication between the client and the server is challenged .
  • TLS Transport Layer Security, Transport Layer Security
  • the open source protocol TLS handshake scheme can assist the client and the server to select the encryption algorithm, MAC algorithm and related keys used in the connection.
  • the two sides use the handshake protocol to complete the above-mentioned matters.
  • the client needs to preset some public encryption algorithms and hashing methods, so the client key generation algorithm is fixed, and an attacker can obtain these fixed keys by reverse cracking the client logic.
  • the encrypted communication between the client and the server is cracked, which adversely affects the communication security.
  • the present invention provides the following solutions.
  • a dynamic key generation method comprising: when a preset risk event is detected, dynamically updating the first key generation protocol currently held by the server based on the risk degree of the preset risk event, and obtaining the method.
  • the second key generation protocol the server sends the dynamically updated second key generation protocol to the client, so that the client performs key exchange with the server based on the second key generation protocol.
  • the server sends the dynamically updated second key generation protocol to the client, and the method further includes: the server receives a key exchange request sent by the client, where the key exchange request includes the current The version number of the key generation protocol held; when the server detects that the version number carried in the key exchange request is inconsistent with the version number of the second key generation protocol, the server will dynamically update the second key generation protocol. sent to the client.
  • the server dynamically updates the currently held first key generation protocol based on the risk level of the preset risk event, further comprising:
  • the server invalidates the currently held first key generation protocol, and generates a second key generation protocol corresponding to the security level according to the risk degree of the preset risk event;
  • the second key generation protocol includes a preset key operator layer and a protocol body, the protocol body includes protocol logic and protocol data, and the protocol logic is used to indicate one or more target keys used by the second key generation protocol.
  • the composition rules of operators, the protocol data is used to indicate the operator parameters of one or more target key operators.
  • the key operator layer includes multiple key operators and is preset on the server and the client, and the multiple key operators included in the key operator layer are pre-divided into multiple security level; and, the security level of the second key generation protocol is determined by the security level of the employed one or more target key operators.
  • the key operator layer includes: one or more key operators using a secure encryption algorithm, and/or one or more key operators using a custom variation algorithm, and/or One or more key operators using a digest algorithm.
  • the method further includes: using white-box encryption technology to protect the security of the operator parameters.
  • the preset risk event includes at least a first preset risk event, a second preset risk event and a third preset risk event with different risk degrees; wherein the first preset risk event is used to indicate that the The proportion of the number of untrusted clients on the server side exceeds the preset threshold; the second preset risk event is used to indicate the reception of an external protocol update instruction; the third preset risk event is used to indicate the first password currently held by the server.
  • the key generation protocol works longer than the preset security period.
  • the server is connected to a plurality of clients, and the key exchange request sent by the client also includes device fingerprint information; the method further includes: the server collects the device fingerprint information sent by each client, according to the device fingerprint information.
  • the fingerprint information determines whether each client is an untrusted client, and periodically determines whether the proportion of the number of untrusted clients connected to the server exceeds a preset threshold, wherein if the preset threshold is exceeded, the first preset is detected. risk event.
  • the preset risk event further includes a fourth preset risk event with a risk degree greater than the first preset risk event; wherein the fourth preset risk event is used to indicate that the server repeatedly detects the first preset risk event multiple times. Set up risk events.
  • the server sends the dynamically updated second key generation protocol to the client, and further includes: the server sends the version number of the second key generation protocol to the client; the client sends the service The terminal initiates a protocol update request, and the protocol update request carries the version number of the second key generation protocol; the server sends the protocol logic and protocol data of the second key generation protocol to the client; the client is based on the preset key operator layer, protocol logic and protocol data, implement the second key generation protocol, and re-initiate a key exchange request to the server based on the second key generation protocol.
  • the server delivers the protocol logic of the second key generation protocol to the client in a hot update manner.
  • the client performs key exchange with the server based on the second key generation protocol, and further includes: the client sends a key exchange request to the server, where the key exchange request includes the second key currently held by the client The version number of the key generation protocol; when the server detects that the version number carried in the key exchange request is consistent with the version number of the second key generation protocol currently held by the server, it generates a random number on the server and sends the service
  • the random number of the terminal is sent to the client; the client generates the pre-master key according to the random number of the server, and sends the pre-master key to the server; the client and the server use the second key generation protocol, the pre-master key, The client random number and the server random number generate the working key; the client and the server perform encrypted communication by exchanging the respective generated working keys.
  • the method further includes: after the client generates the pre-master key according to the random number of the server, encrypting the pre-master key with the public key sent by the server, and sending the encrypted pre-master key to Server; the server decrypts the encrypted pre-master key by using the private key to obtain the decrypted pre-master key.
  • a dynamic key generation system in a second aspect, includes: a server and a client; wherein, the server is used to execute: when a preset risk event is detected, based on the risk degree of the preset risk event
  • the currently held first key generation protocol is dynamically updated to obtain a second key generation protocol; the dynamically updated second key generation protocol is delivered to the client; the client is used to execute: based on the second key Generate a protocol to exchange keys with the server.
  • the server is further configured to: receive a key exchange request sent by the client, where the key exchange request includes the version number of the key generation protocol currently held by the client; when it is detected that the key exchange request carries When the version number of the second key generation protocol is inconsistent with the version number of the second key generation protocol, the dynamically updated second key generation protocol is delivered to the client.
  • the server is further configured to: when a preset risk event is detected, invalidate the currently held first key generation protocol, and generate a second key corresponding to the security level according to the risk degree of the preset risk event A key generation protocol; wherein, the second key generation protocol includes a preset key operator layer and a protocol body, the protocol body includes protocol logic and protocol data, and the protocol logic is used to indicate one or more used by the second key generation protocol.
  • the composition rules of multiple target key operators, and the protocol data is used to indicate the operator parameters of one or more target key operators.
  • the key operator layer includes multiple key operators and is preset on the server and the client, and the multiple key operators included in the key operator layer are pre-divided into multiple security level; and, the security level of the second key generation protocol is determined by the security level of the employed one or more target key operators.
  • the key operator layer includes: one or more key operators using a secure encryption algorithm, and/or one or more key operators using a custom variation algorithm, and/or One or more key operators using a digest algorithm.
  • system is further configured to: use white-box encryption technology to protect the security of the operator parameters.
  • the preset risk event includes at least a first preset risk event, a second preset risk event and a third preset risk event with different risk degrees; wherein the first preset risk event is used to indicate that the The proportion of the number of untrusted clients on the server side exceeds the preset threshold; the second preset risk event is used to indicate the reception of an external protocol update instruction; the third preset risk event is used to indicate the first password currently held by the server.
  • the key generation protocol works longer than the preset security period.
  • the server is connected to multiple clients, and the key exchange request sent by the client also includes device fingerprint information; the server is further used to: collect the device fingerprint information sent by each client, according to the device The fingerprint information determines whether each client is an untrusted client, and periodically determines whether the proportion of the number of untrusted clients connected to the server exceeds a preset threshold, wherein if the preset threshold is exceeded, the first preset is detected. risk event.
  • the preset risk event further includes a fourth preset risk event with a risk degree greater than the first preset risk event; wherein the fourth preset risk event is used to indicate that the server repeatedly detects the first preset risk event multiple times. Set up risk events.
  • the server is further configured to: when detecting that the version number carried in the key exchange request is inconsistent with the version number of the second key generation protocol, deliver the version number of the second key generation protocol to the client
  • the client is also used to: initiate a protocol update request to the server, and the protocol update request carries the version number of the second key generation protocol;
  • the server is also used to: deliver the protocol logic of the second key generation protocol to the client and protocol data;
  • the client is also used to: implement the second key generation protocol based on the preset key operator layer, protocol logic and protocol data, and re-initiate the key to the server based on the second key generation protocol exchange request.
  • the server delivers the protocol logic of the second key generation protocol to the client in a hot update manner.
  • the client is further configured to: after the dynamic update is performed based on the second key generation protocol, send a key exchange request to the server, where the key exchange request includes the second key currently held by the client to generate The version number of the protocol; the server is also used to: when detecting that the version number carried in the key exchange request is consistent with the version number of the second key generation protocol currently held by the server, generate a random number on the server, and use The random number of the server is sent to the client; the client is also used to: generate a pre-master key according to the random number of the server, and send the pre-master key to the server; the client and the server are also used to: use the second key respectively.
  • the key generation protocol, pre-master key, client random number and server random number generate working keys, and encrypt communication by exchanging the respective generated working keys.
  • the client is further configured to: after generating the pre-master key according to the random number of the server, encrypt the pre-master key with the public key sent by the server, and send the encrypted pre-master key to The server side; the server side is also used for: decrypting the encrypted pre-master key by using the private key to obtain the decrypted pre-master key.
  • a computer-readable storage medium stores a program, and when the program is executed by a processor, the processor is caused to perform the method of the first aspect.
  • the server can dynamically update the key generation protocol held by the server based on a preset risk control mechanism and deliver it to the client,
  • the client performs key exchange with the server according to the dynamically updated key generation protocol issued by the server, thereby increasing the attacker's cost of cracking the protocol and providing key security.
  • FIG. 1 is a schematic flowchart of a dynamic key generation method according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a key generation protocol according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a dynamic key generation system according to an embodiment of the present invention.
  • FIG. 4 is a schematic time sequence diagram of an update key generation protocol according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a sequence of generating a dynamic key according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a dynamic key generation system according to an embodiment of the present invention.
  • an embodiment of the present invention proposes a method for generating a dynamic key. Below, the inventive concept of the method is first introduced.
  • the server detects the risk situation in the environment. When a preset risk event is detected, it dynamically updates the currently held first key generation protocol based on the risk degree of the preset risk event, and obtains a second key generation protocol. protocol. Based on this, the server sends the dynamically updated second key generation protocol to the client, so that the client exchanges keys with the server based on the second key generation protocol. In other words, the server can dynamically update the key generation protocol held by the server based on the preset risk control mechanism and deliver it to the client. The client and the server exchange data based on the dynamically updated key generation protocol, thereby improving The cost of the attacker cracking the protocol improves the communication security performance.
  • FIG. 1 is a schematic flowchart of a dynamic key generation method 100 according to an embodiment of the present application.
  • the method 100 may include step 101 and step 102 .
  • Step 101 When a preset risk event is detected, the server dynamically updates the currently held first key generation protocol based on the risk degree of the preset risk event to obtain a second key generation protocol.
  • the preset risk event refers to an event that may cause a risk to the security of the key generation protocol currently held by the server and the client.
  • the preset risk event may be that the client connected to the server is an untrusted client, or that the working time of the currently held key generation protocol exceeds the security duration threshold, and so on.
  • the server dynamically updating the currently held first key generation protocol based on the risk degree of the preset risk event may further include: when a preset risk event is detected , the server invalidates the currently held first key generation protocol, and generates a second key generation protocol corresponding to the security level according to the risk degree of the preset risk event.
  • the preset risk event can be considered as a first-level risk event.
  • the preset risk event may be considered as a secondary risk event.
  • the preset risk event may be considered as a third-level risk event, and so on. Based on this, a second key generation protocol with a security level corresponding to the risk level can be generated, thereby continuously increasing the cost for an attacker to crack the key generation protocol.
  • the second key generation protocol includes a preset key operator layer and a protocol body, the protocol body includes protocol logic and protocol data, and the protocol logic is used to indicate one or more target keys used by the second key generation protocol
  • the composition rule of the operator, the protocol data is used to indicate the operator parameters of one or more target key operators.
  • a key operator layer including multiple key operators is preset on both the server and the client.
  • the key operator layer includes: one or more key operators adopting a secure encryption algorithm such as AES and SM4, and/or adopting a self-defined variation algorithm such as a matrix multiplication algorithm and a large number remainder algorithm one or more key operators of , and/or one or more key operators using digest algorithms such as SHA256, SM3.
  • FIG. 2 shows an example of a key generation protocol, which includes a preset key operator layer and a dynamically generated protocol body, wherein the preset key operator layer includes an AES transform operator, a matrix Key operators such as transformation operators and SHA transformation operators, etc.
  • the main part of the dynamically generated protocol includes a logic area and a data area.
  • the logic area includes the protocol logic, which is used to indicate the composition rules and sequence of the target key operator used by the key generation protocol. The content of this part can be updated by hot updating. sent to the client.
  • the data area contains the operator parameters of the key operators at all levels in the key operator layer.
  • the operator parameters of some of the key operators may be white-box data, and the operator parameters of other key operators may be plaintext parameters.
  • the key operator layer includes multiple key operators and is preset on the server and the client at the same time, and the multiple key operators included in the key operator layer are divided in advance is a plurality of security levels; and, the security level of the second key generation protocol is determined by the security level of the employed one or more target key operators.
  • various key operators in the key operator layer can be divided into first-level operators, second-level operators, and third-level operators according to the transformation security of each key operator.
  • the first-level operator can represent the operator with the highest security level, accept the key factor and operator parameters as input, and use security encryption algorithms such as AES algorithm and SM4 algorithm to protect the security of the transformation result.
  • the second-level operator can represent the operator whose security level is second only to the first-level operator. It accepts the key factor and operator parameters as input, and uses self-defined transformation algorithms such as matrix multiplication algorithm and large-number remainder algorithm to protect the transformation result. security.
  • the second-level operator has a simpler algorithm and has lower performance requirements on the client.
  • the security of the operator parameters of the first-level operator and the second-level operator may be protected by using a white-box technique.
  • the third-level operator can represent an operator with a weak security level. It accepts the key factor and operator parameters as input, and the previously used digest algorithm can be used to protect the security of the transformation result.
  • the operator parameter of the digest algorithm is the digest algorithm.
  • the salt, digest algorithm such as SHA256, SM3, etc.
  • the third-level operator algorithm is simpler and requires lower performance on the client side. Based on this, it can be understood that when the second key generation protocol adopts the first-level operator as the target key operator, it has a higher security level than using the second-level operator.
  • the security level of the second key generation protocol can be determined by the security level of one or more target key operators used, and the second key generation protocol corresponding to the security level can be generated according to the detected risk degree of the preset risk event. protocol.
  • the method further includes: using a white-box encryption technology to protect the security of the operator parameters.
  • the operator parameters of the AES transform operator and the matrix transform operator are stored in the form of white box data.
  • the preset risk event includes at least a first preset risk event, a second preset risk event and a third preset risk event with different risk degrees;
  • the first preset risk event can be used for Indicates that the proportion of the number of untrusted clients connected to the server exceeds the preset threshold;
  • the second preset risk event is used to instruct to receive an externally sent protocol update instruction;
  • the third preset risk event is used to indicate that the server currently holds The working time of the first key generation protocol exceeds the preset security time.
  • a risk control module may be provided on the server, and the risk control module is provided with a plurality of risk driving units, such as a first risk driving unit, a second risk driving unit and a third risk driving unit.
  • the driver forcibly updates the current holding of the server.
  • the dynamically updated second key generation protocol can be composed of AES operator (first-level operator), matrix change operator (second-level operator) and SHA transformation operator (third-level operator). sub) combination participation.
  • the updated second key generation protocol may include an increased number of AES transform operators.
  • the server that is, the second preset risk event occurs
  • the second risk driving unit detects the occurrence of the second preset risk event.
  • the driver is forced to update the first key generation protocol currently held by the server, and the dynamically updated second key generation protocol can be changed by the matrix change operator (secondary operator) and the SHA transformation operator (third-level operator) ) combined to participate.
  • the third risk driving unit detects the third preset risk event, and drives the server to forcibly update the server.
  • the currently held first key generation protocol and the dynamically updated second key generation protocol may be participated by the SHA transformation operator (third-level operator). It can be seen that the risk levels of the first preset risk event, the second preset risk event and the third preset risk event decrease in sequence, and the security level of the second key generation protocol generated after the dynamic update also decreases accordingly.
  • the server is connected to multiple clients, and the key exchange request sent by the client also includes device fingerprint information; the method further includes: the server collects the device fingerprint information sent by each client , according to the device fingerprint information to determine whether each client is an untrusted client, and periodically determine whether the proportion of the number of untrusted clients connected to the server exceeds a preset threshold. a predetermined risk event.
  • the preset risk event further includes a fourth preset risk event with a risk degree greater than the first preset risk event; wherein the fourth preset risk event is used to indicate that the server has detected repeated multiple times the first preset risk event.
  • the driver is forced to update the first key generation protocol currently held by the server, and the dynamically updated second key generation protocol can be composed of multiple AES operator (first-level operator), matrix transformation operator (second-level operator) and SHA transform operator (third-level operator) are combined to participate. This results in a higher level of security.
  • Step 102 The server sends the dynamically updated second key generation protocol to the client, so that the client exchanges keys with the server based on the second key generation protocol.
  • the server in step 102 sends the dynamically updated second key generation protocol to the client, and further includes: the server receives the key exchange request sent by the client, the key The exchange request includes the version number of the key generation protocol currently held by the client; when the server determines that the version number carried in the key exchange request is inconsistent with the version number of the second key generation protocol, the server will dynamically update the The second key generation protocol is delivered to the client.
  • the server determines that the version number carried by the key exchange request sent by the client is consistent with the version number of the second key generation protocol, it means that the key generation protocols of the client and the server are consistent, and the server There is no need to further issue the second key generation protocol held by the client to the client.
  • the above-mentioned server sends the dynamically updated second key generation protocol to the client, which may further include: the server sends the version number of the second key generation protocol to the client
  • the client sends a protocol update request to the server, and the protocol update request carries the version number of the second key generation protocol;
  • the server sends the protocol logic and protocol data corresponding to the second key generation protocol to the client;
  • the client Based on the preset key operator layer, protocol logic and protocol data, the second key generation protocol is implemented, and a key exchange request is initiated to the server based on the second key generation protocol again.
  • the server delivers the protocol logic of the second key generation protocol to the client in a hot update manner.
  • the protocol logic issued by the server to the client is a hot update JS file
  • the client converts the hot update module after receiving the hot update JS file, and further combines the received protocol data
  • the preset key operator layer generates an updated second key generation protocol.
  • FIG. 4 shows a schematic flowchart of sequentially updating the key generation protocol held by the server and the client.
  • the communication between the client and the server is realized by the secure communication module in FIG. 3 .
  • the server sets the currently held first key generation protocol to an invalid state, and generates a second key generation protocol, a hot update patch, and a white box jump table at the same time.
  • the client generates a random number of the client.
  • the above S41 may be before or after S42, which is not specifically limited in this application.
  • the client initiates a key exchange request to the server, where the key exchange request includes: the version number of the key generation protocol currently held by the client, the client random number, and the device fingerprint information.
  • the server receives the key exchange request, determines that the version number carried in the key exchange request has expired, and terminates the current key exchange request.
  • S45 Deliver the version number and certificate of the second key generation protocol held after the dynamic update to the client.
  • the client receives and verifies the received certificate.
  • the client sends a protocol update request to the server, where the protocol update request carries the version number of the second key generation protocol and is used to request a hot update file and a white box jump table.
  • the server sends the hot update js file corresponding to the second key generation protocol (eg, through the protocol logic module) and operator parameters (eg, through the protocol data module) according to the version number sent by the client.
  • the client After receiving the hot update js file and operator parameters, the client performs hot update based on the preset key operator layer, and stores the version number of the second key generation protocol, the hot update file and the white box jump table .
  • the client and the server perform key exchange based on the currently held second key generation protocol.
  • the client performs key exchange with the server based on the second key generation protocol, and further includes: the client sends a key exchange request to the server, where the key exchange request includes the current holdings of the client The version number of the second key generation protocol; when the server detects that the version number carried in the key exchange request is consistent with the version number of the second key generation protocol currently held by the server, it generates a server random number, and send the random number of the server to the client; the client generates a pre-master key according to the random number of the server, and sends the pre-master key to the server; the client and the server respectively use the second key generation protocol, the pre-master key The secret key, the client random number and the server random number generate the working key; the client and the server perform encrypted communication by exchanging the respective generated working keys.
  • the method further includes: after the client generates the pre-master key according to the random number of the server, encrypting the pre-master key with the public key sent by the server, and encrypting the encrypted pre-master key The key is sent to the server; the server uses the private key to decrypt the encrypted pre-master key to obtain the decrypted pre-master key.
  • the server and the client After the client and the server hold the dynamically updated second key generation protocol at the same time, the server and the client generate a final working key (Skey) based on the second key generation protocol.
  • Skey final working key
  • the client generates a client random number (cliRand).
  • the client initiates a key exchange request to the server, and sends the client random number, protocol version number, and device information.
  • the server determines that the protocol version number is the latest version number, and generates a server random number (srvRand).
  • the server sends the server random number (srvRand), the version number of the second key generation protocol, and the certificate to the client.
  • premasterKey a premaster key after the certificate verification is passed, and encrypts the premaster key with the public key issued by the server.
  • the client sends the encrypted pre-master key to the server.
  • S58 The client uses the currently held second key generation protocol, and generates a work key according to the pre-master key, the server random number, and the client random number.
  • S57 may be executed before or after S58, which is not specifically limited in this application.
  • the server After receiving the encrypted pre-master key, the server decrypts the pre-master key with the private key, and uses the currently held second key to generate a protocol, and generates a protocol according to the pre-master key, the random number of the server, and the client. Random number generation working key.
  • the client and the server hold the working key at the same time, and the subsequent service message can be encrypted with the key for communication.
  • the communication between the above-mentioned client and the server is achieved through the secure communication module of the client and the server, wherein the key factor includes a pre-master key, a server random number, a client terminal random number.
  • key encryption communication is performed after encryption is performed by the service message encryption modules of the client and the server.
  • an embodiment of the present invention further provides a dynamic key generation system for executing the dynamic key generation method provided by any of the foregoing embodiments.
  • FIG. 6 is a schematic structural diagram of a dynamic key generation system provided by an embodiment of the present invention.
  • the system 600 includes: a server 601 and a client 602 .
  • the server is used to perform: when a preset risk event is detected, dynamically update the first key generation protocol currently held by the server based on the risk degree of the preset risk event, and obtain a second key generation protocol;
  • the dynamically updated second key generation protocol is delivered to the client; the client is used to execute: perform key exchange with the server based on the second key generation protocol.
  • the server is further configured to: receive a key exchange request sent by the client, where the key exchange request includes the version number of the key generation protocol currently held by the client; when it is detected that the key exchange request carries When the version number of the second key generation protocol is inconsistent with the version number of the second key generation protocol, the dynamically updated second key generation protocol is delivered to the client.
  • the server is further configured to: when a preset risk event is detected, invalidate the currently held first key generation protocol, and generate a second key corresponding to the security level according to the risk degree of the preset risk event A key generation protocol; wherein, the second key generation protocol includes a preset key operator layer and a protocol body, the protocol body includes protocol logic and protocol data, and the protocol logic is used to indicate one or more used by the second key generation protocol.
  • the composition rules of multiple target key operators, and the protocol data is used to indicate the operator parameters of one or more target key operators.
  • the key operator layer includes multiple key operators and is preset on the server and the client, and the multiple key operators included in the key operator layer are pre-divided into multiple security level; and, the security level of the second key generation protocol is determined by the security level of the employed one or more target key operators.
  • the key operator layer includes: one or more key operators using a secure encryption algorithm, and/or one or more key operators using a custom variation algorithm, and/or One or more key operators using a digest algorithm.
  • system is further configured to: use white-box encryption technology to protect the security of the operator parameters.
  • the preset risk event includes at least a first preset risk event, a second preset risk event and a third preset risk event with different risk degrees; wherein the first preset risk event is used to indicate that the The proportion of the number of untrusted clients on the server side exceeds the preset threshold; the second preset risk event is used to indicate the reception of an external protocol update instruction; the third preset risk event is used to indicate the first password currently held by the server.
  • the key generation protocol works longer than the preset security period.
  • the server is connected to multiple clients, and the key exchange request sent by the client also includes device fingerprint information; the server is further used to: collect the device fingerprint information sent by each client, according to the device fingerprint information.
  • the fingerprint information determines whether each client is an untrusted client, and periodically determines whether the proportion of the number of untrusted clients connected to the server exceeds a preset threshold, wherein if the preset threshold is exceeded, the first preset is detected. risk event.
  • the preset risk event further includes a fourth preset risk event with a risk degree greater than the first preset risk event; wherein the fourth preset risk event is used to indicate that the server repeatedly detects the first preset risk event multiple times. Set up risk events.
  • the server is further configured to: when detecting that the version number carried in the key exchange request is inconsistent with the version number of the second key generation protocol, deliver the version number of the second key generation protocol to the client
  • the client is also used to: initiate a protocol update request to the server, and the protocol update request carries the version number of the second key generation protocol;
  • the server is also used to: deliver the protocol logic of the second key generation protocol to the client and protocol data;
  • the client is also used to: implement the second key generation protocol based on the preset key operator layer, protocol logic and protocol data, and re-initiate the key to the server based on the second key generation protocol exchange request.
  • the server delivers the protocol logic of the second key generation protocol to the client in a hot update manner.
  • the client is further configured to: after the dynamic update is performed based on the second key generation protocol, send a key exchange request to the server, where the key exchange request includes the second key currently held by the client to generate The version number of the protocol; the server is also used to: when detecting that the version number carried in the key exchange request is consistent with the version number of the second key generation protocol currently held by the server, generate a random number on the server, and use The random number of the server is sent to the client; the client is also used to: generate a pre-master key according to the random number of the server, and send the pre-master key to the server; The key generation protocol, pre-master key, client random number and server random number generate working keys, and encrypt communication by exchanging the respective generated working keys.
  • the client is further configured to: after generating the pre-master key according to the random number of the server, encrypt the pre-master key with the public key sent by the server, and send the encrypted pre-master key to The server side; the server side is also used for: decrypting the encrypted pre-master key by using the private key to obtain the decrypted pre-master key.
  • a computer-readable storage medium is provided, where a program is stored in the computer-readable storage medium, and when the program is executed by a processor, the processor causes the processor to perform various processes as in the foregoing embodiments, and achieve the same effects and functions.
  • embodiments of the present invention may be provided as a method, system or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • the apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include forms of non-persistent memory, random access memory (RAM) and/or non-volatile memory in computer readable media, such as read only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
  • RAM random access memory
  • ROM read only memory
  • flash RAM flash memory
  • Computer-readable media includes both persistent and non-permanent, removable and non-removable media, and storage of information may be implemented by any method or technology.
  • Information may be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
  • PRAM phase-change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read only memory
  • EEPROM Electrically Erasable Programmable Read Only Memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Circuits Of Receivers In General (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明提供了一种动态密钥生成方法和系统,该方法包括:当检测到预设风险事件时,基于预设风险事件的风险程度对服务端当前持有的第一密钥生成协议进行动态更新,获得第二密钥生成协议;服务端将动态更新后的第二密钥生成协议下发至客户端,以使客户端基于第二密钥生成协议与服务端进行密钥交换。利用上述方法,能够提高攻击者破解协议的成本,提供密钥安全性。

Description

一种动态密钥生成方法和系统
本申请要求于2020年11月27日提交的、申请号为202011356965.6、标题为“一种动态密钥生成方法和系统”的中国专利申请的优先权,该中国专利申请的公开内容以引用的方式并入本文。
技术领域
本发明属于加密通讯领域,具体涉及一种动态密钥生成方法和系统。
背景技术
本部分旨在为权利要求书中陈述的本发明的实施方式提供背景或上下文。此处的描述不因为包括在本部分中就承认是现有技术。
随着移动互联网的发展,应用程序呈现出爆炸式的增长,与此同时,互联网黑灰产业也随之诞生发展,规模达到了千亿元。互联网黑灰产业通过抓包、逆向分析等方式获取到客户端跟服务端通信的请求接口以及参数,直接伪造接口协议和参数来实现自动化操作,客户端与服务端之间的安全通讯受到了挑战。
传统技术中,出于对通讯安全的要求,市面上应用软件一般采取开源协议TLS(Transport Layer Security,传输层安全性协议)握手方案。开源协议TLS握手方案能协助客户端与服务端选择连接时所使用的加密算法、MAC算法及相关密钥。在传送应用程序的数据前,双方使用握手协议来完成上述事项。
然而,在上述开源协议TLS握手方案中,客户端需要预置一些公开的加密算法以及散列方法,因此客户端密钥生成算法固定不变,攻击者可以通过逆向破解客户端逻辑的获取这些固定的密钥生成算法,从而破解客户端与服务端端之间的加密通讯,对通讯安全造成不利影响。
发明内容
针对上述现有技术中存在的问题,提出了一种动态密钥生成方法和系统,利用这种方法和系统,能够解决上述问题。
本发明提供了以下方案。
第一方面,提供一种动态密钥生成方法,包括:当检测到预设风险事件时,基于预设风险事件的风险程度对服务端当前持有的第一密钥生成协议进行动态更新,获得第二密钥生成协议;服务端将动态更新后的第二密钥生成协议下发至客户端,以使客户端基于第二密钥生成协议与服务端进行密钥交换。
在一些实施方式中,服务端将动态更新后的第二密钥生成协议下发至客户端,方法还包括:服务端接收客户端上送的密钥交换请求,密钥交换请求包括客户端当前持有的密钥生成协议的版本号;当服务端检测到密钥交换请求携带的版本号与第二密钥生成协议的版本号不一致时,服务端将动态更新后的第二密钥生成协议下发至客户端。
在一些实施方式中,服务端基于预设风险事件的风险程度对当前持有的第一密钥生成协议进行动态更新,还包括:
当检测到预设风险事件时,服务端使当前持有的第一密钥生成协议失效,并根据预设风险事件的风险程度生成对应安全级别的第二密钥生成协议;
其中,第二密钥生成协议包括预置的密钥算子层和协议主体,协议主体包括协议逻辑以及协议数据,协议逻辑用于指示第二密钥生成协议采用的一个或多个目标密钥算子的组成规则,协议数据用于指示一个或多个目标密钥算子的算子参数的。
在一些实施方式中,密钥算子层包含多个密钥算子且预置于服务端和客户端,并且密钥算子层中包含的多个密钥算子预先被划分为多个安全等级;以及,第二密钥生成协议的安全级别由采用的一个或多个目标密钥算子的安全等级确定。
在一些实施方式中,密钥算子层包含:采用安全加密算法的一种或多种密钥算子,和/或采用自定义变化算法的一种或多种密钥算子,和/或采用摘要算法的一种或多种密钥算子。
在一些实施方式中,方法还包括:采用白盒加密技术保护算子参数的安全性。
在一些实施方式中,预设风险事件至少包括风险程度不同的第一预设风险事件、第二预设风险事件和第三预设风险事件;其中,第一预设风险事件用于指示连接至服务端的不可信客户端的数量占比超过预设阈值;第二预设风险事件用于指示接收外部发来的协议更新指令;第三预设风险事件用于指示服务端当前持有的第一密钥生成协议的工作时间超过预设安全时长。
在一些实施方式中,服务端连接至多个客户端,且客户端上送的密钥交换请求还包括设备指纹信息;方法还包括:服务端收集每个客户端上送的设备指纹信息,根据设备指纹信息判断每个客户端是否为不可信客户端,并周期性判断连接至服务端的不可信客户端的数量占比是否超过预设阈值,其中,若超过预设阈值,则检测到第一预设风险事件。
在一些实施方式中,预设风险事件还包括风险程度大于第一预设风险事件的第四预设风险事件;其中,第四预设风险事件用于指示服务端重复检测到多次第一预设风险事件。
在一些实施方式中,服务端将动态更新后的第二密钥生成协议下发至客户端,还包括:服务端将第二密钥生成协议的版本号下发至客户端;客户端向服务端发起协议更新请求,协议更新请求携带第二密钥生成协议的版本号;服务端向客户端下发第二密钥生成协议的协议逻辑和协议数据;客户端基于预置的密钥算子层、协议逻辑和协议数据,将第二密钥生成协议落地,并重新基于第二密钥生成协议向服务端发起密钥交换请求。
在一些实施方式中,服务端通过热更新方式向客户端下发第二密钥生成协议的协议逻辑。
在一些实施方式中,客户端基于第二密钥生成协议与服务端进行密钥交换,还包括:客户端向服务端发送密钥交换请求,密钥交换请求包括客户端当前持有的第二密钥生成协议的版本号;当服务端检测到密钥交换请求中携带的版本号与服务端当前持有的第二密钥生成协议的版本号一致时,生成服务端随机数,并将服务端随机数发送至客户端;客户端根据服务端随机数生成预主密钥,将预主密钥发送至服务端;客户端和服务端各自利用第二密钥生成协议、预主密钥、客户端随机数以及服务端随机数生成工作密钥;客户端和服务端通过交换各自生成的工作密钥进行加密通讯。
在一些实施方式中,方法还包括:客户端根据服务端随机数生成预主密钥之后,利用服务端下送的公钥对预主密钥进行加密,并将加密的预主密钥发送至服务端;服务端利用私钥对加密的预主密钥进行解密,得到解密的预主密钥。
第二方面,提供一种动态密钥生成系统,系统包括:服务端和客户端;其中,服务端用于执行:当检测到预设风险事件时,基于预设风险事件的风险程度对服务端当前持有的第一密钥生成协议进行动态更新,获得第二密钥生成协议;将动态更新后的第二密钥生成协议下发至客户端;客户端用于执行:基于第二密钥生成协议与服务端进行密钥交换。
在一些实施方式中,服务端还用于:接收客户端上送的密钥交换请求,密钥交换请求包括客户端当前持有的密钥生成协议的版本号;当检测到密钥交换请求携带的版本号与第二密钥生成协议的版本号不一致时,将动态更新后的第二密钥生成协议下发至客户端。
在一些实施方式中,服务端还用于:当检测到预设风险事件时,使当前持有的第一密钥生成协议失效,并根据预设风险事件的风险程度生成对应安全级别的第二密钥生成协议;其中,第二密钥生成协议包括预置的密钥算子层和协议主体,协议主体包括协议逻辑以及协议数据,协议逻辑用于指示第二密钥生成协议采用的一个或多个目标密钥算子的组成规则,协议数据用于指示一个或多个目标密钥算子的算子参数的。
在一些实施方式中,密钥算子层包含多个密钥算子且预置于服务端和客户端,并且密钥算子层中包含的多个密钥算子预先被划分为多个安全等级;以及,第二密钥生成协议的安全级别由采用的一个或多个目标密钥算子的安全等级确定。
在一些实施方式中,密钥算子层包含:采用安全加密算法的一种或多种密钥算子,和/或采用自定义变化算法的一种或多种密钥算子,和/或采用摘要算法的一种或多种密钥算子。
在一些实施方式中,系统还用于:采用白盒加密技术保护算子参数的安全性。
在一些实施方式中,预设风险事件至少包括风险程度不同的第一预设风险事件、第二预设风险事件和第三预设风险事件;其中,第一预设风险事件用于指示连接至服务端的不可信客户端的数量占比超过预设阈值;第二预设风险事件用于指示接收外部发来的协议更新指令;第三预设风险事件用于指示服务端当前持有的第一密钥生成协议的工作时间超过预设安全时长。
在一些实施方式中,服务端连接至多个客户端,且客户端上送的密钥交换请求还包括设备指纹信息;服务端还用于:收集每个客户端上送的设备指纹信息,根据设备指纹信息判断每个客户端是否为不可信客户端,并周期性判断连接至服务端的不可信客户端的数量占比是否超过预设阈值,其中,若超过预设阈值,则检测到第一预设风险事件。
在一些实施方式中,预设风险事件还包括风险程度大于第一预设风险事件的第四预设风险事件;其中,第四预设风险事件用于指示服务端重复检测到多次第一预设风险事件。
在一些实施方式中,服务端还用于:当检测到密钥交换请求携带的版本号与第二密钥生成协议的版本号不一致时,将第二密钥生成协议的版本号下发至客户端;客户端还用于:向服务端发起协议更新请求,协议更新请求携带第二密钥生成协议的版本号;服务端还用于:向客户端下发第二密钥生成协议的协议逻辑和协议数据;客户端还用于:基于预置的密钥算子层、协议逻辑和协议数据,将第二密钥生成协议落地,并重新基于第二密钥生成协议向服务端发起密钥交换请求。
在一些实施方式中,服务端通过热更新方式向客户端下发第二密钥生成协议的协议逻辑。
在一些实施方式中,客户端还用于:当基于第二密钥生成协议进行动态更新之后,向服务端发送密钥交换请求,密钥交换请求包括客户端当前持有的第二密钥生成协议的版本号;服务端还用于:当检测到密钥交换请求中携带的版本号与服务端当前持有的第二密钥生成协议的版本号一致时,生成服务端随机数,并将服务端随机数发送至客户端;客户端还用于:根据服务端随机数生成预主密钥,将预主密钥发送至服务端;客户端和服务端还用于:各自 利用第二密钥生成协议、预主密钥、客户端随机数以及服务端随机数生成工作密钥,通过交换各自生成的工作密钥进行加密通讯。
在一些实施方式中,客户端还用于:根据服务端随机数生成预主密钥之后,利用服务端下送的公钥对预主密钥进行加密,并将加密的预主密钥发送至服务端;服务端还用于:利用私钥对加密的预主密钥进行解密,得到解密的预主密钥。
第三方面,提供一种计算机可读存储介质,计算机可读存储介质存储有程序,当所述程序被处理器执行时,使得所述处理器执行如第一方面的方法。
本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:本实施例中,服务端可以基于预设风控机制而动态更新服务端持有的密钥生成协议并下发至客户端,客户端根据服务端下发的该动态更新的密钥生成协议与服务端进行密钥交换,从而提高攻击者破解协议的成本,提供密钥安全性。
应当理解,上述说明仅是本发明技术方案的概述,以便能够更清楚地了解本发明的技术手段,从而可依照说明书的内容予以实施。为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举例说明本发明的具体实施方式。
附图说明
通过阅读下文的示例性实施例的详细描述,本领域普通技术人员将明白本文所述的优点和益处以及其他优点和益处。附图仅用于示出示例性实施例的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的标号表示相同的部件。在附图中:
图1为根据本发明一实施例的动态密钥生成方法的流程示意图;
图2为根据本发明一实施例的密钥生成协议的示意图;
图3为根据本发明一实施例的动态密钥生成系统的示意图;
图4为根据本发明一实施例的更新密钥生成协议的时序示意图;
图5为根据本发明一实施例的生成动态密钥的时序示意图;
图6为根据本发明一实施例的动态密钥生成系统的示意图。
在附图中,相同或对应的标号表示相同或对应的部分。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。 相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
在本发明中,应理解,诸如“包括”或“具有”等术语旨在指示本说明书中所公开的特征、数字、步骤、行为、部件、部分或其组合的存在,并且不旨在排除一个或多个其他特征、数字、步骤、行为、部件、部分或其组合存在的可能性。
另外还需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本发明。
针对现有技术方案的缺点,本发明实施例提出一种动态密钥生成方法,下面,首先对方法的发明构思进行介绍。
服务端对环境中的风险情况进行检测,当检测到预设风险事件时,基于该预设风险事件的风险程度对当前持有的第一密钥生成协议进行动态更新,获得第二密钥生成协议。基于此,服务端将动态更新后的第二密钥生成协议下发至客户端,以使客户端基于第二密钥生成协议与服务端进行密钥交换。换言之,服务端可以基于预设风控机制而动态更新服务端持有的密钥生成协议,并下发至客户端,客户端和服务端基于动态更新的密钥生成协议进行数据交换,从而提高攻击者破解协议的成本,提高通信安全性能。
本领域技术人员可以理解,所描述的应用场景仅是本发明的实施方式可以在其中得以实现的一个示例。本发明实施方式的适用范围不受任何限制。在介绍了本发明的基本原理之后,下面具体介绍本发明的各种非限制性实施方式。
图1为根据本申请一实施例的动态密钥生成方法100的流程示意图。
如图1所示,该方法100可以包括步骤101和步骤102。
步骤101、当检测到预设风险事件时,服务端基于预设风险事件的风险程度对当前持有的第一密钥生成协议进行动态更新,获得第二密钥生成协议。
其中,该预设风险事件是指可能对服务端和客户端当前持有的密钥生成协议的安全性造成风险的事件。例如,该预设风险事件可以是连接至服务端的客户端为不可信客户端,还可以是当前持有的密钥生成协议的工作时间超过安全时长阈值,诸如此类。
在一种可能的实施方式中,在上述步骤101中,服务端基于预设风险事件的风险程度对当前持有的第一密钥生成协议进行动态更新还可以包括:当检测到预设风险事件时,服务端使当前持有的第一密钥生成协议失效,并根据预设风险事件的风险程度生成对应安全级别的第二密钥生成协议。
可以理解,基于在先经验、历史统计数据等风险程度判断因素,可以将多种类型的预设风险事件按照风险程度分为多个级别,比如检测到的某一预设风险事件指示当前持有的密钥 生成协议已被攻破时,则可以认为该预设风险事件为一级风险事件。又比如检测到的另一预设风险事件指示当前持有的密钥生成协议可能存在被攻破风险时,则可以认为该预设风险事件为二级风险事件。又比如检测到的预设风险事件指示当前持有的密钥生成协议的工作时间已经超过安全时长阈值,则可以认为该预设风险事件为三级风险事件,诸如此类。基于此,可以生成安全级别对应于该风险程度的第二密钥生成协议,从而持续提高攻击者破解密钥生成协议的成本。
其中,第二密钥生成协议包括预置的密钥算子层和协议主体,协议主体包括协议逻辑以及协议数据,协议逻辑用于指示第二密钥生成协议采用的一个或多个目标密钥算子的组成规则,协议数据用于指示一个或多个目标密钥算子的算子参数。
具体来说,在服务端和客户端均预置包含多种密钥算子的密钥算子层。可选地,密钥算子层包含:采用诸如AES、SM4的安全加密算法的一种或多种密钥算子,和/或采用诸如矩阵乘法算法、大数取余算法的自定义变化算法的一种或多种密钥算子,和/或采用诸如SHA256、SM3的摘要算法的一种或多种密钥算子。
举例来说,图2示出一种密钥生成协议的示例,其包含预置的密钥算子层和动态生成的协议主体,其中预置的密钥算子层包含AES变换算子、矩阵变换算子和SHA变换算子等密钥算子等。动态生成的协议主体部分包括逻辑区和数据区,逻辑区包括协议逻辑,其用于指示该密钥生成协议所采用目标密钥算子的组成规则与顺序,该部分内容可通过热更新的方式下发至客户端。数据区包含密钥算子层中各级密钥算子的算子参数。可选地,其中一些密钥算子的算子参数可以是白盒数据,另外一些密钥算子的算子参数可以是明文参数。
在一种可能的实施方式中,密钥算子层包含多个密钥算子且同时预置于服务端和客户端,并且密钥算子层中包含的多个密钥算子预先被划分为多个安全等级;以及,第二密钥生成协议的安全级别由采用的一个或多个目标密钥算子的安全等级确定。
举例来说,可以按照各个密钥算子的变换安全性将密钥算子层中的多种密钥算子分为一级算子、二级算子、三级算子。其中,一级算子可表示安全等级最高的算子,接受密钥因子和算子参数作为输入,采用诸如AES算法、SM4算法等安全加密算法来保护变换结果的安全性。二级算子可表示安全等级仅次于一级的算子,其接受密钥因子和算子参数作为输入,并采用诸如矩阵乘法算法、大数取余算法等自定义变化算法来保护变换结果的安全性。二级算子相较于一级算子具有更简单的算法,对客户端的性能要求更低。可选地,可采用白盒技术保护一级算子和二级算子的算子参数的安全性。三级算子可表示安全等级较弱的算子,其接受密钥因子和算子参数作为输入,可采用先用的摘要算法保护变换结果的安全性,其中摘要算法的算子参数为摘要算法的盐,摘要算法比如可以是SHA256、SM3等。三级算子算法相较 于一、二级算子则更为简单,对客户端性能要求更低。基于此,可以理解,当第二密钥生成协议采用一级算子作为目标密钥算子,相较于采用二级算子具有更高的安全等级。当第二密钥生成协议组合采用一、二级算子作为目标密钥算子,相较于单独采用一级算子具有更高的安全等级。因此可以由采用的一个或多个目标密钥算子的安全等级确定第二密钥生成协议的安全级别,并根据检测到的预设风险事件的风险程度生成对应安全级别的第二密钥生成协议。
在一种可能的实施方式中,方法还包括:采用白盒加密技术保护算子参数的安全性。
举例来说,参考图2,其中的AES变换算子和矩阵变换算子的算子参数采用白盒数据形式保存。
在一种可能的实施方式中,预设风险事件至少包括风险程度不同的第一预设风险事件、第二预设风险事件和第三预设风险事件;该第一预设风险事件可以用于指示连接至服务端的不可信客户端的数量占比超过预设阈值;第二预设风险事件用于指示接收外部发来的协议更新指令;第三预设风险事件用于指示服务端当前持有的第一密钥生成协议的工作时间超过预设安全时长。
举例来说,参考图3,可以在服务端设置风控模块,该风控模块设置有多个风险驱动单元,比如第一风险驱动单元、第二风险驱动单元和第三风险驱动单元。基于此,比如,第一风险驱动单元检测到第一预设风险事件发生时,也即检测到连接至服务端的不可信客户端的数量占比超过预设阈值时,驱动强制更新该服务端当前持有的第一密钥生成协议,动态更新后的第二密钥生成协议可以由AES算子(一级算子)、矩阵变化算子(二级算子)和SHA变换算子(三级算子)组合参与。可选地,若第一风险驱动单元检测到第一预设风险事件重复发生时,则更新后的第二密钥生成协议可以包含增加数量的AES变换算子。又比如,在业务方需要上线安全性要求较高的业务之前,向服务端发送协议更新指令(即发生该第二预设风险事件),第二风险驱动单元检测到第二预设风险事件发生,驱动强制更新该服务端当前持有的第一密钥生成协议,动态更新后的第二密钥生成协议可以由矩阵变化算子(二级算子)和SHA变换算子(三级算子)组合参与。又比如,第一密钥生成协议的工作时间超过预设安全时长(即发生该第三预设风险事件),第三风险驱动单元检测到该第三预设风险事件,驱动强制更新该服务端当前持有的第一密钥生成协议,动态更新后的第二密钥生成协议可以由SHA变换算子(三级算子)参与。可以看出,第一预设风险事件、第二预设风险事件和第三预设风险事件的风险程度依次递减,动态更新后生成的第二密钥生成协议的安全级别也相应依次递减。
在一种可能的实施方式中,服务端连接至多个客户端,且客户端上送的密钥交换请求还包括设备指纹信息;方法还包括:服务端收集每个客户端上送的设备指纹信息,根据设备指 纹信息判断每个客户端是否为不可信客户端,并周期性判断连接至服务端的不可信客户端的数量占比是否超过预设阈值,其中,若超过预设阈值,则检测到第一预设风险事件。
在一种可能的实施方式中,预设风险事件还包括风险程度大于第一预设风险事件的第四预设风险事件;其中,第四预设风险事件用于指示服务端检测到重复多次的第一预设风险事件。举例来说,当检测到第一预设风险事件重复多次发生时,驱动强制更新该服务端当前持有的第一密钥生成协议,动态更新后的第二密钥生成协议可以由多个AES算子(一级算子)、矩阵变化算子(二级算子)和SHA变换算子(三级算子)组合参与。由此具有更高的安全级别。
步骤102、服务端将动态更新后的第二密钥生成协议下发至客户端,以使客户端基于第二密钥生成协议与服务端进行密钥交换。
在一种可能的实施方式中,步骤102中的服务端将动态更新后的第二密钥生成协议下发至客户端,还包括:服务端接收客户端上送的密钥交换请求,密钥交换请求包括客户端当前持有的密钥生成协议的版本号;当服务端判断密钥交换请求携带的版本号与第二密钥生成协议的版本号不一致时,服务端将动态更新后的第二密钥生成协议下发至客户端。
相反,当服务端判断客户端上送的密钥交换请求携带的版本号与第二密钥生成协议的版本号一致时,则说明客户端和服务端的密钥生成协议是一致的,则服务端无需进一步向客户端下发其持有的第二密钥生成协议。
在一种可能的实施方式中,上述服务端将动态更新后的第二密钥生成协议下发至客户端,还可以进一步包括:服务端将第二密钥生成协议的版本号下发至客户端;客户端向服务端发起协议更新请求,协议更新请求携带第二密钥生成协议的版本号;服务端向客户端下发对应于第二密钥生成协议的协议逻辑和协议数据;客户端基于预置的密钥算子层、协议逻辑和协议数据,将第二密钥生成协议落地,并重新基于第二密钥生成协议向服务端发起密钥交换请求。
在一种可能的实施方式中,服务端通过热更新方式向客户端下发第二密钥生成协议的协议逻辑。
举例来说,参考图3,服务端向客户端下发的协议逻辑是热更新JS文件,客户端在接收到该热更新JS文件之后转为热更新模块,并进一步结合接收到的协议数据、预置的密钥算子层生成更新后的第二密钥生成协议。
图4示出对服务端和客户端持有的密钥生成协议依次进行更新的流程示意图。参考图3,图4所示出客户端和服务端之间的通信均是通过图3中的安全通讯模块而实现的。
S41、服务端将当前持有的第一密钥生成协议置为失效状态,同时生成第二密钥生成协议、热更新补丁以及白盒跳转表。
S42、客户端生成客户端随机数。其中,上述S41可以在S42之前或之后,本申请对此不作具体限制。
S43、客户端向服务端发起密钥交换请求,密钥交换请求包括:客户端当前持有的密钥生成协议的版本号、客户端随机数以及设备指纹信息。
S44、服务端收到密钥交换请求,判断密钥交换请求携带的版本号已过期,则终止当前密钥交换请求。
S45、将动态更新后持有的第二密钥生成协议的版本号和证书下发至客户端。
S46、客户端收到对接收的证书进行验证。
S47、客户端在证书验证通过之后向服务端发起协议更新请求,该协议更新请求携带该第二密钥生成协议的版本号且用于请求热更新文件以及白盒跳转表。
S48、服务端根据客户端上送的版本号,下发第二密钥生成协议对应的热更新js文件(例如,通过协议逻辑模块)以及算子参数(例如,通过协议数据模块)。
S49、客户端收到热更新js文件和算子参数后,基于预置的密钥算子层执行热更新,并存储第二密钥生成协议的版本号、热更新文件以及白盒跳转表。
S50、客户端和服务端基于当前持有的第二密钥生成协议进行密钥交换。
在一种可能的实施方式中,客户端基于第二密钥生成协议与服务端进行密钥交换,还包括:客户端向服务端发送密钥交换请求,密钥交换请求包括客户端当前持有的第二密钥生成协议的版本号;当服务端检测到密钥交换请求中携带的版本号与服务端当前持有的第二密钥生成协议的版本号一致时,生成服务端随机数,并将服务端随机数发送至客户端;客户端根据服务端随机数生成预主密钥,将预主密钥发送至服务端;客户端和服务端各自利用第二密钥生成协议、预主密钥、客户端随机数以及服务端随机数生成工作密钥;客户端和服务端通过交换各自生成的工作密钥进行加密通讯。
在一种可能的实施方式中,方法还包括:客户端根据服务端随机数生成预主密钥之后,利用服务端下送的公钥对预主密钥进行加密,并将加密的预主密钥发送至服务端;服务端利用私钥对加密的预主密钥进行解密,得到解密的预主密钥。
举例来说,客户端与服务端同时持有动态更新后的第二密钥生成协议后,服务端和客户端通过基于该第二密钥生成协议各自生成最终的工作密钥(Skey),具体密钥生成工作过程如图5所示,包括:
S51、客户端生成客户端随机数(cliRand)。
S52、客户端向服务端发起密钥交换请求,上送客户端随机数、协议版本号、以及设备信息。
S53、服务端收到客户端请求信息后,判断协议版本号为最新版本号,生成服务端随机数(srvRand)。
S54、服务端将服务端随机数(srvRand)、第二密钥生成协议的版本号、证书下发至客户端。
S55、客户端收到服务端随机数后,对证书进行验证。
S56、客户端在证书验证通过之后生成预主密钥(premasterKey),并用服务端下发的公钥加密预主密钥。
S57、客户端将加密的预主密钥上送至服务端。
S58、客户端利用当前持有的第二密钥生成协议,并根据预主密钥、服务端随机数、客户端随机数生成工作密钥。其中,S57可以在S58之前或之后执行,本申请对此不作具体限制。
S59、服务端收到加密的预主密钥后,用私钥解密预主密钥,并使用当前持有的第二密钥生成协议,并根据预主密钥、服务端随机数、客户端随机数生成工作密钥。
S60、客户端和服务端同时持有工作密钥,后续业务报文可以进行密钥加密通讯。
参考图3,在S60之前,上述客户端和服务端之间的通信均是通过客户端和服务端的安全通讯模块而实现的,其中,密钥因子包括预主密钥、服务端随机数、客户端随机数。S60之后,通过客户端和服务器的业务报文加密模块进行加密之后进行密钥加密通讯。
基于相同的技术构思,本发明实施例还提供一种动态密钥生成系统,用于执行上述任一实施例所提供的动态密钥生成方法。图6为本发明实施例提供的一种动态密钥生成系统的结构示意图。
如图6所示,系统600包括:服务端601和客户端602。其中,服务端用于执行:当检测到预设风险事件时,基于预设风险事件的风险程度对服务端当前持有的第一密钥生成协议进行动态更新,获得第二密钥生成协议;将动态更新后的第二密钥生成协议下发至客户端;客户端用于执行:基于第二密钥生成协议与服务端进行密钥交换。
在一些实施方式中,服务端还用于:接收客户端上送的密钥交换请求,密钥交换请求包括客户端当前持有的密钥生成协议的版本号;当检测到密钥交换请求携带的版本号与第二密钥生成协议的版本号不一致时,将动态更新后的第二密钥生成协议下发至客户端。
在一些实施方式中,服务端还用于:当检测到预设风险事件时,使当前持有的第一密钥生成协议失效,并根据预设风险事件的风险程度生成对应安全级别的第二密钥生成协议;其 中,第二密钥生成协议包括预置的密钥算子层和协议主体,协议主体包括协议逻辑以及协议数据,协议逻辑用于指示第二密钥生成协议采用的一个或多个目标密钥算子的组成规则,协议数据用于指示一个或多个目标密钥算子的算子参数的。
在一些实施方式中,密钥算子层包含多个密钥算子且预置于服务端和客户端,并且密钥算子层中包含的多个密钥算子预先被划分为多个安全等级;以及,第二密钥生成协议的安全级别由采用的一个或多个目标密钥算子的安全等级确定。
在一些实施方式中,密钥算子层包含:采用安全加密算法的一种或多种密钥算子,和/或采用自定义变化算法的一种或多种密钥算子,和/或采用摘要算法的一种或多种密钥算子。
在一些实施方式中,系统还用于:采用白盒加密技术保护算子参数的安全性。
在一些实施方式中,预设风险事件至少包括风险程度不同的第一预设风险事件、第二预设风险事件和第三预设风险事件;其中,第一预设风险事件用于指示连接至服务端的不可信客户端的数量占比超过预设阈值;第二预设风险事件用于指示接收外部发来的协议更新指令;第三预设风险事件用于指示服务端当前持有的第一密钥生成协议的工作时间超过预设安全时长。
在一些实施方式中,服务端连接至多个客户端,且客户端上送的密钥交换请求还包括设备指纹信息;服务端还用于:收集每个客户端上送的设备指纹信息,根据设备指纹信息判断每个客户端是否为不可信客户端,并周期性判断连接至服务端的不可信客户端的数量占比是否超过预设阈值,其中,若超过预设阈值,则检测到第一预设风险事件。
在一些实施方式中,预设风险事件还包括风险程度大于第一预设风险事件的第四预设风险事件;其中,第四预设风险事件用于指示服务端重复检测到多次第一预设风险事件。
在一些实施方式中,服务端还用于:当检测到密钥交换请求携带的版本号与第二密钥生成协议的版本号不一致时,将第二密钥生成协议的版本号下发至客户端;客户端还用于:向服务端发起协议更新请求,协议更新请求携带第二密钥生成协议的版本号;服务端还用于:向客户端下发第二密钥生成协议的协议逻辑和协议数据;客户端还用于:基于预置的密钥算子层、协议逻辑和协议数据,将第二密钥生成协议落地,并重新基于第二密钥生成协议向服务端发起密钥交换请求。
在一些实施方式中,服务端通过热更新方式向客户端下发第二密钥生成协议的协议逻辑。
在一些实施方式中,客户端还用于:当基于第二密钥生成协议进行动态更新之后,向服务端发送密钥交换请求,密钥交换请求包括客户端当前持有的第二密钥生成协议的版本号;服务端还用于:当检测到密钥交换请求中携带的版本号与服务端当前持有的第二密钥生成协议的版本号一致时,生成服务端随机数,并将服务端随机数发送至客户端;客户端还用于: 根据服务端随机数生成预主密钥,将预主密钥发送至服务端;客户端和服务端还用于:各自利用第二密钥生成协议、预主密钥、客户端随机数以及服务端随机数生成工作密钥,通过交换各自生成的工作密钥进行加密通讯。
在一些实施方式中,客户端还用于:根据服务端随机数生成预主密钥之后,利用服务端下送的公钥对预主密钥进行加密,并将加密的预主密钥发送至服务端;服务端还用于:利用私钥对加密的预主密钥进行解密,得到解密的预主密钥。
需要说明的是,本申请实施例中的系统可以实现前述方法的实施例的各个过程,并达到相同的效果和功能,这里不再赘述。
提供一种计算机可读存储介质,计算机可读存储介质存储有程序,当所述程序被处理器执行时,使得所述处理器执行如前述实施例的各个过程,并达到相同的效果和功能。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。此外,尽管在附图中以特定顺序描述了本发明方法的操作,但是,这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。
虽然已经参考若干具体实施方式描述了本发明的精神和原理,但是应该理解,本发明并不限于所公开的具体实施方式,对各方面的划分也不意味着这些方面中的特征不能组合以进行受益,这种划分仅是为了表述的方便。本发明旨在涵盖所附权利要求的精神和范围内所包括的各种修改和等同布置。

Claims (27)

  1. 一种动态密钥生成方法,其特征在于,所述方法包括:
    当检测到预设风险事件时,基于所述预设风险事件的风险程度对所述服务端当前持有的第一密钥生成协议进行动态更新,获得第二密钥生成协议;
    所述服务端将动态更新后的所述第二密钥生成协议下发至客户端,以使所述客户端基于所述第二密钥生成协议与所述服务端进行密钥交换。
  2. 根据权利要求1所述的方法,其特征在于,所述服务端将动态更新后的所述第二密钥生成协议下发至客户端,所述方法还包括:
    所述服务端接收所述客户端上送的密钥交换请求,所述密钥交换请求包括所述客户端当前持有的密钥生成协议的版本号;
    当所述服务端检测到所述密钥交换请求携带的版本号与所述第二密钥生成协议的版本号不一致时,所述服务端将动态更新后的所述第二密钥生成协议下发至所述客户端。
  3. 根据权利要求1或2所述的方法,其特征在于,所述服务端基于所述预设风险事件的风险程度对当前持有的第一密钥生成协议进行动态更新,还包括:
    当检测到所述预设风险事件时,所述服务端使当前持有的所述第一密钥生成协议失效,并根据所述预设风险事件的风险程度生成对应安全级别的第二密钥生成协议;
    其中,所述第二密钥生成协议包括预置的密钥算子层和协议主体,所述协议主体包括协议逻辑以及协议数据,所述协议逻辑用于指示所述第二密钥生成协议采用的一个或多个目标密钥算子的组成规则,所述协议数据用于指示所述一个或多个目标密钥算子的算子参数。
  4. 根据权利要求3所述的方法,其特征在于,所述密钥算子层包含多个密钥算子且预置于所述服务端和所述客户端,并且所述密钥算子层中包含的多个密钥算子预先被划分为多个安全等级;以及,所述第二密钥生成协议的安全级别由采用的所述一个或多个目标密钥算子的安全等级确定。
  5. 根据权利要求4所述的方法,其特征在于,
    所述密钥算子层包含:采用安全加密算法的一种或多种密钥算子,和/或采用自定义变化算法的一种或多种密钥算子,和/或采用摘要算法的一种或多种密钥算子。
  6. 根据权利要求3-5中任一项所述的方法,其特征在于,所述方法还包括:采用白盒加密技术保护所述算子参数的安全性。
  7. 根据权利要求3-6中任一项所述的方法,其特征在于,所述预设风险事件至少包括风险程度不同的第一预设风险事件、第二预设风险事件和第三预设风险事件;其中,
    所述第一预设风险事件用于指示连接至所述服务端的不可信客户端的数量占比超过预设阈值;
    所述第二预设风险事件用于指示接收外部发来的协议更新指令;
    所述第三预设风险事件用于指示所述服务端当前持有的所述第一密钥生成协议的工作时间超过预设安全时长。
  8. 根据权利要求7所述的方法,其特征在于,所述服务端连接至多个所述客户端,且所述客户端上送的所述密钥交换请求还包括设备指纹信息;所述方法还包括:
    所述服务端收集每个所述客户端上送的所述设备指纹信息,根据所述设备指纹信息判断每个所述客户端是否为不可信客户端,并周期性判断连接至所述服务端的所述不可信客户端的数量占比是否超过所述预设阈值,其中,若超过所述预设阈值,则检测到所述第一预设风险事件。
  9. 根据权利要求7或8所述的方法,其特征在于,所述预设风险事件还包括风险程度大于所述第一预设风险事件的第四预设风险事件;其中,
    所述第四预设风险事件用于指示所述服务端重复检测到多次所述第一预设风险事件。
  10. 根据权利要求3-9中任一项所述的方法,其特征在于,所述服务端将动态更新后的所述第二密钥生成协议下发至客户端,还包括:
    所述服务端将所述第二密钥生成协议的版本号下发至所述客户端;
    所述客户端向所述服务端发起协议更新请求,所述协议更新请求携带所述第二密钥生成协议的版本号;
    所述服务端向所述客户端下发所述第二密钥生成协议的所述协议逻辑和所述协议数据;
    所述客户端基于预置的密钥算子层、所述协议逻辑和所述协议数据,将所述第二密钥生成协议落地,并重新基于所述第二密钥生成协议向所述服务端发起所述密钥交换请求。
  11. 根据权利要求10所述的方法,其特征在于,所述服务端通过热更新方式向所述客户端下发所述第二密钥生成协议的协议逻辑。
  12. 根据权利要求1-11中任一项所述的方法,其特征在于,所述客户端基于所述第二密钥生成协议与所述服务端进行密钥交换,还包括:
    所述客户端向所述服务端发送密钥交换请求,所述密钥交换请求包括所述客户端当前持有的所述第二密钥生成协议的版本号;
    当所述服务端检测到所述密钥交换请求中携带的版本号与所述服务端当前持有的所述第二密钥生成协议的版本号一致时,生成服务端随机数,并将所述服务端随机数发送至所述客户端;
    所述客户端根据所述服务端随机数生成预主密钥,将所述预主密钥发送至所述服务端;
    所述客户端和所述服务端各自利用所述第二密钥生成协议、所述预主密钥、所述客户端随机数以及所述服务端随机数生成工作密钥;
    所述客户端和所述服务端通过交换各自生成的所述工作密钥进行加密通讯。
  13. 根据权利要求12所述的方法,其特征在于,所述方法还包括:
    所述客户端根据所述服务端随机数生成所述预主密钥之后,利用所述服务端下送的公钥对所述预主密钥进行加密,并将加密的所述预主密钥发送至所述服务端;
    所述服务端利用私钥对加密的所述预主密钥进行解密,得到解密的所述预主密钥。
  14. 一种动态密钥生成系统,其特征在于,所述系统包括:服务端和客户端;其中,
    所述服务端用于执行:当检测到预设风险事件时,基于所述预设风险事件的风险程度对所述服务端当前持有的第一密钥生成协议进行动态更新,获得第二密钥生成协议;将动态更新后的所述第二密钥生成协议下发至客户端;
    所述客户端用于执行:基于所述第二密钥生成协议与所述服务端进行密钥交换。
  15. 根据权利要求14所述的系统,其特征在于,
    所述服务端还用于:接收所述客户端上送的密钥交换请求,所述密钥交换请求包括所述客户端当前持有的密钥生成协议的版本号;当检测到所述密钥交换请求携带的版本号与所述第二密钥生成协议的版本号不一致时,将动态更新后的所述第二密钥生成协议下发至所述客户端。
  16. 根据权利要求14或15所述的系统,其特征在于,
    所述服务端还用于:当检测到所述预设风险事件时,使当前持有的所述第一密钥生成协议失效,并根据所述预设风险事件的风险程度生成对应安全级别的第二密钥生成协议;
    其中,所述第二密钥生成协议包括预置的密钥算子层和协议主体,所述协议主体包括协议逻辑以及协议数据,所述协议逻辑用于指示所述第二密钥生成协议采用的一个或多个目标密钥算子的组成规则,所述协议数据用于指示所述一个或多个目标密钥算子的算子参数的。
  17. 根据权利要求16所述的系统,其特征在于,所述密钥算子层包含多个密钥算子且预置于所述服务端和所述客户端,并且所述密钥算子层中包含的多个密钥算子预先被划分为多个安全等级;以及,所述第二密钥生成协议的安全级别由采用的所述一个或多个目标密钥算子的安全等级确定。
  18. 根据权利要求17所述的系统,其特征在于,
    所述密钥算子层包含:采用安全加密算法的一种或多种密钥算子,和/或采用自定义变化算法的一种或多种密钥算子,和/或采用摘要算法的一种或多种密钥算子。
  19. 根据权利要求16-18中任一项所述的系统,其特征在于,
    所述系统还用于:采用白盒加密技术保护所述算子参数的安全性。
  20. 根据权利要求16-19中任一项所述的系统,其特征在于,所述预设风险事件至少包括风险程度不同的第一预设风险事件、第二预设风险事件和第三预设风险事件;其中,
    所述第一预设风险事件用于指示连接至所述服务端的不可信客户端的数量占比超过预设阈值;
    所述第二预设风险事件用于指示接收外部发来的协议更新指令;
    所述第三预设风险事件用于指示所述服务端当前持有的所述第一密钥生成协议的工作时间超过预设安全时长。
  21. 根据权利要求20所述的系统,其特征在于,所述服务端连接至多个所述客户端,且所述客户端上送的所述密钥交换请求还包括设备指纹信息;
    所述服务端还用于:收集每个所述客户端上送的所述设备指纹信息,根据所述设备指纹信息判断每个所述客户端是否为不可信客户端,并周期性判断连接至所述服务端的所述不可信客户端的数量占比是否超过所述预设阈值,其中,若超过所述预设阈值,则检测到所述第一预设风险事件。
  22. 根据权利要求20或21所述的系统,其特征在于,所述预设风险事件还包括风险程度大于所述第一预设风险事件的第四预设风险事件;其中,
    所述第四预设风险事件用于指示所述服务端重复检测到多次所述第一预设风险事件。
  23. 根据权利要求16-22中任一项所述的系统,其特征在于,
    所述服务端还用于:当检测到所述密钥交换请求携带的版本号与所述第二密钥生成协议的版本号不一致时,将所述第二密钥生成协议的版本号下发至所述客户端;
    所述客户端还用于:向所述服务端发起协议更新请求,所述协议更新请求携带所述第二密钥生成协议的版本号;
    所述服务端还用于:向所述客户端下发所述第二密钥生成协议的所述协议逻辑和所述协议数据;
    所述客户端还用于:基于预置的密钥算子层、所述协议逻辑和所述协议数据,将所述第二密钥生成协议落地,并重新基于所述第二密钥生成协议向所述服务端发起所述密钥交换请求。
  24. 根据权利要求23所述的系统,其特征在于,所述服务端通过热更新方式向所述客户端下发所述第二密钥生成协议的协议逻辑。
  25. 根据权利要求14-24中任一项所述的系统,其特征在于,
    所述客户端还用于:当基于所述第二密钥生成协议进行动态更新之后,向所述服务端发送密钥交换请求,所述密钥交换请求包括所述客户端当前持有的所述第二密钥生成协议的版本号;
    所述服务端还用于:当检测到所述密钥交换请求中携带的版本号与所述服务端当前持有的所述第二密钥生成协议的版本号一致时,生成服务端随机数,并将所述服务端随机数发送至所述客户端;
    所述客户端还用于:根据所述服务端随机数生成预主密钥,将所述预主密钥发送至所述服务端;
    所述客户端和所述服务端还用于:各自利用所述第二密钥生成协议、所述预主密钥、所述客户端随机数以及所述服务端随机数生成工作密钥,通过交换各自生成的所述工作密钥进行加密通讯。
  26. 根据权利要求25所述的系统,其特征在于,
    所述客户端还用于:根据所述服务端随机数生成所述预主密钥之后,利用所述服务端下送的公钥对所述预主密钥进行加密,并将加密的所述预主密钥发送至所述服务端;
    所述服务端还用于:利用私钥对加密的所述预主密钥进行解密,得到解密的所述预主密钥。
  27. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有程序,当所述程序被处理器执行时,使得所述处理器执行如权利要求1-13中任一项所述的方法。
PCT/CN2021/117514 2020-11-27 2021-09-09 一种动态密钥生成方法和系统 Ceased WO2022110968A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011356965.6 2020-11-27
CN202011356965.6A CN112543100B (zh) 2020-11-27 2020-11-27 一种动态密钥生成方法和系统

Publications (1)

Publication Number Publication Date
WO2022110968A1 true WO2022110968A1 (zh) 2022-06-02

Family

ID=75016986

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/117514 Ceased WO2022110968A1 (zh) 2020-11-27 2021-09-09 一种动态密钥生成方法和系统

Country Status (3)

Country Link
CN (1) CN112543100B (zh)
TW (1) TWI787974B (zh)
WO (1) WO2022110968A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117040944A (zh) * 2023-10-10 2023-11-10 深圳市旗云智能科技有限公司 无线物联网远程信号传输装置
CN117668887A (zh) * 2024-01-31 2024-03-08 南湖实验室 一种基于机密计算的同态加密安全与性能自定义平衡方法
CN120217353A (zh) * 2025-02-27 2025-06-27 江苏禾冠信息技术有限公司 一种智能化密码自动提取与安全存储方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114024724B (zh) * 2021-10-25 2023-06-13 四川启睿克科技有限公司 一种基于物联网的对称密钥动态生成方法
CN120856336B (zh) * 2025-09-22 2026-01-09 云账户技术(天津)有限公司 密钥安全管理方法、装置、电子设备、介质及程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127595A (zh) * 2006-08-15 2008-02-20 华为技术有限公司 一种实现多方通信安全的方法、系统及设备
CN106533659A (zh) * 2015-09-14 2017-03-22 北京中质信维科技有限公司 一种密钥更新方法和系统
US20180115414A1 (en) * 2015-04-30 2018-04-26 Nippon Telegraph And Telephone Corporation Data transmission and reception method and system
CN108040071A (zh) * 2017-12-30 2018-05-15 深圳市潮流网络技术有限公司 一种VoIP音视频加密密钥动态切换方法
CN111988143A (zh) * 2020-08-28 2020-11-24 百度时代网络技术(北京)有限公司 密钥更新方法、装置、设备以及存储介质

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100321716B1 (ko) * 1998-12-08 2002-03-08 이계철 인증시스템에서의키인증방법
US7591012B2 (en) * 2004-03-02 2009-09-15 Microsoft Corporation Dynamic negotiation of encryption protocols
US20060126836A1 (en) * 2004-12-10 2006-06-15 Hector Rivas System and method for dynamic generation of encryption keys
CN101515876B (zh) * 2008-02-18 2011-11-23 财团法人工业技术研究院 双模式无线检测器网络的密钥建立与事件处理方法及系统
JP5288901B2 (ja) * 2008-06-23 2013-09-11 三菱電機株式会社 鍵管理サーバ、端末、通信システム、鍵配信方法、鍵配信プログラム、鍵受信方法及び鍵受信プログラム
US20120309354A1 (en) * 2011-06-06 2012-12-06 Syracuse University Situation aware security system and method for mobile devices
WO2014029951A1 (en) * 2012-08-21 2014-02-27 Senta Technologies Limited A cryptography system
CN107347058B (zh) * 2016-05-06 2021-07-23 阿里巴巴集团控股有限公司 数据加密方法、数据解密方法、装置及系统
CN106100834B (zh) * 2016-06-22 2019-07-19 咪付(深圳)网络技术有限公司 一种算法密钥库的生成和更新方法
CN109743176B (zh) * 2018-12-28 2020-07-28 百富计算机技术(深圳)有限公司 一种pos终端的证书更新方法、服务器及pos终端
CN111756524B (zh) * 2019-03-26 2024-07-23 深圳市网安计算机安全检测技术有限公司 动态群组密钥生成方法、装置、计算机设备及存储介质
CN111740844A (zh) * 2020-06-24 2020-10-02 上海缔安科技股份有限公司 基于硬件的国密算法的ssl通信方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127595A (zh) * 2006-08-15 2008-02-20 华为技术有限公司 一种实现多方通信安全的方法、系统及设备
US20180115414A1 (en) * 2015-04-30 2018-04-26 Nippon Telegraph And Telephone Corporation Data transmission and reception method and system
CN106533659A (zh) * 2015-09-14 2017-03-22 北京中质信维科技有限公司 一种密钥更新方法和系统
CN108040071A (zh) * 2017-12-30 2018-05-15 深圳市潮流网络技术有限公司 一种VoIP音视频加密密钥动态切换方法
CN111988143A (zh) * 2020-08-28 2020-11-24 百度时代网络技术(北京)有限公司 密钥更新方法、装置、设备以及存储介质

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117040944A (zh) * 2023-10-10 2023-11-10 深圳市旗云智能科技有限公司 无线物联网远程信号传输装置
CN117040944B (zh) * 2023-10-10 2024-04-26 深圳市旗云智能科技有限公司 无线物联网远程信号传输装置
CN117668887A (zh) * 2024-01-31 2024-03-08 南湖实验室 一种基于机密计算的同态加密安全与性能自定义平衡方法
CN117668887B (zh) * 2024-01-31 2024-05-31 南湖实验室 一种基于机密计算的同态加密安全与性能自定义平衡方法
CN120217353A (zh) * 2025-02-27 2025-06-27 江苏禾冠信息技术有限公司 一种智能化密码自动提取与安全存储方法

Also Published As

Publication number Publication date
TW202222052A (zh) 2022-06-01
CN112543100A (zh) 2021-03-23
TWI787974B (zh) 2022-12-21
CN112543100B (zh) 2023-07-28

Similar Documents

Publication Publication Date Title
US11601407B2 (en) Fast oblivious transfers
US12284270B2 (en) Systems and methods for providing signatureless, confidential and authentication of data during handshake for classical and quantum computing environments
WO2022110968A1 (zh) 一种动态密钥生成方法和系统
CN110855671B (zh) 一种可信计算方法和系统
US12500746B2 (en) Key management for multi-party computation
US20190068376A1 (en) Fingerprint data processing method and processing apparatus
JP2023101776A (ja) データの高度なセキュリティ、高速暗号化および、伝送のためのコンピュータ実装システムおよび方法
TW201742399A (zh) 資料安全傳輸方法、客戶端及服務端方法、裝置及系統
CN115766119B (zh) 通信方法、装置、通信系统及存储介质
CN116961973A (zh) 数据传输方法、装置、电子设备及计算机可读存储介质
EP3742661A1 (en) Encrypted data communication and gateway device for encrypted data communication
EP3871363A2 (en) Computing key rotation period for block cipher-based encryption schemes system and method
CN114546527A (zh) 一种纵向多方数据聚合计算解决方案系统
CN114386054A (zh) 用于消息存储处理和安全认证的控制方法、系统和介质
US12489609B2 (en) Method for arranging a shared cryptographic key and method for encrypted communication, computer program product and device
CN118643919B (zh) 基于多密钥的联邦学习方法及系统
Arora et al. Securing web documents by using piggybacked framework based on Newton's forward interpolation method
TWI734087B (zh) 基於同態加密的簽章系統及其方法
HK40047469B (zh) 一种动态密钥生成方法和系统
CN118118170B (zh) 一种数据传输加密的改进方法
HK40047469A (zh) 一种动态密钥生成方法和系统
CN111355645A (zh) 家用电器、云端服务器及其对应的传输数据的方法
US11646871B2 (en) System and method for multitenant key derivation
Suresha et al. Ensuring Privacy Preservation Access Control Mechanism in Cloud based on Identity based Derived Key
CN116684086A (zh) 基于量子纠缠的金融数据传输方法、系统、设备及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21896472

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21896472

Country of ref document: EP

Kind code of ref document: A1