CN115529131A - Data encryption and decryption method and device based on dynamic key - Google Patents

Data encryption and decryption method and device based on dynamic key Download PDF

Info

Publication number
CN115529131A
CN115529131A CN202211495950.7A CN202211495950A CN115529131A CN 115529131 A CN115529131 A CN 115529131A CN 202211495950 A CN202211495950 A CN 202211495950A CN 115529131 A CN115529131 A CN 115529131A
Authority
CN
China
Prior art keywords
data
information
encryption
decryption
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
CN202211495950.7A
Other languages
Chinese (zh)
Other versions
CN115529131B (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.)
Guangzhou Wise Security Technology Co Ltd
Original Assignee
Guangzhou Wise Security Technology 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 Guangzhou Wise Security Technology Co Ltd filed Critical Guangzhou Wise Security Technology Co Ltd
Priority to CN202211495950.7A priority Critical patent/CN115529131B/en
Publication of CN115529131A publication Critical patent/CN115529131A/en
Application granted granted Critical
Publication of CN115529131B publication Critical patent/CN115529131B/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/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • 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/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
    • H04L9/16Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms the keys or algorithms being changed during operation

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention discloses a data encryption and decryption method and device based on a dynamic key, wherein the method comprises the following steps: the method comprises the steps that first equipment sets a data preset field in first data information in the process of sending the first data information; the first equipment acquires parameter values of set data preset fields, and determines an encryption algorithm and an encryption key of non-data preset fields in the data information based on the parameter values; and the first equipment encrypts the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replaces the ciphertext information to obtain second data information, and sends the second data information to second equipment. According to the scheme, the key can be automatically generated at the equipment according to the set conditions, the transmission of the key is not needed, the possibility of interception and leakage in the transmission process is avoided, and the data safety is ensured.

Description

Data encryption and decryption method and device based on dynamic key
Technical Field
The embodiment of the application relates to the technical field of security chips, in particular to a data encryption and decryption method and device based on a dynamic key.
Background
With the development of the internet, data transmission efficiency can be remarkably improved by data transmission through the network. Meanwhile, data information security in the network transmission process also becomes a focus of current attention, and one of core problems to be solved by each service provider.
In the existing encryption and decryption process, a used key is usually defined in advance, the key is generally generated at one end and distributed to the other end and other devices, or is uniformly distributed by a server, the key is transmitted in a secure environment, but in the link transmission process, a greater risk of being confused and cracked still exists.
Disclosure of Invention
The embodiment of the invention provides a data encryption and decryption method and device based on a dynamic key, which can generate the key in equipment according to set conditions without key transmission, avoid the possibility of interception and leakage in the transmission process and ensure data security.
In a first aspect, an embodiment of the present invention provides a data encryption and decryption method based on a dynamic key, where the method includes:
the method comprises the steps that first equipment sets a data preset field in first data information in the process of sending the first data information;
the first equipment acquires a parameter value of a set data preset field, and determines an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value;
the first equipment encrypts the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replaces the ciphertext information to obtain second data information, and sends the second data information to second equipment;
the second device receives the second data information, obtains parameter values of data preset fields in the second data information, and determines a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter values;
and the second equipment decrypts the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information.
Optionally, before the setting the preset data field in the first data information, the method further includes:
acquiring a preset configuration file;
and determining a data preset field and a non-data preset field in the first data information based on the configuration file.
Optionally, the setting a preset field of data in the first data information includes:
randomly determining data values in a set value set;
and giving the determined data value to a data preset field in the first data information.
Optionally, the determining, based on the parameter value, an encryption algorithm and an encryption key of a non-data preset field in the data information includes:
acquiring a preset parameter value mapping table;
and determining an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value and the encryption information recorded in the parameter value mapping table.
Optionally, the determining, based on the parameter value, an encryption algorithm and an encryption key of a non-data preset field in the data information includes:
under the condition that the parameter values comprise a plurality of parameter values, calculating the plurality of parameter values based on a preset calculation rule to obtain a unique parameter value;
and determining an encryption algorithm and an encryption key of a non-data preset field in the data information based on the unique parameter value.
Optionally, the calculating the plurality of parameter values based on the set preset calculation rule to obtain a unique parameter value includes:
and calculating a plurality of parameter values based on a set parameter value calculation formula or a parameter value splicing method to obtain a unique parameter value, wherein the parameter value calculation formula comprises a summation formula, and the parameter value splicing method comprises sequential splicing.
Optionally, the determining, based on the parameter value, a decryption algorithm and a decryption key of ciphertext information in the second data information includes:
acquiring a decryption algorithm and a specified rule of a decryption key sent by a server;
and determining a decryption algorithm and a decryption key of the ciphertext information in the second data information according to the specified rule and the parameter value, wherein the decryption algorithm and the decryption key are associated with the encryption algorithm and the encryption key.
In a second aspect, an embodiment of the present invention further provides a data encryption and decryption apparatus based on a dynamic key, including:
the field setting module is configured to set a data preset field in first data information in the process of sending the first data information;
the encryption processing module is configured to acquire a parameter value of a preset field, determine an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value, encrypt the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replace the ciphertext information to obtain second data information, and send the second data information to second equipment;
an information receiving module configured to receive the second data information;
and the decryption processing module is configured to acquire parameter values of data preset fields in the second data information, determine a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter values, and decrypt the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information.
In a third aspect, an embodiment of the present invention further provides a data encryption and decryption device based on a dynamic key, where the device includes:
one or more processors;
a data encryption and decryption device based on a dynamic key is stored, and is used for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for encrypting and decrypting data based on the dynamic key according to the embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are used to execute the method for encrypting and decrypting data based on a dynamic key according to the embodiment of the present invention.
In a fifth aspect, the present application further provides a computer program product, where the computer program product includes a computer program, where the computer program is stored in a computer-readable storage medium, and at least one processor of the device reads from the computer-readable storage medium and executes the computer program, so that the device executes the method for encrypting and decrypting data based on a dynamic key according to the present application.
In the embodiment of the invention, a first device sets a data preset field in first data information in the sending process of the first data information; the first equipment acquires a parameter value of a set data preset field, and determines an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value; the first equipment encrypts the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replaces the ciphertext information to obtain second data information, and sends the second data information to second equipment; the second equipment receives the second data information, obtains parameter values of data preset fields in the second data information, and determines a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter values; and the second equipment decrypts the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information. According to the scheme, the key can be automatically generated at the equipment according to the set conditions, the transmission of the key is not needed, the possibility of interception and leakage in the transmission process is avoided, and the data safety is ensured.
Drawings
Fig. 1 is a flowchart of a data encryption and decryption method based on a dynamic key according to an embodiment of the present invention;
fig. 2 is a flowchart of another method for encrypting and decrypting data based on a dynamic key according to an embodiment of the present invention;
fig. 3 is a block diagram of a data encryption and decryption apparatus based on a dynamic key according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a data encryption and decryption device based on a dynamic key according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad invention. It should be further noted that, for convenience of description, only some structures related to the embodiments of the present invention are shown in the drawings, not all of them.
Fig. 1 is a flowchart of a data encryption and decryption method based on a dynamic key according to an embodiment of the present invention, where an embodiment of the present invention specifically includes the following steps:
step S101, in the process of sending first data information, a first device sets a data preset field in the first data information.
The first device and the second device are devices which are integrated with security chips, can establish communication connection and transmit information, and are designed for information security, and transmission data between the first device and the second device are transmitted in an encrypted form.
In one embodiment, the first device needs to send the generated first data information to the second device, where the first data information is original unencrypted data generated by the first device. In the process of sending the first data information, firstly, a data preset field in the first data information is set. Optionally, the specific data content of the first data information includes a plurality of different fields, the data content of each field represents different information contents, the generated first data information includes a data preset field and a non-data preset field, and the setting is performed during the generation of the first data information. After the first data information is generated, the data preset field in the first data information needs to be set correspondingly, for example, to a specific numerical value.
Optionally, before the setting the preset data field in the first data information, the method further includes: acquiring a preset configuration file; and determining a data preset field and a non-data preset field in the first data information based on the configuration file. That is, it may be determined, through the set configuration file, which of the generated first data information are data preset fields and which are non-data preset fields before setting the preset data fields, so as to set the data preset fields correspondingly.
In an embodiment, the manner of setting the data preset field in the first data information may be: and randomly determining a data value in the set numerical value set, and endowing the determined data value to a data preset field in the first data information. Alternatively, the set of values of the setting may be integer values within the interval [1, 10 ].
Step S102, the first device obtains parameter values of the set data preset fields, and determines an encryption algorithm and an encryption key of the non-data preset fields in the data information based on the parameter values.
In an embodiment, after the parameter value of the data preset field is set, the parameter value is further obtained, and an encryption algorithm and an encryption key of the non-data preset field in the data information are determined based on the parameter value. Optionally, for a plurality of fields included in the data information, the remaining fields excluding the data preset field are defined as non-data preset fields, and data in the non-data preset fields needs to be encrypted, so as to prevent information leakage and potential safety hazard caused by interception during transmission.
Optionally, the mode of determining the encryption algorithm and the encryption key of the non-data preset field in the data information based on the parameter value may be: acquiring a preset parameter value mapping table; and determining an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value and the encryption information recorded in the parameter value mapping table. The parameter value mapping table is a preset mapping table, and records encryption information corresponding to different parameter values, wherein the encryption information comprises an encryption algorithm and an encryption key. That is, different parameter values correspond to different encryption information, and different encryption algorithms and encryption keys are adopted.
In one embodiment, the data preset field may be multiple, corresponding to multiple parameter values at the same time. Optionally, for the case of multiple parameter values, the manner of determining the encryption algorithm and the encryption key of the non-data preset field may be: under the condition that the parameter values comprise a plurality of parameter values, calculating the plurality of parameter values based on a preset calculation rule to obtain a unique parameter value; and determining an encryption algorithm and an encryption key of a non-data preset field in the data information based on the unique parameter value. The method comprises the steps of firstly calculating a plurality of parameter values to obtain a unique parameter value, and determining an encryption algorithm and an encryption key of a non-data preset field in the data information according to the unique parameter value. The mode of determining the encryption algorithm and the encryption key of the non-data preset field in the data information according to the unique parameter value can refer to the mode of determining the encryption algorithm and the encryption key of the non-data preset field in the data information based on the parameter value.
Here, the manner of calculating a plurality of parameter values based on the set preset calculation rule to obtain a unique parameter value may be: calculating a plurality of parameter values based on a set parameter value calculation formula or a parameter value splicing method to obtain a unique parameter value, wherein the parameter value calculation formula comprises a summation formula, and the parameter value splicing method comprises sequential splicing. Illustratively, taking 3 parameter values as an example, 3, 5 and 9 respectively, the sum formula is used to determine the unique parameter value, which is 3+5+9=17; the unique parameter value is determined 359 in a sequential concatenation. Correspondingly, when the corresponding encryption algorithm and the encryption key are determined according to the unique parameter value, the unique parameter value can be subjected to remainder operation, the corresponding encryption algorithm and the encryption key recorded in the mapping table are determined after a remainder result is obtained, and the specific remainder value is determined according to the number of the set encryption algorithm and the set encryption key.
Step S103, the first device encrypts the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replaces the ciphertext information to obtain second data information, and sends the second data information to the second device.
In one embodiment, aiming at the determined encryption algorithm and the determined encryption key, the non-data preset field is encrypted by the encryption algorithm and the encryption key to obtain ciphertext information, and corresponding content in the original data information of the ciphertext information is replaced to obtain second data information containing the ciphertext information. Correspondingly, the content of the data preset field in the original data information is reserved, and the second data information is formed together with the ciphertext information. At this time, it is transmitted to the second device with respect to the generated second data information.
Step S104, the second device receives the second data information, obtains a parameter value of a data preset field in the second data information, and determines a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter value.
In an embodiment, after receiving the second data message, the second device correspondingly obtains a parameter value of a data preset field in the second data message, and because the parameter value of the data preset field is plaintext data, the second device may determine the data preset field in the second data message according to a field division rule agreed in advance and stored in advance, at this time, correspondingly obtain the parameter value of the data preset field, and correspondingly determine a decryption algorithm and a decryption key for ciphertext information in the second data message based on the parameter value.
Optionally, for the second device, the manner of determining the decryption algorithm and the decryption key of the ciphertext information in the second data information based on the parameter value may be: acquiring a decryption algorithm and a specified rule of a decryption key sent by a server; and determining a decryption algorithm and a decryption key of the ciphertext information in the second data information according to the specified rule and the parameter value. The second device receives the decryption algorithm and the decryption key designation rule sent by the server in advance, specifically, the decryption algorithm and the decryption key designation rule sent by the server are received, the decryption algorithm and the decryption key designation rule are sent by the server, that is, the second device is provided with a plurality of decryption algorithms and a plurality of decryption keys in advance, the decryption algorithms and the decryption keys are stored in association with each other, and meanwhile, the parameter values are recorded in a mapping table manner, that is, the rule is the designation rule. At this point, the corresponding decryption algorithm and decryption key may be determined based on this from the derived parameter values. The decryption algorithm and the decryption key are associated with the encryption algorithm and the encryption key, taking a symmetric encryption algorithm as an example, the decryption key and the encryption key are the same, taking an asymmetric encryption algorithm as an example, and the decryption key and the encryption key are mutually matched key pairs.
And S105, the second equipment decrypts the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information.
In one embodiment, after the decryption algorithm and the decryption key are determined, the ciphertext information in the second data information is decrypted correspondingly to obtain plaintext information, and corresponding response processing is performed.
According to the scheme, the first device sets the data preset field in the first data information in the process of sending the first data information; the first equipment acquires parameter values of set data preset fields, and determines an encryption algorithm and an encryption key of non-data preset fields in the data information based on the parameter values; the first equipment encrypts the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replaces the ciphertext information to obtain second data information, and sends the second data information to second equipment; the second device receives the second data information, obtains parameter values of data preset fields in the second data information, and determines a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter values; and the second equipment decrypts the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information. According to the scheme, the key can be automatically generated in the equipment according to the set conditions, the transmission of the key is not needed, the possibility of interception and leakage in the transmission process is avoided, and the data safety is ensured.
Figure 2 is a flow chart of another method for encrypting and decrypting data based on a dynamic key according to an embodiment of the present invention,
step S201, the first device obtains a preset configuration file, and determines a data preset field and a non-data preset field in the first data information based on the configuration file.
Step S202, in the process of sending the first data information, the first device randomly determines a data value in the set value set, and assigns the determined data value to a data preset field in the first data information.
Step S203, the first device obtains a parameter value of a preset data field, obtains a preset parameter value mapping table, and determines an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value and the encryption information recorded in the parameter value mapping table.
And S204, the first equipment encrypts the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replaces the ciphertext information to obtain second data information, and sends the second data information to second equipment.
Step S205, the second device receives the second data information, obtains a parameter value of a data preset field in the second data information, obtains a specified rule of a decryption algorithm and a decryption key sent by the server, and determines the decryption algorithm and the decryption key of ciphertext information in the second data information according to the specified rule and the parameter value, where the decryption algorithm and the decryption key are associated with the encryption algorithm and the encryption key.
Step S206, the second device decrypts the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information.
In the above way, in the process of sending the first data information, the first device sets the data preset field in the first data information; the first equipment acquires a parameter value of a set data preset field, and determines an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value; the first equipment encrypts the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replaces the ciphertext information to obtain second data information, and sends the second data information to second equipment; the second device receives the second data information, obtains parameter values of data preset fields in the second data information, and determines a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter values; and the second equipment decrypts the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information. According to the scheme, the key can be automatically generated at the equipment according to the set conditions, the transmission of the key is not needed, the possibility of interception and leakage in the transmission process is avoided, and the data safety is ensured.
Fig. 3 is a block diagram of a data encryption and decryption apparatus based on a dynamic key according to an embodiment of the present invention, where the data encryption and decryption apparatus based on a dynamic key is used to execute a data encryption and decryption method based on a dynamic key according to an embodiment of the data receiving end, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 3, the data encryption and decryption apparatus based on dynamic key specifically includes: a field setting module 101, an encryption processing module 102, an information receiving module 103, and a decryption processing module 104, wherein,
the image processing module 101 is configured to perform a field recognizing setting module on an image acquired by a camera in the driving assistance process, and is configured to set a data preset field in first data information in the sending process of the first data information;
the encryption processing module is configured to acquire a parameter value of a preset field, determine an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value, encrypt the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replace the ciphertext information to obtain second data information, and send the second data information to second equipment;
an information receiving module configured to receive the second data information;
and the decryption processing module is configured to acquire parameter values of data preset fields in the second data information, determine a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter values, and decrypt the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information.
According to the scheme, the first equipment sets the data preset field in the first data information in the process of sending the first data information; the first equipment acquires a parameter value of a set data preset field, and determines an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value; the first equipment encrypts the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replaces the ciphertext information to obtain second data information, and sends the second data information to second equipment; the second device receives the second data information, obtains parameter values of data preset fields in the second data information, and determines a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter values; and the second equipment decrypts the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information. According to the scheme, the key can be automatically generated at the equipment according to the set conditions, the transmission of the key is not needed, the possibility of interception and leakage in the transmission process is avoided, and the data safety is ensured. Correspondingly, the functions executed by the modules are respectively as follows:
in a possible embodiment, before the setting the preset field of the data in the first data information, the method further includes:
acquiring a preset configuration file;
and determining a data preset field and a non-data preset field in the first data information based on the configuration file.
In a possible embodiment, the setting a preset field of data in the first data information includes:
randomly determining data values in the set value set;
and giving the determined data value to a data preset field in the first data information.
In one possible embodiment, the determining the encryption algorithm and the encryption key of the non-data preset field in the data information based on the parameter value comprises:
acquiring a preset parameter value mapping table;
and determining an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter values and the encryption information recorded in the parameter value mapping table.
In one possible embodiment, the determining the encryption algorithm and the encryption key of the non-data preset field in the data information based on the parameter value comprises:
under the condition that the parameter values comprise a plurality of parameter values, calculating the plurality of parameter values based on a preset calculation rule to obtain a unique parameter value;
and determining an encryption algorithm and an encryption key of a non-data preset field in the data information based on the unique parameter value.
In a possible embodiment, the calculating a plurality of parameter values based on a preset calculation rule to obtain a unique parameter value includes:
and calculating a plurality of parameter values based on a set parameter value calculation formula or a parameter value splicing method to obtain a unique parameter value, wherein the parameter value calculation formula comprises a summation formula, and the parameter value splicing method comprises sequential splicing.
In one possible embodiment, the determining a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter value includes:
acquiring a decryption algorithm and a specified rule of a decryption key sent by a server;
and determining a decryption algorithm and a decryption key of ciphertext information in the second data information according to the specified rule and the parameter value, wherein the decryption algorithm and the decryption key are associated with the encryption algorithm and the encryption key.
Fig. 4 is a schematic structural diagram of a data encryption and decryption apparatus based on a dynamic key according to an embodiment of the present invention, as shown in fig. 4, the apparatus includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of the processors 201 in the device may be one or more, and one processor 201 is taken as an example in fig. 4; the processor 201, the memory 202, the input means 203 and the output means 204 in the device may be connected by a bus or other means, as exemplified by a bus in fig. 4. The memory 202 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the dynamic key-based data encryption and decryption method in the embodiment of the present invention. The processor 201 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 202, that is, implements the above-described dynamic key-based data encryption and decryption method. The input device 203 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the apparatus. The output device 204 may include a display device such as a display screen.
Embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor are configured to perform a method for encrypting and decrypting data based on a dynamic key, the method including:
the method comprises the steps that a first device sets a data preset field in first data information in the process of sending the first data information;
the first equipment acquires a parameter value of a set data preset field, and determines an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value;
the first equipment encrypts the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replaces the ciphertext information to obtain second data information, and sends the second data information to second equipment;
the second equipment receives the second data information, obtains parameter values of data preset fields in the second data information, and determines a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter values;
and the second equipment decrypts the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information.
From the above description of the embodiments, it is obvious for those skilled in the art that the embodiments of the present invention can be implemented by software and necessary general hardware, and certainly can be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions to make a computer device (which may be a personal computer, a service, or a network device) perform the methods described in the embodiments of the present invention.
It should be noted that, in the embodiment of the data encryption and decryption apparatus based on the dynamic key, the included units and modules are only divided according to the functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
In some possible embodiments, various aspects of the methods provided by the present application may also be implemented in a form of a program product including program code for causing a computer device to perform the steps in the methods according to various exemplary embodiments of the present application described above in this specification when the program product runs on the computer device, for example, the computer device may perform the dynamic key-based data encryption and decryption method described in the embodiments of the present application. The program product may be implemented using any combination of one or more readable media.
It should be noted that the foregoing is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will appreciate that the embodiments of the present invention are not limited to the specific embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention have been described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and many other equivalent embodiments may be included without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.

Claims (7)

1. The data encryption and decryption method based on the dynamic key is characterized by comprising the following steps:
acquiring a preset configuration file;
determining a data preset field and a non-data preset field in the first data information based on the configuration file;
the method comprises the steps that first equipment sets a data preset field in first data information in the sending process of the first data information, wherein the data value is randomly determined in a set numerical value set, and the determined data value is endowed to the data preset field in the first data information;
the first equipment acquires parameter values of set data preset fields, determines an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter values, wherein the method comprises the steps of calculating a plurality of parameter values based on a set preset calculation rule to obtain a unique parameter value under the condition that the parameter values comprise a plurality of parameter values, and determines the encryption algorithm and the encryption key of the non-data preset field in the data information based on the unique parameter value;
the first equipment encrypts the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replaces the ciphertext information to obtain second data information, and sends the second data information to second equipment;
the second device receives the second data information, obtains parameter values of data preset fields in the second data information, and determines a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter values;
and the second equipment decrypts the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information.
2. The method for encrypting and decrypting data based on a dynamic key according to claim 1, wherein the determining an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value comprises:
acquiring a preset parameter value mapping table;
and determining an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter value and the encryption information recorded in the parameter value mapping table.
3. The method for encrypting and decrypting data based on a dynamic key according to claim 1, wherein the calculating a plurality of the parameter values based on the preset calculation rule to obtain unique parameter values includes:
and calculating a plurality of parameter values based on a set parameter value calculation formula or a parameter value splicing method to obtain a unique parameter value, wherein the parameter value calculation formula comprises a summation formula, and the parameter value splicing method comprises sequential splicing.
4. The dynamic key-based data encryption and decryption method according to any one of claims 1 to 3, wherein the determining a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter value comprises:
acquiring a decryption algorithm and a specified rule of a decryption key sent by a server;
and determining a decryption algorithm and a decryption key of ciphertext information in the second data information according to the specified rule and the parameter value, wherein the decryption algorithm and the decryption key are associated with the encryption algorithm and the encryption key.
5. The data encryption and decryption device based on the dynamic key is characterized by comprising the following components:
a field setting module configured to set a data preset field in the first data information during a process of acquiring a preset configuration file, determining the data preset field and a non-data preset field in the first data information based on the configuration file, and transmitting the first data information, wherein the data preset field includes randomly determining a data value in a set value set, and assigning the determined data value to the data preset field in the first data information;
the encryption processing module is configured to acquire parameter values of preset fields, determine an encryption algorithm and an encryption key of a non-data preset field in the data information based on the parameter values, calculate a plurality of parameter values based on preset calculation rules to obtain unique parameter values when the parameter values include a plurality of parameter values, determine an encryption algorithm and an encryption key of the non-data preset field in the data information based on the unique parameter values, encrypt the non-data preset field through the encryption algorithm and the encryption key to obtain ciphertext information, correspondingly replace the ciphertext information to obtain second data information, and send the second data information to a second device;
an information receiving module configured to receive the second data information;
and the decryption processing module is configured to acquire parameter values of data preset fields in the second data information, determine a decryption algorithm and a decryption key of ciphertext information in the second data information based on the parameter values, and decrypt the ciphertext information through the decryption algorithm and the decryption key to obtain plaintext information.
6. A dynamic key based data encryption and decryption apparatus, the apparatus comprising: one or more processors; a data encryption and decryption apparatus storing a dynamic key based data encryption and decryption program, for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement the data encryption and decryption method based on a dynamic key according to any one of claims 1 to 4.
7. A storage medium containing computer executable instructions for performing the dynamic key based data encryption decryption method of any one of claims 1-4 when executed by a computer processor.
CN202211495950.7A 2022-11-28 2022-11-28 Data encryption and decryption method and device based on dynamic key Active CN115529131B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211495950.7A CN115529131B (en) 2022-11-28 2022-11-28 Data encryption and decryption method and device based on dynamic key

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211495950.7A CN115529131B (en) 2022-11-28 2022-11-28 Data encryption and decryption method and device based on dynamic key

Publications (2)

Publication Number Publication Date
CN115529131A true CN115529131A (en) 2022-12-27
CN115529131B CN115529131B (en) 2023-03-14

Family

ID=84704878

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211495950.7A Active CN115529131B (en) 2022-11-28 2022-11-28 Data encryption and decryption method and device based on dynamic key

Country Status (1)

Country Link
CN (1) CN115529131B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101163145A (en) * 2007-11-13 2008-04-16 华为技术有限公司 Method and device of transmitting data packet and method of negotiating key
CN106899607A (en) * 2017-03-21 2017-06-27 杭州迪普科技股份有限公司 The method and device that a kind of information encryption is sent and decryption is received
CN110336662A (en) * 2019-06-06 2019-10-15 平安科技(深圳)有限公司 Digital information encryption method, device, computer equipment and storage medium
CN110391906A (en) * 2019-07-25 2019-10-29 深圳壹账通智能科技有限公司 Data processing method, electronic device and readable storage medium storing program for executing based on block chain
CN110944009A (en) * 2019-12-13 2020-03-31 武汉理工光科股份有限公司 Data dynamic encryption communication method and system based on two-wire system communication
CN113452508A (en) * 2021-08-27 2021-09-28 北京华云安信息技术有限公司 Data encryption method, device, equipment and computer readable storage medium
CN113868505A (en) * 2021-09-03 2021-12-31 北京达佳互联信息技术有限公司 Data processing method and device, electronic equipment, server and storage medium
CN114189394A (en) * 2022-02-15 2022-03-15 北京安帝科技有限公司 Data decryption method and device, electronic equipment and storage medium
CN114531239A (en) * 2022-04-20 2022-05-24 广州万协通信息技术有限公司 Data transmission method and system for multiple encryption keys

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101163145A (en) * 2007-11-13 2008-04-16 华为技术有限公司 Method and device of transmitting data packet and method of negotiating key
CN106899607A (en) * 2017-03-21 2017-06-27 杭州迪普科技股份有限公司 The method and device that a kind of information encryption is sent and decryption is received
CN110336662A (en) * 2019-06-06 2019-10-15 平安科技(深圳)有限公司 Digital information encryption method, device, computer equipment and storage medium
CN110391906A (en) * 2019-07-25 2019-10-29 深圳壹账通智能科技有限公司 Data processing method, electronic device and readable storage medium storing program for executing based on block chain
CN110944009A (en) * 2019-12-13 2020-03-31 武汉理工光科股份有限公司 Data dynamic encryption communication method and system based on two-wire system communication
CN113452508A (en) * 2021-08-27 2021-09-28 北京华云安信息技术有限公司 Data encryption method, device, equipment and computer readable storage medium
CN113868505A (en) * 2021-09-03 2021-12-31 北京达佳互联信息技术有限公司 Data processing method and device, electronic equipment, server and storage medium
CN114189394A (en) * 2022-02-15 2022-03-15 北京安帝科技有限公司 Data decryption method and device, electronic equipment and storage medium
CN114531239A (en) * 2022-04-20 2022-05-24 广州万协通信息技术有限公司 Data transmission method and system for multiple encryption keys

Also Published As

Publication number Publication date
CN115529131B (en) 2023-03-14

Similar Documents

Publication Publication Date Title
CN108768607B (en) Voting method, device, equipment and medium based on block chain
CN111274611A (en) Data desensitization method, device and computer readable storage medium
CN115065472B (en) Security chip encryption and decryption method and device based on multi-key encryption and decryption
CN115208697A (en) Adaptive data encryption method and device based on attack behavior
CN114915504B (en) Security chip initial authentication method and system
CN114520727B (en) Security chip data protection method and system
JP2024512110A (en) Data transmission methods, devices, electronic devices and storage media
CN111246407B (en) Data encryption and decryption method and device for short message transmission
CN113992427B (en) Data encryption sending method and device based on adjacent nodes
CN114173328A (en) Key exchange method and device and electronic equipment
CN113645235A (en) Distributed data encryption and decryption system and encryption and decryption method
CN106487761B (en) Message transmission method and network equipment
CN115529131B (en) Data encryption and decryption method and device based on dynamic key
CN112995210B (en) Data transmission method and device and electronic equipment
CN115022012A (en) Data transmission method, device, system, equipment and storage medium
CN111431846B (en) Data transmission method, device and system
CN109361506B (en) Information processing method
CN108154037A (en) Data transmission method and device between process
CN113556333A (en) Computer network data secure transmission method and device
CN115208569B (en) Encryption and decryption method and device for dynamic key distribution
CN113452654B (en) Data decryption method
CN115118523B (en) Security chip encryption processing method and device for adjusting encryption strategy by terminal equipment
CN115529133B (en) Encryption and decryption processing method and device for dynamically updating secret key of security chip
CN115955306B (en) Data encryption transmission method and device, electronic equipment and storage medium
CN115065843B (en) Video encryption and decryption processing method and system under security authentication

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