CN113886850A - Information encryption method, decryption method, device, electronic equipment and storage medium - Google Patents

Information encryption method, decryption method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113886850A
CN113886850A CN202111143618.XA CN202111143618A CN113886850A CN 113886850 A CN113886850 A CN 113886850A CN 202111143618 A CN202111143618 A CN 202111143618A CN 113886850 A CN113886850 A CN 113886850A
Authority
CN
China
Prior art keywords
information
encrypted
ciphertext
file
processed
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.)
Pending
Application number
CN202111143618.XA
Other languages
Chinese (zh)
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.)
Shanghai Sensetime Intelligent Technology Co Ltd
Original Assignee
Shanghai Sensetime Intelligent 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 Shanghai Sensetime Intelligent Technology Co Ltd filed Critical Shanghai Sensetime Intelligent Technology Co Ltd
Priority to CN202111143618.XA priority Critical patent/CN113886850A/en
Publication of CN113886850A publication Critical patent/CN113886850A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H30/00ICT specially adapted for the handling or processing of medical images
    • G16H30/20ICT specially adapted for the handling or processing of medical images for handling medical images, e.g. DICOM, HL7 or PACS

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Public Health (AREA)
  • Computer Security & Cryptography (AREA)
  • Medical Informatics (AREA)
  • Primary Health Care (AREA)
  • Radiology & Medical Imaging (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Epidemiology (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to the technical field of medical images, and provides an information encryption method, a decryption device, electronic equipment and a storage medium. The encryption method comprises the following steps: acquiring a file to be processed, and acquiring partial information from the file to be processed as information to be encrypted; encrypting the information to be encrypted to obtain a ciphertext; and inserting the ciphertext into other unencrypted parts of the file to be processed to form encrypted information. The method is used for protecting sensitive parts in the information and improving privacy safety.

Description

Information encryption method, decryption method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of medical image technology, and in particular, to an information encryption method, a decryption method, an information decryption apparatus, an electronic device, and a storage medium.
Background
The Dicom format image is used as the most widely used medical image file at present, the header file of the Dicom format image comprises a large amount of private information of a patient, and the private information is stored in a clear text form by default, so that the information leakage of the patient is easily caused.
Disclosure of Invention
The invention provides an information encryption method which is used for protecting sensitive information and improving privacy safety.
In order to solve the above technical problems, a first technical solution provided by the present invention is: provided is an information encryption method including: acquiring a file to be processed, and acquiring partial information from the file to be processed as information to be encrypted; encrypting the information to be encrypted to obtain a ciphertext; and inserting the ciphertext into other unencrypted parts of the file to be processed to form encrypted information. Therefore, sensitive parts in the information are protected, and privacy safety is improved.
Wherein, the file to be processed is a medical file in a Dicom format. To protect the privacy of the patient in Dicom-formatted medical information.
Wherein the acquiring of the partial information from the file to be processed as the information to be encrypted includes: acquiring a Dicom header file in a medical file in a Dicom format, and acquiring part of information needing encryption in the Dicom header file; and splicing the acquired information which needs to be encrypted to obtain the information to be encrypted. And a plurality of pieces of information needing to be encrypted are spliced, so that the encryption is facilitated. The calculation amount is reduced.
Wherein, the encrypting the information to be encrypted to obtain the ciphertext comprises: coding the information to be encrypted according to a preset rule so as to convert the information to be encrypted into binary stream data to obtain the ciphertext; or encrypting the information to be encrypted by utilizing an encryption algorithm to obtain the ciphertext. And (4) carrying out coding encryption or encryption algorithm encryption, erasing the content in the original label and protecting the privacy of the patient.
Wherein, the encrypting the information to be encrypted to obtain the ciphertext comprises: coding the information to be encrypted according to a preset rule so as to convert the information to be encrypted into binary stream data; and encrypting the coded information to be encrypted by utilizing an encryption algorithm to obtain the ciphertext. And encoding encryption and encryption algorithm encryption are carried out, the content in the original label is erased, the privacy of the patient is protected, and the safety is higher.
Wherein the inserting the ciphertext into other unencrypted portions of the to-be-processed file to form encrypted information comprises: converting the ciphertext into a string; and inserting the ciphertext into other unencrypted parts of the file to be processed in the form of the character string to form encrypted information. The ciphertext can be fused with the unencrypted plaintext, and the method is more confusing.
Wherein the converting the ciphertext into a string comprises: and converting the ciphertext into a character string through an encoding algorithm.
In order to solve the above technical problems, a second technical solution provided by the present invention is: there is provided an encryption apparatus including: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a file to be processed and acquiring partial information from the file to be processed as information to be encrypted; the encryption module is used for encrypting the information to be encrypted to obtain a ciphertext; and the inserting module is used for inserting the ciphertext into other unencrypted parts of the file to be processed to form encrypted information. Therefore, sensitive parts in the information are protected, and privacy safety is improved.
In order to solve the above technical problems, a third technical solution provided by the present invention is: there is provided an information decryption method including: acquiring encrypted information, wherein the encrypted information comprises a ciphertext obtained by encrypting the information to be encrypted in the file to be processed and an unencrypted part in the file to be processed, the ciphertext is obtained by encrypting part of information in the file to be processed, and the part of information is different from the unencrypted part; acquiring a ciphertext in the encrypted information; and decrypting the ciphertext to obtain the partial information, and further obtaining the file to be processed based on the partial information and the unencrypted part.
Wherein the decrypting the ciphertext to obtain the information to be encrypted includes: performing inverse coding on the ciphertext to decrypt the ciphertext so as to obtain the information to be encrypted; or the ciphertext is decrypted by using an encryption algorithm, so that the information to be encrypted is obtained.
Wherein the decrypting the ciphertext to obtain the information to be encrypted includes: performing inverse coding on the ciphertext; and decrypting the ciphertext subjected to the inverse coding by using an encryption algorithm to obtain the information to be encrypted.
Wherein, the decrypting the ciphertext to obtain the information to be encrypted comprises: and inversely encoding the ciphertext into a binary stream.
In order to solve the above technical problems, a fourth technical solution provided by the present invention is: there is provided a decryption apparatus comprising: the acquiring module is used for acquiring encrypted information, wherein the encrypted information comprises a ciphertext obtained by encrypting information to be encrypted in a file to be processed and an unencrypted part in the file to be processed, the ciphertext is obtained by encrypting part of information in the file to be processed, and the part of information is different from the unencrypted part; the ciphertext acquisition module is used for acquiring a ciphertext in the encrypted information; and the decryption module is used for decrypting the ciphertext to obtain the partial information and obtaining the file to be processed based on the partial information and the unencrypted part.
In order to solve the above technical problems, a fifth technical solution provided by the present invention is: there is provided an electronic device comprising a memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to perform any of the information encryption method and any of the information decryption method described above.
In order to solve the above technical problems, a sixth technical solution provided by the present invention is: there is provided a computer-readable storage medium characterized by storing a program file executable to implement any one of the information encryption methods described above and any one of the information decryption methods described above.
The method has the beneficial effects that the method is different from the prior art, and partial information in the file to be processed is encrypted to obtain a ciphertext; and inserting the ciphertext into other unencrypted parts of the file to be processed to form encrypted information. Therefore, sensitive parts in the information are protected, and privacy safety is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without inventive efforts, wherein:
FIG. 1 is a flowchart illustrating an information encryption method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an encryption apparatus according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an embodiment of an information decryption method according to the present invention;
FIG. 4 is a diagram illustrating an embodiment of a decryption apparatus according to the present invention;
FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
FIG. 6 is a schematic structural diagram of a storage medium according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, a schematic flow chart of an embodiment of the information encryption method of the present invention is shown, including:
step S11: and acquiring a file to be processed, and acquiring partial information from the file to be processed as information to be encrypted.
Specifically, when the hospital server archives images or performs scientific calculation on the images, copies of the Dicom images need to be reserved, and the reserved files exist in a plaintext form by default, so that privacy leakage is easily caused. In an embodiment, the file to be processed is a medical file, such as a medical image in Dicom format, having a Dicom header file, the Dicom header information containing a large amount of private information of the patient, such as the user's age, identification number, date of birth, etc. The header information generally exists in a clear text form by default, which can cause privacy disclosure of a user, so that the encryption method is provided for encrypting a part needing to be encrypted in the header file, and the security of data storage can be effectively ensured.
A header file is obtained from a file to be processed, such as a medical image in a Dicom format, and part of information to be encrypted in the Dicom header file is obtained as information to be encrypted.
In one embodiment, for encryption, the information to be encrypted in the part acquired in the Dicom header file is spliced to form the information to be encrypted. Specifically, for example, the header file is in the form of: name: zhang three, date of birth: 20/7/1988, identification number: 623781198807201234, gender: male, home address: the Beijing area facing the sun. The obtained information needing to be encrypted is as follows: the information to be encrypted is formed by splicing the taken information which needs to be encrypted in order to reduce workload when the information is encrypted in 20 th month in 1988, 623781198807201234 and the sunny region in Beijing city of men and Beijing city, for example, the information to be encrypted obtained after splicing is 623781198807201234 the sunny region in 20 th month in 1988.
Step S12: and encrypting the information to be encrypted to obtain a ciphertext.
Specifically, the information to be encrypted is encrypted to obtain a ciphertext. In an embodiment, the information to be encrypted may be encoded according to a preset rule, so as to convert the information to be encrypted into binary stream data to obtain a ciphertext. For example, the information to be encrypted may be encoded by using a serialization method of structured data, such as a Protobuf algorithm, so as to convert the information to be encrypted into binary stream data, thereby obtaining the ciphertext. For example, the information to be encrypted is: in the sunny district of beijing city, 623781198807201234, 7.7.1988, the data is converted into 01010111100000110101010101010101100 binary stream data, and the obtained ciphertext is the binary stream data. The information encryption method provided by the embodiment encrypts the part to be encrypted in the Dicom header file in the medical file in the Dicom format, erases the important information in the original tag, and stores the encrypted ciphertext in the private tag, so that the information encryption method is more confusing and ensures the privacy safety of the patient.
In another embodiment, the information to be encrypted may be further encrypted by using an encryption algorithm to obtain the ciphertext. Specifically, a symmetric encryption algorithm, such as DES algorithm, IDEA algorithm, AES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 algorithm, or the like, may be used. Namely, any one of DES algorithm, IDEA algorithm, AES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm and RC5 algorithm is used for encrypting information to be encrypted (623781198807201234 Beijing city rising area in Beijing of Men, 7 and 20 months in 1988), and then a ciphertext is obtained. The information encryption method provided by the embodiment encrypts the part to be encrypted in the Dicom header file in the medical file in the Dicom format, erases important information in the original label, and ensures privacy safety of patients. In addition, in the embodiment, a symmetric encryption algorithm is adopted during encryption, so that the encryption speed is high.
In another embodiment, in order to further improve the indestructibility of the ciphertext and improve the privacy protection, the information to be encrypted may be encoded according to a preset rule, so as to convert the information to be encrypted into binary stream data; and then, encrypting the coded information to be encrypted by utilizing an encryption algorithm to obtain a ciphertext. Specifically, for example, information to be encrypted (623781198807201234 beijing, north, city, south) is converted into binary stream data 01010111100000110101010101010101100 in 1988, and then the binary stream data 01010111100000110101010101010101100 is encrypted by using a symmetric algorithm (any one of DES algorithm, IDEA algorithm, AES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, and RC5 algorithm) to obtain a ciphertext. In another embodiment, an asymmetric encryption algorithm may be used to encrypt the information to be encrypted, so as to form a ciphertext, which is not limited specifically. The information encryption method provided by the embodiment encrypts the part to be encrypted in the Dicom header file in the medical file in the Dicom format, erases important information in the original label, and ensures privacy safety of patients. In addition, in the embodiment, a symmetric encryption algorithm is adopted during encryption, so that the encryption speed is high.
Step S13: and inserting the ciphertext into other unencrypted parts of the file to be processed to form encrypted information.
Specifically, the ciphertext is inserted into other unencrypted portions of the file to be processed to form encrypted information. In one embodiment, the ciphertext formed after encryption is stored into the private tag and inserted into other unencrypted portions of the file to be processed to form encrypted information. It will be appreciated that the unencrypted portion is plaintext, which is typically stored in a common tag, while the encrypted portion is stored in a private tag.
In a specific embodiment, in order to enable the encrypted ciphertext to be fused with other unencrypted portions of the to-be-processed file, the ciphertext needs to be further converted into a character string, and then the ciphertext is inserted into other unencrypted portions of the to-be-processed file in the form of the character string to form encrypted information. Specifically, the ciphertext may be converted into the character string by using an encoding algorithm, where the encoding algorithm includes base64, base32, and the like, and in this embodiment, the ciphertext is preferably converted into the character string by using a base64 algorithm. When the ciphertext is inserted into other unencrypted parts of the file to be processed in the form of a character string, the character string can be stored into the private label in the form of a long character string, and then the character string is further added into the other unencrypted parts, so that the encrypted information is formed.
The information encryption method provided by the application encrypts sensitive content, guarantees privacy safety of a patient, erases content in an original tag, saves a ciphertext in a private tag, and is more confusing and safer.
Referring to fig. 2, a schematic structural diagram of an embodiment of an encryption apparatus according to the present invention is shown, in which the encryption apparatus includes: an acquisition module 21, an encryption module 22 and an insertion module 23.
The obtaining module 21 is configured to obtain a file to be processed, and obtain part of information from the file to be processed as information to be encrypted. Specifically, the file to be processed is a medical file, such as a medical image in Dicom format, which has a Dicom header file, and the Dicom header information contains a large amount of private information of the patient, such as the age, identification number, birth date, and the like of the user. The header information generally exists in a clear text form by default, which can cause privacy disclosure of a user, so that the encryption method is provided for encrypting a part needing to be encrypted in the header file, and the security of data storage can be effectively ensured. Specifically, a header file is obtained from a file to be processed, such as a medical image in a Dicom format, and part of information to be encrypted in the Dicom header file is obtained as information to be encrypted. In one embodiment, for encryption, the information to be encrypted in the part acquired in the Dicom header file is spliced to form the information to be encrypted. Specifically, for example, the header file is in the form of: name: zhang three, date of birth: 20/7/1988, identification number: 623781198807201234, gender: male, home address: the Beijing area facing the sun. The obtained information needing to be encrypted is as follows: the information to be encrypted is formed by splicing the taken information which needs to be encrypted in order to reduce workload when the information is encrypted in 20 th month in 1988, 623781198807201234 and the sunny region in Beijing city of men and Beijing city, for example, the information to be encrypted obtained after splicing is 623781198807201234 the sunny region in 20 th month in 1988.
The encryption module 22 is configured to encrypt the information to be encrypted to obtain a ciphertext. In an embodiment, the encryption module 22 may encode the information to be encrypted according to a preset rule, so as to convert the information to be encrypted into binary stream data to obtain a ciphertext. For example, the information to be encrypted may be encoded by using a serialization method of structured data, such as a Protobuf algorithm, so as to convert the information to be encrypted into binary stream data, thereby obtaining the ciphertext. For example, the information to be encrypted is: in the sunny district of beijing city, 623781198807201234, 7.7.1988, the data is converted into 01010111100000110101010101010101100 binary stream data, and the obtained ciphertext is the binary stream data. The information encryption method provided by the embodiment encrypts the part to be encrypted in the Dicom header file in the medical file in the Dicom format, erases the important information in the original tag, and stores the encrypted ciphertext in the private tag, so that the information encryption method is more confusing and ensures the privacy safety of the patient.
In another embodiment, the encryption module 22 may further encrypt the information to be encrypted by using an encryption algorithm to obtain the ciphertext. Specifically, a symmetric encryption algorithm, such as DES algorithm, IDEA algorithm, AES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 algorithm, or the like, may be used. Namely, any one of DES algorithm, IDEA algorithm, AES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm and RC5 algorithm is used for encrypting information to be encrypted (623781198807201234 Beijing city rising area in Beijing of Men, 7 and 20 months in 1988), and then a ciphertext is obtained. The information encryption method provided by the embodiment encrypts the part to be encrypted in the Dicom header file in the medical file in the Dicom format, erases important information in the original label, and ensures privacy safety of patients. In addition, in the embodiment, a symmetric encryption algorithm is adopted during encryption, so that the encryption speed is high.
In another embodiment, in order to further improve the indestructibility of the ciphertext and improve the privacy protection, the encryption module 22 may first encode the information to be encrypted according to a preset rule, so as to convert the information to be encrypted into binary stream data; and then, encrypting the coded information to be encrypted by utilizing an encryption algorithm to obtain a ciphertext. Specifically, for example, information to be encrypted (623781198807201234 beijing, north, city, south) is converted into binary stream data 01010111100000110101010101010101100 in 1988, and then the binary stream data 01010111100000110101010101010101100 is encrypted by using a symmetric algorithm (any one of DES algorithm, IDEA algorithm, AES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, and RC5 algorithm) to obtain a ciphertext. In another embodiment, an asymmetric encryption algorithm may be used to encrypt the information to be encrypted, so as to form a ciphertext, which is not limited specifically. The information encryption method provided by the embodiment encrypts the part to be encrypted in the Dicom header file in the medical file in the Dicom format, erases important information in the original label, and ensures privacy safety of patients. In addition, in the embodiment, a symmetric encryption algorithm is adopted during encryption, so that the encryption speed is high.
The inserting module 23 is configured to insert the ciphertext into other unencrypted portions of the to-be-processed file to form encrypted information. Specifically, the inserting module 23 inserts the ciphertext into other unencrypted portions of the file to be processed to form the encrypted information. In one embodiment, the ciphertext formed after encryption is stored into the private tag and inserted into other unencrypted portions of the file to be processed to form encrypted information. It will be appreciated that the unencrypted portion is plaintext, which is typically stored in a common tag, while the encrypted portion is stored in a private tag. In a specific embodiment, in order to enable the encrypted ciphertext to be fused with other unencrypted portions of the file to be processed, the insertion module 23 is used to further convert the ciphertext into a character string, and then the ciphertext is inserted into other unencrypted portions of the file to be processed in the form of the character string to form encrypted information. Specifically, the ciphertext may be converted into the character string by using an encoding algorithm, where the encoding algorithm includes base64, base32, and the like, and in this embodiment, the ciphertext is preferably converted into the character string by using a base64 algorithm. When the ciphertext is inserted into other unencrypted parts of the file to be processed in the form of a character string, the character string can be stored into the private label in the form of a long character string, and then the character string is further added into the other unencrypted parts, so that the encrypted information is formed.
The application provides an information encryption device, it encrypts sensitive content, guarantees patient privacy safety to wipe off the content in the original label, keep the ciphertext in the private label, more have puzzlement nature, it is safer.
Referring to fig. 3, a flow chart of an embodiment of the information decryption method of the present invention is shown, including:
step S31: and acquiring encryption information, wherein the encryption information comprises a ciphertext obtained by encrypting the information to be encrypted in the file to be processed and an unencrypted part in the file to be processed.
The ciphertext is obtained by encrypting part of information in the file to be processed, and the part of information is different from the unencrypted part.
In an embodiment, the encryption information may be received from the encryption device through a wireless network, or the encryption information may be copied from the encryption device by using a storage device, which is not limited in particular. The encryption information comprises a ciphertext obtained by encrypting the information to be encrypted in the file to be processed and an unencrypted part in the file to be processed. The file to be processed is a medical file, such as a medical image in a Dicom format, which has a Dicom header file, and the Dicom header information contains a large amount of private information of the patient, such as the age, identification number, birth date, and the like of the user. The information to be encrypted is information to be encrypted in a header file in a medical image in a Dicom format, and the header file is in the following form: name: zhang three, date of birth: 20/7/1988, identification number: 623781198807201234, gender: male, home address: the Beijing area facing the sun. The information to be encrypted that needs to be encrypted in the header file is: the information to be encrypted is formed by splicing the information to be encrypted in 20 th month in 1988 and 623781198807201234 in 20 rd year in 1988 and in the sunny region in Beijing city in male and Beijing city in order to reduce workload, for example, the information to be encrypted obtained after splicing is 623781198807201234 in 20 th month in 1988 in Beijing city sunny region in male.
Step S32: and acquiring a ciphertext in the encrypted information.
And acquiring a ciphertext from the encrypted information, wherein the ciphertext is obtained by encrypting the information to be encrypted. In the encryption process, the ciphertext is stored in the private tag, and in the embodiment, the ciphertext can be directly obtained from the private tag.
Step S33: and decrypting the ciphertext to obtain the partial information.
It should be noted that part of the information is information to be encrypted. In one embodiment, the ciphertext also needs to be de-encoded into a binary stream before being decrypted. During encryption, in order to fuse encrypted ciphertext and unencrypted plaintext, the ciphertext needs to be converted into a character string. Therefore, when decrypting, the ciphertext in the form of the character string needs to be reverse encoded into a binary stream, and for example, the ciphertext may be reverse encoded into a binary stream by using an encoding algorithm, such as base64 or base 32.
In one embodiment, if the ciphertext is in the form of binary stream data, such as 01010111100000110101010101010101100, the ciphertext may be directly encoded to decrypt the ciphertext to obtain the information to be encrypted (623781198807201234 b 7/20 d 1988). Specifically, the cipher information may be encoded inversely by using a serialization method of the structured data, such as a Protobuf algorithm, to decrypt the cipher text, thereby obtaining the information to be encrypted. And adding the information to be encrypted to the unencrypted part of the file to be processed to obtain the file to be processed.
In another embodiment, if the ciphertext is obtained by encrypting through the encryption algorithm, the ciphertext can be directly decrypted by using the encryption algorithm when the ciphertext is decrypted, so that the information to be encrypted is obtained. Specifically, if the ciphertext is obtained by encrypting through a symmetric encryption algorithm, a key used in the symmetric encryption algorithm is obtained, and the ciphertext is decrypted by using the key, so that the information to be encrypted is obtained.
In another embodiment, if the information to be encrypted is encoded according to a preset rule; when the encryption algorithm is used for encryption, the ciphertext is subjected to inverse coding; and then, the encrypted text after the reverse encoding is decrypted by utilizing an encryption algorithm, so that the information to be encrypted is obtained. Specifically, the cipher information may be encoded inversely by using a serialization method of the structured data, such as a Protobuf algorithm, and then the cipher text may be decrypted by using an encryption algorithm (e.g., a symmetric encryption algorithm). And further obtaining the information to be encrypted.
Step S34: and obtaining the file to be processed based on the part information and the unencrypted part.
In an embodiment, the partial information is combined with the unencrypted part, so as to obtain the file to be processed. Specifically, the information to be encrypted is added to the unencrypted file to be processed according to the label information, and the file to be processed can be obtained. Specifically, the information to be encrypted obtained after decryption is 623781198807201234 beijing city rising area of man beijing city in 7-20 th 1988, and may be added to the unencrypted "name: zhang three, date of birth: and identification number: sex: and home address: . And obtaining the file to be processed.
According to the method disclosed by the embodiment, the private information of the patient is obtained through decryption, so that the private information of the patient is protected and is prevented from being leaked.
Referring to fig. 4, a schematic structural diagram of a decryption device according to an embodiment of the present invention includes: an obtaining module 41, a ciphertext obtaining module 42 and a decryption module 43.
The obtaining module 41 is configured to obtain encrypted information, where the encrypted information includes a ciphertext obtained by encrypting information to be encrypted in a file to be processed and an unencrypted portion of the file to be processed, where the ciphertext is obtained by encrypting a portion of information in the file to be processed, and the portion of information is different from the unencrypted portion. Specifically, the encryption information may be received from the encryption device through the wireless network, or the encryption information may be copied from the encryption device by using the storage device, which is not limited in particular. The encryption information comprises a ciphertext obtained by encrypting the information to be encrypted in the file to be processed and an unencrypted part in the file to be processed. The file to be processed is a medical file, such as a medical image in a Dicom format, which has a Dicom header file, and the Dicom header information contains a large amount of private information of the patient, such as the age, identification number, birth date, and the like of the user. The information to be encrypted is information to be encrypted in a header file in a medical image in a Dicom format, and the header file is in the following form: name: zhang three, date of birth: 20/7/1988, identification number: 623781198807201234, gender: male, home address: the Beijing area facing the sun. The information to be encrypted that needs to be encrypted in the header file is: the information to be encrypted is formed by splicing the information to be encrypted in 20 th month in 1988 and 623781198807201234 in 20 rd year in 1988 and in the sunny region in Beijing city in male and Beijing city in order to reduce workload, for example, the information to be encrypted obtained after splicing is 623781198807201234 in 20 th month in 1988 in Beijing city sunny region in male.
The ciphertext obtaining module 42 is configured to obtain a ciphertext of the encrypted information. Specifically, a ciphertext is obtained from the encrypted information, and specifically, the ciphertext is obtained by encrypting the information to be encrypted. In the encryption process, the ciphertext is stored in the private tag, and in the embodiment, the ciphertext can be directly obtained from the private tag.
The decryption module 43 is configured to decrypt the ciphertext to obtain the partial information.
It should be noted that part of the information is information to be encrypted. In an embodiment, the decryption module 43 is further configured to obtain the file to be processed based on the partial information and the unencrypted portion.
In one embodiment, the ciphertext also needs to be de-encoded into a binary stream before being decrypted. During encryption, in order to fuse encrypted ciphertext and unencrypted plaintext, the ciphertext needs to be converted into a character string. Therefore, in decryption, the decryption module 43 needs to perform inverse encoding on the ciphertext in the form of a character string into a binary stream, for example, the ciphertext may be subjected to inverse encoding into a binary stream by using an encoding algorithm, which includes base64, base32, and the like.
In one embodiment, if the ciphertext is in the form of binary stream data, such as 01010111100000110101010101010101100, the decryption module 43 may directly perform inverse encoding on the ciphertext to decrypt the ciphertext and obtain the information to be encrypted (623781198807201234 b.7.20.1988). Specifically, the cipher information may be encoded inversely by using a serialization method of the structured data, such as a Protobuf algorithm, to decrypt the cipher text, thereby obtaining the information to be encrypted. And adding the information to be encrypted to the unencrypted part of the file to be processed to obtain the file to be processed.
In another embodiment, if the ciphertext is obtained by encrypting through the encryption algorithm, when the ciphertext is decrypted, the decryption module 43 may directly decrypt the ciphertext by using the encryption algorithm, so as to obtain the information to be encrypted. Specifically, if the ciphertext is obtained by encrypting through a symmetric encryption algorithm, a key used in the symmetric encryption algorithm is obtained, and the ciphertext is decrypted by using the key, so that the information to be encrypted is obtained.
In another embodiment, if the information to be encrypted is encoded according to a preset rule; and when the encryption algorithm is used for encryption, the ciphertext is subjected to inverse coding, and the ciphertext subjected to inverse coding is decrypted by using the encryption algorithm, so that the information to be encrypted is obtained. Specifically, the decryption module 43 may utilize a serialization method of the structured data, such as a Protobuf algorithm, to perform inverse encoding on the secret information, and then utilize an encryption algorithm (e.g., a symmetric encryption algorithm) to decrypt the ciphertext. And further obtaining the information to be encrypted.
And adding the information to be encrypted into the unencrypted part of the file to be processed according to the information of each label to obtain the file to be processed. Specifically, the information to be encrypted obtained after decryption is 623781198807201234 beijing city rising area of man beijing city in 7-20 th 1988, and may be added to the unencrypted "name: zhang three, date of birth: and identification number: sex: and home address: . And obtaining the file to be processed.
The device shown in the embodiment obtains the privacy information of the patient through decryption, so that the privacy information of the patient is protected, and leakage is avoided.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the invention. The electronic device comprises a memory 202 and a processor 201 connected to each other.
The memory 202 is used to store program instructions for implementing the information encryption method and the information decryption method of any one of the above.
The processor 201 is used to execute program instructions stored by the memory 202.
The processor 201 may also be referred to as a Central Processing Unit (CPU). The processor 201 may be an integrated circuit chip having signal processing capabilities. The processor 201 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 202 may be a memory bank, a TF card, etc., and may store all information in the electronic device of the device, including the input raw data, the computer program, the intermediate operation results, and the final operation results. It stores and retrieves information based on the location specified by the controller. With the memory, the electronic device can only have the memory function to ensure the normal operation. The storage of electronic devices can be classified into a main storage (internal storage) and an auxiliary storage (external storage) according to the use, and also into an external storage and an internal storage. The external memory is usually a magnetic medium, an optical disk, or the like, and can store information for a long period of time. The memory refers to a storage component on the main board, which is used for storing data and programs currently being executed, but is only used for temporarily storing the programs and the data, and the data is lost when the power is turned off or the power is cut off.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a system server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method of the embodiments of the present application.
Please refer to fig. 6, which is a schematic structural diagram of a computer-readable storage medium according to the present invention. The storage medium of the present application stores a program file 203 capable of implementing all the above-mentioned information encryption methods and information decryption methods, wherein the program file 203 may be stored in the storage medium in the form of a software product, and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the methods according to the embodiments of the present application. The aforementioned storage device includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (15)

1. An information encryption method, comprising:
acquiring a file to be processed, and acquiring partial information from the file to be processed as information to be encrypted;
encrypting the information to be encrypted to obtain a ciphertext;
and inserting the ciphertext into other unencrypted parts of the file to be processed to form encrypted information.
2. The information encryption method according to claim 1, wherein the file to be processed is a medical file in Dicom format.
3. The information encryption method according to claim 2, wherein said acquiring partial information from the file to be processed as information to be encrypted includes:
acquiring a Dicom header file in a medical file in a Dicom format, and acquiring part of information needing encryption in the Dicom header file;
and splicing the acquired information which needs to be encrypted to obtain the information to be encrypted.
4. The encryption method according to any one of claims 1 to 3, wherein the encrypting the information to be encrypted to obtain the ciphertext comprises:
coding the information to be encrypted according to a preset rule so as to convert the information to be encrypted into binary stream data to obtain the ciphertext; or
And encrypting the information to be encrypted by utilizing an encryption algorithm to obtain the ciphertext.
5. The encryption method according to any one of claims 1 to 3, wherein the encrypting the information to be encrypted to obtain the ciphertext comprises:
coding the information to be encrypted according to a preset rule so as to convert the information to be encrypted into binary stream data;
and encrypting the coded information to be encrypted by utilizing an encryption algorithm to obtain the ciphertext.
6. The information encryption method according to claim 4 or 5, wherein the inserting the ciphertext into other unencrypted portions of the file to be processed to form encrypted information comprises:
converting the ciphertext into a string;
and inserting the ciphertext into other unencrypted parts of the file to be processed in the form of the character string to form encrypted information.
7. The information encryption method according to claim 6, wherein said converting the ciphertext into a string comprises:
and converting the ciphertext into a character string through an encoding algorithm.
8. An encryption apparatus, comprising:
the acquisition module acquires a file to be processed and acquires partial information from the file to be processed as information to be encrypted;
the encryption module encrypts the information to be encrypted to obtain a ciphertext;
and the inserting module is used for inserting the ciphertext into other unencrypted parts of the file to be processed to form encrypted information.
9. An information decryption method, comprising:
acquiring encrypted information, wherein the encrypted information comprises a ciphertext in a file to be processed and an unencrypted part in the file to be processed, the ciphertext is obtained by encrypting part of information in the file to be processed, and the part of information is different from the unencrypted part;
acquiring the ciphertext in the encrypted information;
decrypting the ciphertext to obtain the partial information;
and obtaining the file to be processed based on the part information and the unencrypted part.
10. The decryption method according to claim 9, wherein the decrypting the ciphertext to obtain the information to be encrypted comprises:
performing inverse coding on the ciphertext to decrypt the ciphertext so as to obtain the information to be encrypted; or
And decrypting the ciphertext by using an encryption algorithm to obtain the information to be encrypted.
11. The decryption method according to claim 9, wherein the decrypting the ciphertext to obtain the information to be encrypted comprises:
performing inverse coding on the ciphertext;
and decrypting the ciphertext subjected to the inverse coding by using an encryption algorithm to obtain the information to be encrypted.
12. The decryption method according to claim 10 or 11, wherein the decrypting the ciphertext to obtain the information to be encrypted comprises:
and inversely encoding the ciphertext into a binary stream.
13. A decryption apparatus, comprising:
the acquiring module is used for acquiring encrypted information, wherein the encrypted information comprises a ciphertext obtained by encrypting information to be encrypted in a file to be processed and an unencrypted part in the file to be processed, the ciphertext is obtained by encrypting part of information in the file to be processed, and the part of information is different from the unencrypted part;
a ciphertext obtaining module, configured to obtain the ciphertext in the encrypted information;
the decryption module is used for decrypting the ciphertext to obtain the partial information; and obtaining the file to be processed based on the part information and the unencrypted part.
14. An electronic device comprising a memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to perform the information encryption method according to any one of claims 1 to 7 and the information decryption method according to any one of claims 9 to 12.
15. A computer-readable storage medium, characterized in that a program file is stored, the program file being executable to implement the information encryption method according to any one of claims 1 to 7 and the information decryption method according to any one of claims 9 to 12.
CN202111143618.XA 2021-09-28 2021-09-28 Information encryption method, decryption method, device, electronic equipment and storage medium Pending CN113886850A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111143618.XA CN113886850A (en) 2021-09-28 2021-09-28 Information encryption method, decryption method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111143618.XA CN113886850A (en) 2021-09-28 2021-09-28 Information encryption method, decryption method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113886850A true CN113886850A (en) 2022-01-04

Family

ID=79007454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111143618.XA Pending CN113886850A (en) 2021-09-28 2021-09-28 Information encryption method, decryption method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113886850A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117439766A (en) * 2023-09-11 2024-01-23 北京华益精点生物技术有限公司 Medical data encryption transmission method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117439766A (en) * 2023-09-11 2024-01-23 北京华益精点生物技术有限公司 Medical data encryption transmission method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113364760A (en) Data encryption processing method and device, computer equipment and storage medium
US8473740B2 (en) Method and system for secured management of online XML document services through structure-preserving asymmetric encryption
CN109690537B (en) System for decrypting and presenting content
CN106506487A (en) A kind of information Encrypt and Decrypt method and device
CN103294961A (en) Method and device for file encrypting/decrypting
US20110083020A1 (en) Securing a smart card
CN107508685B (en) Method for implementing application electronic signature service system in cloud computing environment
CN113572743B (en) Data encryption and decryption methods and devices, computer equipment and storage medium
US7841014B2 (en) Confidential information processing method, confidential information processor, and content data playback system
CN110582010A (en) Video/picture encryption transmission method and device, electronic equipment and storage medium
CN107248972B (en) Data encryption and decryption method and device and electronic equipment
CN114124364A (en) Key security processing method, device, equipment and computer readable storage medium
CN115795538A (en) Desensitization document anti-desensitization method, apparatus, computer device and storage medium
CN113886850A (en) Information encryption method, decryption method, device, electronic equipment and storage medium
CN105279447A (en) Method and device for data encryption, and method and device for data decryption
CN111368322B (en) File decryption method and device, electronic equipment and storage medium
US9979541B2 (en) Content management system, host device and content key access method
CN110008654B (en) Electronic file processing method and device
CN111949996A (en) Generation method, encryption method, system, device and medium of security private key
CN110008724A (en) Solid-state hard disk controller method for secure loading, device and storage medium
CN109829322A (en) Number matchmaker's file real-time encryption and decryption method and system based on authorization message
CN115603907A (en) Method, device, equipment and storage medium for encrypting storage data
CN113645183B (en) Data encryption transmission method, system, computer equipment and storage medium
CN113434827A (en) Information tracing method, device and system, electronic equipment and storage medium
CN112596797A (en) BIOS setting method, device, system, equipment and storage medium

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