CN112131591A - Encryption method, device, equipment and medium for compressing ciphertext of information - Google Patents

Encryption method, device, equipment and medium for compressing ciphertext of information Download PDF

Info

Publication number
CN112131591A
CN112131591A CN202011053192.4A CN202011053192A CN112131591A CN 112131591 A CN112131591 A CN 112131591A CN 202011053192 A CN202011053192 A CN 202011053192A CN 112131591 A CN112131591 A CN 112131591A
Authority
CN
China
Prior art keywords
ciphertext
coordinate
information
target information
target
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
CN202011053192.4A
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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202011053192.4A priority Critical patent/CN112131591A/en
Publication of CN112131591A publication Critical patent/CN112131591A/en
Priority to PCT/CN2021/109259 priority patent/WO2022068359A1/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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Accounting & Taxation (AREA)
  • Data Mining & Analysis (AREA)
  • Finance (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computing Systems (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the application discloses an encryption method, device, equipment and medium for compressing a ciphertext of information, and mainly relates to the technical field of block chains. The method comprises the following steps: acquiring a target function for describing information and target information to be processed; determining coordinate information corresponding to the target information from the curve of the target function; encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information; compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information; and storing the compressed ciphertext corresponding to the target information into a block chain network. Adopt this application, can improve the security of target information to and reduce the storage pressure of node equipment in the block chain, save storage space, this application is applicable to wisdom medical field, can further promote the construction in wisdom city.

Description

Encryption method, device, equipment and medium for compressing ciphertext of information
Technical Field
The present application relates to the field of block chaining technologies, and in particular, to an encryption method, apparatus, device, and medium for compressing a ciphertext of an information.
Background
At present, the internet is further developing towards mobility, new content such as social networks is continuously rising, and people can conveniently acquire desired information. However, as demand and business continue to evolve, the data generated also grows geometrically. The large-scale data has immeasurable value, and the relationship among the data plays an important role in the operation and decision of company enterprises. When mass data is processed and stored in a centralized manner, for example, when medical data of a large number of patients in a medical platform is stored and managed, a ciphertext corresponding to user data is stored in a local database of a terminal and is easily tampered by an illegal user, so that a target message cannot be obtained by decrypting the ciphertext according to target information. Meanwhile, the ciphertext corresponding to the user data is directly stored, so that the problem of insufficient storage space is easily caused.
Disclosure of Invention
The embodiment of the application provides an encryption method, device, equipment and medium for compressing a ciphertext of information, which can improve the security of target information and save storage space.
In a first aspect, an embodiment of the present application provides an encryption method for compressing a ciphertext of information, where the method includes:
acquiring a target function for describing information and target information to be processed;
determining coordinate information corresponding to the target information from the curve of the target function;
encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information;
compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information;
and storing the compressed ciphertext corresponding to the target information into a block chain network.
The coordinate information corresponding to the target information comprises a first coordinate and a second coordinate; compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information, including:
acquiring a data interception length, wherein the data interception length is greater than the byte length of the first coordinate, or greater than the byte length of the second coordinate and less than the sum of the byte length of the first coordinate and the byte length of the second coordinate;
continuously intercepting the ciphertext with the length of the data interception length from the ciphertext of the coordinate information corresponding to the target information;
and determining the intercepted ciphertext as a compressed ciphertext corresponding to the target information.
Wherein, the continuously intercepting the ciphertext of which the length is the intercepting length of the data from the ciphertext of the coordinate information corresponding to the target information includes:
intercepting the ciphertext of the first coordinate and the lowest bit of the ciphertext of the second coordinate from the ciphertext of the coordinate information corresponding to the target information;
and determining the lowest bit of the ciphertext of the first coordinate and the ciphertext of the second coordinate as the intercepted ciphertext.
Wherein the method further comprises:
receiving an acquisition request aiming at the target information;
acquiring a compressed ciphertext corresponding to the target information from the block chain network according to the acquisition request;
decompressing the compressed ciphertext corresponding to the target information to obtain a ciphertext of the coordinate information corresponding to the target information;
and decrypting the ciphertext of the coordinate information corresponding to the target information to obtain the coordinate information corresponding to the target information, and determining the target information according to the coordinate information corresponding to the target information.
The compressed ciphertext corresponding to the target information comprises the ciphertext of the first coordinate and the lowest bit of the ciphertext of the second coordinate, and the first coordinate and the second coordinate are coordinate information corresponding to the target information;
the decompressing the compressed ciphertext corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information includes:
acquiring a candidate second coordinate corresponding to the ciphertext of the first coordinate from the curve of the target function;
taking the candidate second coordinate with the lowest bit being the same as the lowest bit of the ciphertext of the second coordinate as the ciphertext of the second coordinate;
and determining the ciphertext of the first coordinate and the ciphertext of the second coordinate as the ciphertext of the coordinate information corresponding to the target information.
The acquiring request includes an information identifier of the target information, and the acquiring a compressed ciphertext corresponding to the target information from the blockchain network according to the acquiring request includes:
acquiring the corresponding relation between the information identification and the block from a local storage; determining a target block for storing a compressed ciphertext corresponding to the target information according to the corresponding relation;
and acquiring a compressed ciphertext corresponding to the target information from a target block in the block chain network.
The encrypting the coordinate information of the target information to obtain the ciphertext of the coordinate information corresponding to the target information includes:
acquiring user information of a target user corresponding to the target information;
generating a key corresponding to the target information according to the user information;
and encrypting the coordinate information corresponding to the target information by adopting the key corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information.
In a second aspect, an embodiment of the present application provides an encryption apparatus for compressing a ciphertext of information, the apparatus including:
the first acquisition module is used for acquiring a target function for describing information and target information to be processed;
the determining module is used for determining coordinate information corresponding to the target information from a curve of the target function;
the encryption module is used for encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information;
the compression module is used for compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information;
and the storage module is used for storing the compressed ciphertext corresponding to the target information into the block chain network.
The coordinate information corresponding to the target information comprises a first coordinate and a second coordinate;
the compression module includes:
a first obtaining unit, configured to obtain a data truncation length, where the data truncation length is greater than a byte length of the first coordinate or greater than a byte length of the second coordinate, and is less than a sum of the byte length of the first coordinate and the byte length of the second coordinate;
the intercepting unit is used for continuously intercepting the ciphertext with the length of the data intercepting length from the ciphertext of the coordinate information corresponding to the target information;
and the first determining unit is used for determining the intercepted ciphertext as the compressed ciphertext corresponding to the target information.
Wherein the intercepting unit is specifically configured to:
intercepting the ciphertext of the first coordinate and the lowest bit of the ciphertext of the second coordinate from the ciphertext of the coordinate information corresponding to the target information;
and determining the lowest bit of the ciphertext of the first coordinate and the ciphertext of the second coordinate as the intercepted ciphertext.
Wherein the apparatus further comprises:
a receiving module, configured to receive an acquisition request for the target information;
the second obtaining module is used for obtaining a compressed ciphertext corresponding to the target information from the block chain network according to the obtaining request;
the decompression module is used for decompressing the compressed ciphertext corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information;
and the decryption module is used for decrypting the ciphertext of the coordinate information corresponding to the target information to obtain the coordinate information corresponding to the target information, and determining the target information according to the coordinate information corresponding to the target information.
The compressed ciphertext corresponding to the target information comprises the ciphertext of the first coordinate and the lowest bit of the ciphertext of the second coordinate, and the first coordinate and the second coordinate are coordinate information corresponding to the target information;
the decompression module comprises:
the second obtaining unit is used for obtaining candidate second coordinates corresponding to the ciphertext of the first coordinates from the curve of the target function;
a second determining unit configured to determine, as a ciphertext of the second coordinate, a candidate second coordinate in which a lowest bit of the candidate second coordinates is the same as a lowest bit of a ciphertext of the second coordinate;
and the third determining unit is used for determining the ciphertext of the first coordinate and the ciphertext of the second coordinate as the ciphertext of the coordinate information corresponding to the target information.
Wherein, the obtaining request includes an information identifier of the target information, and the second obtaining module includes:
the fourth determining unit is used for acquiring the corresponding relation between the information identifier and the block from the local storage; determining a target block for storing a compressed ciphertext corresponding to the target information according to the corresponding relation;
and the third acquisition unit is used for acquiring the compressed ciphertext corresponding to the target information from the target block in the block chain network.
Wherein the encryption module comprises:
a fourth obtaining unit, configured to obtain user information of a target user corresponding to the target information;
the generating unit is used for generating a key corresponding to the target information according to the user information;
and the encryption unit is used for encrypting the coordinate information corresponding to the target information by adopting the key corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor adapted to implement one or more instructions; and the number of the first and second groups,
a computer storage medium storing one or more instructions adapted to be loaded by the processor and to perform the steps of:
acquiring a target function for describing information and target information to be processed;
determining coordinate information corresponding to the target information from the curve of the target function;
encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information;
compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information;
and storing the compressed ciphertext corresponding to the target information into a block chain network.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including: the computer storage medium stores one or more instructions adapted to be loaded by a processor and to perform the steps of:
acquiring a target function for describing information and target information to be processed;
determining coordinate information corresponding to the target information from the curve of the target function;
encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information;
compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information;
and storing the compressed ciphertext corresponding to the target information into a block chain network.
In the embodiment of the application, coordinate information corresponding to target information is determined from a curve of a target function by acquiring the target function for describing information and the target information to be processed; encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information; the method comprises the steps of compressing a ciphertext of coordinate information corresponding to target information to obtain a compressed ciphertext corresponding to the target information, and reducing the storage space of the ciphertext of the target information pair when the compressed ciphertext corresponding to the target information is stored; the compressed ciphertext corresponding to the target information is stored in the block chain network, so that the situation that the ciphertext of the target information is falsified and cannot be decrypted according to the ciphertext of the target information to obtain the target information due to the fact that the ciphertext of the target information is stored to the local terminal can be effectively avoided, and the safety of the target information is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1a is a schematic structural diagram of an encryption system for compressing a ciphertext of information according to an embodiment of the present invention;
FIG. 1b is a schematic diagram of a data sharing system according to an embodiment of the present application;
FIG. 1c is a schematic structural diagram of a block chain according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of an encryption method for compressing a ciphertext of information according to an embodiment of the present application;
fig. 3 is a schematic diagram of a method for compressing a ciphertext of coordinate information corresponding to target information according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another encryption method for compressing a ciphertext of information according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an encryption apparatus for compressing a ciphertext of information according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to another embodiment of the present application.
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 some, but not all, embodiments of the present application. 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.
The block chain related to the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission (P2P transmission), consensus mechanism, encryption algorithm and the like, is essentially a decentralized database, and is a series of data blocks which are generated in a correlation mode by using a cryptography method, wherein each data block contains information of a batch of network transactions and is used for verifying the validity (anti-counterfeiting) of the information and generating the next block. The blockchain can comprise a blockchain bottom platform, a platform product service layer and an application service layer; the blockchain can be composed of a plurality of serial transaction records (also called blocks) which are connected in series by cryptography and protect the contents, and the distributed accounts connected in series by the blockchain can effectively record the transactions by multiple parties and can permanently check the transactions (can not be tampered). The consensus mechanism is a mathematical algorithm for establishing trust and obtaining rights and interests among different nodes in the block chain network; that is, the consensus mechanism is a mathematical algorithm commonly recognized by network nodes in the blockchain.
First, the architecture of an encryption system for compressing a ciphertext of information applied in the present application is described, as shown in fig. 1 a. The system architecture diagram includes a block chain network and a plurality of terminals, and fig. 1a illustrates three terminals, which are a first terminal, a second terminal and a third terminal. The first terminal, the second terminal and the third terminal can be used for acquiring the ciphertext of the target information from the blockchain network or storing the ciphertext of the target information into the blockchain network.
The blockchain network may be the blockchain network 100 shown in fig. 1b, where the blockchain network 100 refers to a system for performing data sharing between node devices, the blockchain network may include a plurality of node devices 101, and the plurality of node devices 101 may refer to each client in the blockchain network. Each node device 101 may receive data while in normal operation and maintain shared data within the blockchain network based on the received transaction data. In order to ensure information intercommunication in the blockchain network, information connection may exist between each node device in the blockchain network, and information transmission may be performed between the node devices through the information connection. Each node device in the blockchain network stores one identical blockchain. The block chain is composed of a plurality of blocks, referring to fig. 1c, the block chain is composed of a plurality of blocks, the starting block comprises a block head and a block main body, the block head stores a data characteristic value, a version number, a timestamp and a difficulty value, and the block main body stores data; the next block of the starting block takes the starting block as a parent block, the next block also comprises a block head and a block main body, the block head stores the data characteristic value of the current block, the block head characteristic value of the parent block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, and the safety of the data in the blocks is ensured.
The node device, the first terminal, the second terminal and the third terminal in the block chain network may be computer devices, including mobile phones, tablet computers, notebook computers, palmtop computers, smart audio devices, mobile internet devices (MID, mobile internet devices), POS (Point Of Sales) machines, wearable devices (e.g., smart watches, smart bracelets, etc.), and the like; the method can also refer to an independent server, a server cluster consisting of a plurality of servers, or a cloud computing center.
Referring to fig. 2, a flowchart of an encryption method for compressing a ciphertext of an information according to an embodiment of the present application is shown, where the encryption method for compressing a ciphertext of an information is implemented by an electronic device in an embodiment of the present application, and the encryption method includes steps S101 to S105.
S101, acquiring an objective function for describing information and objective information to be processed.
In this embodiment, the objective function is used to describe the objective information, that is, the objective information is converted into coordinate information on a curve corresponding to the objective function. The target function can be asymmetrical and is an elliptic curve algorithm, and the elliptic curve algorithm is an encryption algorithm realized based on an elliptic curve mathematical theory. The function expression form of the elliptic curve algorithm is Y ^2 ^ X ^3+ aX + b, and for any point coordinate (X, Y) on the elliptic curve, Y ^2 ^ X ^3+ aX + b is met, namely the corresponding Y can be calculated according to the known X. Therefore, the target information can be converted into the coordinate information on the target function, so that the target information is stored in the block chain network, and the safety of the target information is improved. The target information may refer to transaction data, business data, etc. of an organization.
And S102, determining coordinate information corresponding to the target information from the curve of the target function.
And acquiring a curve corresponding to the target function, and taking the target information as a first coordinate of a target point on the curve corresponding to the target function, such as an X coordinate of the target point. And obtaining a second coordinate, such as a Y coordinate, of the target point on the curve corresponding to the target function according to the first coordinate of the target point and the expression of the curve corresponding to the target function. And obtaining the coordinate information of the target information pair according to the first coordinate and the second coordinate of the target point of the curve corresponding to the target function. The objective function may be a function algorithm corresponding to an elliptic curve, or may be a function corresponding to another curve. And acquiring a line corresponding to an objective function curve, wherein the curve corresponding to the objective function may be a prime256v1 curve, a secp256r1 curve, a nistp256 curve, a secp256k1 curve and the like. The target information is used as a first coordinate of a target point on a curve corresponding to the target function, namely when the data type of the target information is a numerical type, the target information can be used as the first coordinate of the target point on the curve corresponding to the target function; or, when the data type of the target information is a non-numerical type, the target information may be encoded according to a numerical conversion code to obtain numerical type target information, and the numerical type target information is used as the first coordinate of the target point on the curve corresponding to the target function. Specifically, the numerical conversion code includes: one-hot encoding (a non-numerical to numerical encoding), Label encoding (a non-numerical to numerical encoding), fanning encoding (a non-numerical to numerical encoding), and so forth.
For example, the curve of the objective function may be the secp256k1 curve in the elliptic curve, the expression form of the elliptic curve function may be Y ^2 ^ X ^3+ aX + b, and for any point coordinate (X, Y) on the elliptic curve, Y ^2 ^ X ^3+ aX + b is satisfied, i.e. the corresponding Y can be calculated according to the known X. Therefore, if the data type of the target information is a numerical type, the target information can be used as the X coordinate of the target point on the secp256k1 curve corresponding to the target function, and the corresponding Y coordinate can be obtained according to the X coordinate; further, calculating and obtaining the Y coordinate of the target point on the secp256k1 curve corresponding to the target function according to the function expression and the X coordinate of the secp256k1 curve; and determining the X coordinate and the Y coordinate of the target point as coordinate information corresponding to the target information. If the data type of the target information is a non-numerical value type and a character string type, encoding the target information according to the one-hot code to obtain the numerical value type target information; taking the target information of the data type as the X coordinate of the target point on the secp256r1 curve corresponding to the target function; further, calculating and obtaining the Y coordinate of the target point on the secp256r1 curve corresponding to the target function according to the function expression and the X coordinate of the secp256r1 curve; and determining the X coordinate and the Y coordinate of the target point as coordinate information corresponding to the target information, so as to improve the safety of the target information.
S103, encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information.
In this embodiment, the electronic device may encrypt the target information by using an encryption algorithm to obtain a ciphertext of the coordinate information corresponding to the target information, where the encryption algorithm may include, but is not limited to, an RSA algorithm, an Elgamal algorithm, a knapsack algorithm, a Rabin algorithm, a D-H algorithm, and an ECC (elliptic curve cryptography algorithm). The RSA algorithm, the Elgamal algorithm, the knapsack algorithm, the Rabin algorithm and the D-H algorithm are all asymmetric algorithms.
Optionally, user information of a target user corresponding to the target information is obtained; generating a key corresponding to the target information according to the user information; and encrypting the coordinate information corresponding to the target information by adopting the key corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information.
The user information of the target user corresponding to the target information includes, but is not limited to, a user account, a user password, a user phone number, and the like. And generating a key corresponding to the target information according to the user information of the target user, and encrypting the coordinate information corresponding to the target information by adopting the key corresponding to the target information to obtain a ciphertext of the coordinate information corresponding to the target information. Specifically, the user information corresponding to the target information may be obtained, the random number corresponding to the target information is generated according to the user information corresponding to the target information, and the key corresponding to the target information is generated according to the random number corresponding to the target information. For example, a user account corresponding to the target information is acquired, a rand function in the C language is called, a random number corresponding to the target information is generated according to the user account corresponding to the target information, and then the random number corresponding to the target information is subjected to hash operation to obtain a key corresponding to the target information. The key is used for encrypting the target information to obtain the ciphertext of the coordinate information corresponding to the target information, so that the difficulty of decrypting the ciphertext of the target information can be increased, the ciphertext of the target information is prevented from being cracked by an illegal user, and the safety of the target information is improved.
Optionally, the electronic device may obtain a terminal identifier of a terminal to which the target information belongs, and generate a private key corresponding to the terminal according to the terminal identifier of the terminal to which the target information belongs. And then, according to the private key and the key corresponding to the target information, encrypting the coordinate information corresponding to the target information to obtain a ciphertext of the coordinate information corresponding to the target information. The specific implementation manner of obtaining the ciphertext of the coordinate information corresponding to the target information includes: obtaining the coordinates of a base point of a curve of the target function; obtaining the product of the base point coordinate and the private key of the terminal to obtain a candidate coordinate; encrypting the candidate coordinate according to a key corresponding to the target information to obtain a ciphertext of the candidate coordinate; and fusing the coordinate information corresponding to the target information and the ciphertext of the corresponding candidate coordinate to obtain the ciphertext of the coordinate information corresponding to the target information.
For example, the private key Q is obtained according to block information of a target block for storing a compressed ciphertext corresponding to the target information. And obtaining a curve corresponding to the objective function as a secp256r1 curve, obtaining base point coordinates G (Xg, Yg) of the secp256r1 curve, and multiplying the private key Q and the base point coordinates to obtain a candidate coordinate H, wherein the candidate coordinate H is G × Q. And encrypting the candidate coordinate H according to the key K corresponding to the target information to obtain a ciphertext P1 of the candidate coordinate, where P may be equal to the product of the key K corresponding to the target information and the candidate coordinate, that is, P1 ═ K × H. After the coordinate information corresponding to the target information is obtained as P2(X1, Y1), the coordinate information P2(X1, Y1) corresponding to the target information is fused with the ciphertext P1 of the corresponding candidate coordinate, and the ciphertext C of the coordinate information corresponding to the target information is obtained. For example, the coordinate information P2(X1, Y1) corresponding to the target information may be added to the ciphertext P1 of the corresponding candidate coordinate to obtain the ciphertext C of the coordinate information corresponding to the target information, that is, C — P2+ P1. And encrypting the coordinate information corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information.
And S104, compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information.
And S105, storing the compressed ciphertext corresponding to the target information into the block chain network.
In this embodiment of the application, the coordinate information corresponding to the target information includes a first coordinate and a second coordinate, and when the first coordinate and the second coordinate corresponding to the target information are stored in the block chain network, the first coordinate and the second coordinate corresponding to the target information may be compressed. After the compressed ciphertexts of the first coordinate and the second coordinate corresponding to the target information are obtained, the compressed ciphertexts of the first coordinate and the second coordinate corresponding to the target information are stored in the block chain network, so that the storage pressure of node equipment in the block chain can be reduced, and the storage space is saved. Meanwhile, the information stored on the block chain network cannot be changed, so that the ciphertext of the target information is stored in the block chain network, the ciphertext of the target information can be prevented from being tampered by an illegal user, and the safety of the target information is improved.
As shown in fig. 3, a schematic diagram of a method for compressing a ciphertext of coordinate information corresponding to target information according to an embodiment of the present application is provided, and as shown in fig. 3, the steps of the method for compressing a ciphertext of coordinate information corresponding to target information include S21 to S23.
And S21, acquiring a data interception length which is greater than the byte length of the first coordinate, or greater than the byte length of the second coordinate and less than the sum of the byte length of the first coordinate and the byte length of the second coordinate.
And acquiring a data interception length, and intercepting the ciphertext of the target information according to the data interception length, wherein the data interception length is greater than the byte length of the first coordinate, or greater than the byte length of the second coordinate and less than the sum of the byte length of the first coordinate and the byte length of the second coordinate. The second coordinate can be obtained according to the objective function and the first coordinate, so that the preset length of the ciphertext of the second coordinate can be stored, and the ciphertext of the second coordinate can be obtained according to the preset length of the ciphertext of the second coordinate. For example, when multiple candidate second coordinate ciphertexts are obtained according to the target function and the first coordinate, a candidate second coordinate cipher text matched with the content in the preset length of the second coordinate cipher text can be obtained from the multiple candidate second coordinate cipher texts according to the preset length of the second coordinate cipher text, and the candidate second coordinate cipher text is used as the second coordinate cipher text. The preset length of the ciphertext of the second coordinate may be half of the length of the ciphertext of the second coordinate, or may be one third of the length of the ciphertext of the second coordinate, and so on.
S22, a ciphertext whose length is the data truncation length is truncated continuously from the ciphertext of the coordinate information corresponding to the target information.
And S23, determining the intercepted ciphertext as the compressed ciphertext corresponding to the target information.
And according to the data interception length, continuously intercepting the ciphertext with the data interception length from the ciphertext of the coordinate information corresponding to the target information, and determining the intercepted ciphertext as a compressed ciphertext corresponding to the target information. Of course, since the target information is used as the first coordinate of the target point on the curve corresponding to the target function, the intercepted ciphertext needs to include the ciphertext of the first coordinate, and may also include the ciphertext of the preset length of the second coordinate. The continuous interception is to ensure that the intercepted ciphertext is continuous so as to accurately restore the ciphertext of the target information in the following.
Optionally, the ciphertext of the first coordinate and the lowest bit of the ciphertext of the second coordinate are intercepted from the ciphertext of the coordinate information corresponding to the target information; and determining the lowest bit of the ciphertext of the first coordinate and the ciphertext of the second coordinate as the intercepted ciphertext.
The ciphertext of the first coordinate and the lowest bit of the ciphertext of the second coordinate may be intercepted from the ciphertext of the coordinate information corresponding to the target information. In this embodiment, the target information is used as the first coordinate of the target point on the curve corresponding to the target function, so that the ciphertext of the first coordinate is intercepted from the ciphertext of the coordinate information corresponding to the target information according to the data interception length. Since the second coordinate can be obtained according to the expression of the curve corresponding to the target function and the first coordinate, only the lowest bit of the ciphertext of the second coordinate can be intercepted, so that the second coordinate of the target information can be obtained according to the lowest bit of the ciphertext of the second coordinate. And determining the lowest bit of the ciphertext of the first coordinate and the ciphertext of the second coordinate as the intercepted ciphertext. For example, after the ciphertext of the first coordinate and the ciphertext of the second coordinate corresponding to the target information are obtained, both the ciphertext of the first coordinate and the ciphertext of the second coordinate are 32 bytes. And continuously intercepting the ciphertext of the first coordinate and the ciphertext of the 1Byte length in the ciphertext of the second coordinate according to the data interception length, and taking the ciphertext of the first coordinate and the ciphertext of the 1Byte length in the ciphertext of the second coordinate as intercepted ciphertexts. If the ciphertext of the first coordinate and the ciphertext of the second coordinate of the target information are not intercepted, a storage space of 64 bytes needs to be occupied to store the ciphertext of the target information, which easily causes the problem of insufficient storage space. And intercepting the ciphertext of the first coordinate and the ciphertext of the second coordinate of the target information according to the data interception length to obtain the compressed ciphertext of the target information, so that the compressed ciphertext for storing the target information only needs to occupy a storage space of 33 bytes, and when the compressed ciphertext of the target information is stored in the block chain network, the storage pressure of node equipment in the block chain network can be reduced, and the storage space is saved.
Optionally, after the compressed ciphertext of the target information is stored in the block chain network, the compressed ciphertext corresponding to the local target information of the terminal may be deleted. After the compressed ciphertext of the target information is stored in the target block in the block chain network, when the target information needs to be acquired, the compressed ciphertext of the target information can be acquired in the target block in the block chain network, and the target information can be acquired after the compressed ciphertext of the target information is decompressed and decrypted. Meanwhile, the information stored on the block chain network cannot be tampered, so that the target information can be obtained according to the compressed ciphertext of the target information in the target block in the block chain network. And the compressed ciphertext corresponding to the local target information of the terminal is deleted, so that the local storage pressure of the terminal can be reduced, and the storage space is saved.
The embodiment can be applied to the scenes of medical informatization, electronic information archive management and the like in the field of digital medical treatment, and the target information can refer to medical data of a patient, such as medical images (links and access codes), image labels, prescriptions, diagnoses, treatment records, expense documents and the like. The coordinate information corresponding to the medical data of the patient is obtained according to the target function, the coordinate information corresponding to the medical data of the patient is encrypted, and the ciphertext corresponding to the medical data of the patient is intercepted by adopting the data interception length, so that the compressed ciphertext corresponding to the medical data of the patient is obtained. And the compressed ciphertext corresponding to the medical data of the patient is stored in the block chain network, so that the storage space can be reduced, the safety of the medical data of the patient is improved, and the medical data of the patient can be effectively managed.
In the embodiment of the application, coordinate information corresponding to target information is determined from a curve of a target function by acquiring the target function for describing information and the target information to be processed; encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information; the data interception length is adopted to intercept the ciphertext corresponding to the target information to obtain a compressed ciphertext corresponding to the target information, and when the compressed ciphertext corresponding to the target information is stored, the storage space of the ciphertext of the target information pair can be reduced, and the storage space is saved; the compressed ciphertext corresponding to the target information is stored in the block chain network, so that the situation that the ciphertext of the target information is falsified and cannot be decrypted according to the ciphertext of the target information to obtain the target information due to the fact that the ciphertext of the target information is stored to the local terminal can be effectively avoided, and the safety of the target information is improved.
As shown in fig. 4, a schematic flow chart of another encryption method for compressing a ciphertext of information provided in this embodiment is shown, and as shown in fig. 4, the schematic flow chart of the another encryption method for compressing a ciphertext of information includes steps S201 to S209.
S201, an objective function for describing information and objective information to be processed are obtained.
And S202, determining coordinate information corresponding to the target information from the curve of the target function.
S203, the coordinate information of the target information is encrypted to obtain a ciphertext of the coordinate information corresponding to the target information.
And S204, compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information.
S205, storing the compressed ciphertext corresponding to the target information into the block chain network.
In the embodiment of the present application, specific contents of steps S201-S205 can refer to the contents set forth in fig. 2, and will not be described in detail here.
S206, receiving an acquisition request for the target information.
And S207, acquiring a compressed ciphertext corresponding to the target information from the block chain network according to the acquisition request.
When an acquisition request for target information is received, namely a request for acquiring the plaintext content of the target information is received, acquiring a compressed ciphertext corresponding to the target information from a block chain network for storing the target information according to the acquisition request.
Optionally, the obtaining request includes an information identifier of the target information, and the corresponding relationship between the information identifier and the block is obtained from a local storage; determining a target block for storing a compressed ciphertext corresponding to the target information according to the corresponding relation; and acquiring a compressed ciphertext corresponding to the target information from the target block in the block chain network.
And acquiring the corresponding relation between the information identifier and the block from the local storage according to the information identifier of the target information. Each information mark has a corresponding storage block. And determining a target block for storing the compressed ciphertext of the target information according to the corresponding relation between the information identifier and the block. And acquiring a compressed ciphertext of the information matched with the information identifier of the target information from the information identifier of at least one candidate information in the target block in the block chain network, wherein the information identifier of the candidate information is used as the compressed ciphertext of the target information.
Optionally, when the compressed ciphertext of the target information is stored in the block chain network, a target block for storing the compressed ciphertext corresponding to the target information may be obtained; constructing a corresponding relation between the target block and the information identifier of the target information; and storing the corresponding relation between the target block and the information identifier of the target information into a local storage.
When the compressed ciphertext of the target information is stored in the block chain network, the block identifier of the target block of the compressed ciphertext for storing the target information can be obtained, the corresponding relation between the information identifier of the target information and the block identifier of the target block is constructed, and the corresponding relation between the information identifier of the target information and the block identifier of the target block is stored in a local storage. Therefore, when the compressed ciphertext of the target information needs to be acquired, the compressed ciphertext of the target information can be acquired quickly.
And S208, decompressing the compressed ciphertext corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information.
S209, the ciphertext of the coordinate information corresponding to the target information is decrypted to obtain the coordinate information corresponding to the target information, and the target information is determined according to the coordinate information corresponding to the target information.
And after the compressed ciphertext of the target information is obtained, decompressing the compressed ciphertext of the target information to obtain the ciphertext of the coordinate information corresponding to the target information. And decrypting the ciphertext of the target information according to the key of the target information to obtain coordinate information corresponding to the target information, and determining the target information according to the coordinate information corresponding to the target information.
Optionally, the compressed ciphertext corresponding to the target information includes the ciphertext of the first coordinate and the lowest bit of the ciphertext of the second coordinate, and the first coordinate and the second coordinate are coordinate information corresponding to the target information. The candidate second coordinates corresponding to the ciphertext of the first coordinates can be obtained from the curve of the target function; taking the candidate second coordinate with the lowest bit being the same as the lowest bit of the ciphertext of the second coordinate as the ciphertext of the second coordinate; and determining the ciphertext of the first coordinate and the ciphertext of the second coordinate as the ciphertext of the coordinate information corresponding to the target information.
And after decompressing the compressed ciphertext of the target information, acquiring the ciphertext of the first coordinate of the target information and the lowest bit of the ciphertext of the second coordinate, wherein the first coordinate and the second coordinate are coordinate information of the target information. The key corresponding to the target information can be obtained, and the ciphertext of the first coordinate is decrypted according to the key corresponding to the target information to obtain the first coordinate. And obtaining a plurality of candidate second coordinates corresponding to the first coordinates according to the expression of the curve corresponding to the objective function and the first coordinates. And decrypting the lowest bit of the ciphertext of the second coordinate to obtain the content of the lowest bit of the second coordinate, using the content of the lowest bit of the second coordinate as a candidate second coordinate with the lowest bit of the second coordinate being the same as the content of the lowest bit of the second coordinate in the candidate second coordinates, and determining the coordinate information corresponding to the target information according to the first coordinate and the second coordinate. For example, the curve corresponding to the objective function is a secp256K1 curve, the first coordinate in the objective information is the X coordinate of the target point on the secp256K1 curve, and the second coordinate in the objective information is the Y coordinate of the target point on the secp256K1 curve. And after the ciphertext of the first coordinate is decrypted to obtain the first coordinate, a plurality of candidate second coordinates are obtained according to the first coordinate and the expression of the secp256K1 curve. Since the secp256K1 curve is an elliptic curve, and when solving according to one X coordinate, values of a plurality of candidate Y coordinates are obtained, a candidate Y coordinate having the same content as the lowest bit of the second coordinate among the plurality of candidate Y coordinates may be determined as the second coordinate according to the lowest bit of the ciphertext of the second coordinate.
In the embodiment of the application, coordinate information corresponding to target information is determined from a curve of a target function by acquiring the target function for describing information and the target information to be processed; encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information; the data interception length is adopted to intercept the ciphertext corresponding to the target information to obtain a compressed ciphertext corresponding to the target information, and when the compressed ciphertext corresponding to the target information is stored, the storage space of the ciphertext of the target information pair can be reduced, and the storage space is saved; the compressed ciphertext corresponding to the target information is stored in the block chain network, so that the situation that the ciphertext of the target information is falsified and cannot be decrypted according to the ciphertext of the target information to obtain the target information due to the fact that the ciphertext of the target information is stored to the local terminal can be effectively avoided, and the safety of the target information is improved. When the target information needs to be obtained, decompressing the compressed ciphertext corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information; and decrypting the ciphertext of the coordinate information corresponding to the target information to obtain the target information.
Fig. 5 is a schematic structural diagram of an encryption apparatus for compressing a ciphertext of information according to an embodiment of the present application, where the apparatus according to the embodiment of the present application may be implemented in the above-mentioned electronic device. In this embodiment, the encryption device for compressing the ciphertext of the information includes:
the first obtaining module 11 is configured to obtain an objective function for describing information and target information to be processed.
And the determining module 12 is configured to determine coordinate information corresponding to the target information from the curve of the target function.
And the encryption module 13 is configured to encrypt the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information.
Wherein, the encryption module 13 includes: the device comprises a fourth acquisition unit, a generation unit and an encryption unit.
A fourth obtaining unit, configured to obtain user information of a target user corresponding to the target information;
the generating unit is used for generating a key corresponding to the target information according to the user information;
and the encryption unit is used for encrypting the coordinate information corresponding to the target information by adopting the key corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information.
And the compression module 14 is configured to perform compression processing on the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information.
The compression module 14 includes: the device comprises a first acquisition unit, an interception unit and a first determination unit.
A first obtaining unit, configured to obtain a data truncation length, where the data truncation length is greater than a byte length of the first coordinate or greater than a byte length of the second coordinate, and is less than a sum of the byte length of the first coordinate and the byte length of the second coordinate;
the intercepting unit is used for continuously intercepting the ciphertext with the length of the data intercepting length from the ciphertext of the coordinate information corresponding to the target information;
and the first determining unit is used for determining the intercepted ciphertext as the compressed ciphertext corresponding to the target information.
Wherein the intercepting unit is specifically configured to:
intercepting the ciphertext of the first coordinate and the lowest bit of the ciphertext of the second coordinate from the ciphertext of the coordinate information corresponding to the target information;
and determining the lowest bit of the ciphertext of the first coordinate and the ciphertext of the second coordinate as the intercepted ciphertext.
And the storage module 15 is configured to store the compressed ciphertext corresponding to the target information into the block chain network.
The coordinate information corresponding to the target information comprises a first coordinate and a second coordinate;
wherein the apparatus further comprises:
a receiving module, configured to receive an acquisition request for the target information;
the second obtaining module is used for obtaining a compressed ciphertext corresponding to the target information from the block chain network according to the obtaining request;
the decompression module is used for decompressing the compressed ciphertext corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information;
and the decryption module is used for decrypting the ciphertext of the coordinate information corresponding to the target information to obtain the coordinate information corresponding to the target information, and determining the target information according to the coordinate information corresponding to the target information.
The compressed ciphertext corresponding to the target information comprises the ciphertext of the first coordinate and the lowest bit of the ciphertext of the second coordinate, and the first coordinate and the second coordinate are coordinate information corresponding to the target information;
the decompression module comprises:
the second obtaining unit is used for obtaining candidate second coordinates corresponding to the ciphertext of the first coordinates from the curve of the target function;
a second determining unit configured to determine, as a ciphertext of the second coordinate, a candidate second coordinate in which a lowest bit of the candidate second coordinates is the same as a lowest bit of a ciphertext of the second coordinate;
and the third determining unit is used for determining the ciphertext of the first coordinate and the ciphertext of the second coordinate as the ciphertext of the coordinate information corresponding to the target information.
Wherein, the obtaining request includes an information identifier of the target information, and the second obtaining module includes:
the fourth determining unit is used for acquiring the corresponding relation between the information identifier and the block from the local storage; determining a target block for storing a compressed ciphertext corresponding to the target information according to the corresponding relation;
and the third acquisition unit is used for acquiring the compressed ciphertext corresponding to the target information from the target block in the block chain network.
In the embodiment of the application, coordinate information corresponding to target information is determined from a curve of a target function by acquiring the target function for describing information and the target information to be processed; encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information; the data interception length is adopted to intercept the ciphertext corresponding to the target information to obtain a compressed ciphertext corresponding to the target information, and when the compressed ciphertext corresponding to the target information is stored, the storage space of the ciphertext of the target information pair can be reduced, and the storage space is saved; the compressed ciphertext corresponding to the target information is stored in the block chain network, so that the situation that the ciphertext of the target information is falsified and cannot be decrypted according to the ciphertext of the target information to obtain the target information due to the fact that the ciphertext of the target information is stored to the local terminal can be effectively avoided, and the safety of the target information is improved. When the target information needs to be obtained, decompressing the compressed ciphertext corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information; and decrypting the ciphertext of the coordinate information corresponding to the target information to obtain the target information.
Please refer to fig. 6, which is a schematic structural diagram of an electronic device provided in an embodiment of the present application, where the electronic device in the embodiment shown in fig. 6 may include: one or more processors 21; one or more input devices 22, one or more output devices 23, and a memory 24. The processor 21, the input device 22, the output device 23, and the memory 24 are connected by a bus 25.
The Processor 21 may be a Central Processing Unit (CPU), and may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate ArraY (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 22 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., the output device 23 may include a display (LCD, etc.), a speaker, etc., and the output device 23 may output the data table after the correction process.
The memory 24 may include both read-only memory and random access memory and provides instructions and data to the processor 21. A portion of memory 24 may also include a non-volatile random access memory, memory 24 being configured to store a computer program comprising program instructions, processor 21 being configured to execute the program instructions stored by memory 24 for performing an encryption method for compressing ciphertext of information, i.e. for performing the following operations:
acquiring a target function for describing information and target information to be processed;
determining coordinate information corresponding to the target information from the curve of the target function;
encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information;
compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information;
and storing the compressed ciphertext corresponding to the target information into a block chain network.
Optionally, the processor 21 is configured to execute program instructions stored in the memory 24 for performing the following operations:
acquiring a data interception length, wherein the data interception length is greater than the byte length of the first coordinate, or greater than the byte length of the second coordinate and less than the sum of the byte length of the first coordinate and the byte length of the second coordinate;
continuously intercepting the ciphertext with the length of the data interception length from the ciphertext of the coordinate information corresponding to the target information;
and determining the intercepted ciphertext as a compressed ciphertext corresponding to the target information.
Optionally, the processor 21 is configured to execute program instructions stored in the memory 24 for performing the following operations:
intercepting the ciphertext of the first coordinate and the lowest bit of the ciphertext of the second coordinate from the ciphertext of the coordinate information corresponding to the target information;
and determining the lowest bit of the ciphertext of the first coordinate and the ciphertext of the second coordinate as the intercepted ciphertext.
Optionally, the processor 21 is configured to execute program instructions stored in the memory 24 for performing the following operations:
receiving an acquisition request aiming at the target information;
acquiring a compressed ciphertext corresponding to the target information from the block chain network according to the acquisition request;
decompressing the compressed ciphertext corresponding to the target information to obtain a ciphertext of the coordinate information corresponding to the target information;
and decrypting the ciphertext of the coordinate information corresponding to the target information to obtain the coordinate information corresponding to the target information, and determining the target information according to the coordinate information corresponding to the target information.
Optionally, the processor 21 is configured to execute program instructions stored in the memory 24 for performing the following operations:
acquiring a candidate second coordinate corresponding to the ciphertext of the first coordinate from the curve of the target function;
taking the candidate second coordinate with the lowest bit being the same as the lowest bit of the ciphertext of the second coordinate as the ciphertext of the second coordinate;
and determining the ciphertext of the first coordinate and the ciphertext of the second coordinate as the ciphertext of the coordinate information corresponding to the target information.
Optionally, the processor 21 is configured to execute program instructions stored in the memory 24 for performing the following operations:
acquiring the corresponding relation between the information identification and the block from a local storage; determining a target block for storing a compressed ciphertext corresponding to the target information according to the corresponding relation;
and acquiring a compressed ciphertext corresponding to the target information from a target block in the block chain network.
Optionally, the processor 21 is configured to execute program instructions stored in the memory 24 for performing the following operations:
acquiring user information of a target user corresponding to the target information;
generating a key corresponding to the target information according to the user information;
and encrypting the coordinate information corresponding to the target information by adopting the key corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information.
The processor 21, the input device 22, and the output device 23 described in this embodiment of the present application may execute the implementation described in the embodiment of the encryption method for compressing the ciphertext of the information provided in this embodiment of the present application, and may also execute the implementation of the electronic device described in this embodiment of the present application, which is not described herein again.
In the embodiment of the application, coordinate information corresponding to target information is determined from a curve of a target function by acquiring the target function for describing information and the target information to be processed; encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information; the data interception length is adopted to intercept the ciphertext corresponding to the target information to obtain a compressed ciphertext corresponding to the target information, and when the compressed ciphertext corresponding to the target information is stored, the storage space of the ciphertext of the target information pair can be reduced, and the storage space is saved; the compressed ciphertext corresponding to the target information is stored in the block chain network, so that the situation that the ciphertext of the target information is falsified and cannot be decrypted according to the ciphertext of the target information to obtain the target information due to the fact that the ciphertext of the target information is stored to the local terminal can be effectively avoided, and the safety of the target information is improved. When the target information needs to be obtained, decompressing the compressed ciphertext corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information; and decrypting the ciphertext of the coordinate information corresponding to the target information to obtain the target information.
A computer-readable storage medium is further provided in the embodiments of the present application, and stores a computer program, where the computer program includes program instructions, and the program instructions, when executed by a processor, implement an encryption method for compressing a ciphertext of information as shown in the embodiments of fig. 2 and 4.
The computer readable storage medium may be an internal storage unit of the electronic device according to any of the foregoing embodiments, for example, a hard disk or a memory of the control device. The computer-readable storage medium may also be an external storage device of the control device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the control device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the control device. The computer-readable storage medium is used to store the computer program and other programs and data required by the control device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the control device and the unit described above may refer to corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed control device and method may be implemented in other ways. For example, the above-described apparatus embodiments are illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. An encryption method for compressing a ciphertext of an information, comprising:
acquiring a target function for describing information and target information to be processed;
determining coordinate information corresponding to the target information from the curve of the target function;
encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information;
compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information;
and storing the compressed ciphertext corresponding to the target information into a block chain network.
2. The method of claim 1, wherein the coordinate information corresponding to the target information comprises a first coordinate and a second coordinate; compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information, including:
acquiring a data interception length, wherein the data interception length is greater than the byte length of the first coordinate, or greater than the byte length of the second coordinate and less than the sum of the byte length of the first coordinate and the byte length of the second coordinate;
continuously intercepting the ciphertext with the length of the data interception length from the ciphertext of the coordinate information corresponding to the target information;
and determining the intercepted ciphertext as a compressed ciphertext corresponding to the target information.
3. The method according to claim 2, wherein the successively truncating the ciphertext with the length of the data truncation from the ciphertext of the coordinate information corresponding to the target information comprises:
intercepting the ciphertext of the first coordinate and the lowest bit of the ciphertext of the second coordinate from the ciphertext of the coordinate information corresponding to the target information;
and determining the lowest bit of the ciphertext of the first coordinate and the ciphertext of the second coordinate as the intercepted ciphertext.
4. The method of claim 3, further comprising:
receiving an acquisition request aiming at the target information;
acquiring a compressed ciphertext corresponding to the target information from the block chain network according to the acquisition request;
decompressing the compressed ciphertext corresponding to the target information to obtain a ciphertext of the coordinate information corresponding to the target information;
and decrypting the ciphertext of the coordinate information corresponding to the target information to obtain the coordinate information corresponding to the target information, and determining the target information according to the coordinate information corresponding to the target information.
5. The method according to claim 4, wherein the compressed ciphertext corresponding to the target information comprises the lowest bit of the ciphertext of the first coordinate and the ciphertext of the second coordinate, and the first coordinate and the second coordinate are coordinate information corresponding to the target information;
the decompressing the compressed ciphertext corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information includes:
acquiring a candidate second coordinate corresponding to the ciphertext of the first coordinate from the curve of the target function;
taking the candidate second coordinate with the lowest bit being the same as the lowest bit of the ciphertext of the second coordinate as the ciphertext of the second coordinate;
and determining the ciphertext of the first coordinate and the ciphertext of the second coordinate as the ciphertext of the coordinate information corresponding to the target information.
6. The method according to claim 4, wherein the obtaining request includes an information identifier of the target information, and the obtaining a compressed ciphertext corresponding to the target information from the blockchain network according to the obtaining request includes:
acquiring the corresponding relation between the information identification and the block from a local storage; determining a target block for storing a compressed ciphertext corresponding to the target information according to the corresponding relation;
and acquiring a compressed ciphertext corresponding to the target information from a target block in the block chain network.
7. The method according to claim 1, wherein the encrypting the coordinate information of the target information to obtain the ciphertext of the coordinate information corresponding to the target information comprises:
acquiring user information of a target user corresponding to the target information;
generating a key corresponding to the target information according to the user information;
and encrypting the coordinate information corresponding to the target information by adopting the key corresponding to the target information to obtain the ciphertext of the coordinate information corresponding to the target information.
8. An encryption apparatus that compresses a ciphertext of information, comprising:
the first acquisition module is used for acquiring a target function for describing information and target information to be processed;
the determining module is used for determining coordinate information corresponding to the target information from a curve of the target function;
the encryption module is used for encrypting the coordinate information of the target information to obtain a ciphertext of the coordinate information corresponding to the target information;
the compression module is used for compressing the ciphertext of the coordinate information corresponding to the target information to obtain a compressed ciphertext corresponding to the target information;
and the storage module is used for storing the compressed ciphertext corresponding to the target information into the block chain network.
9. A computer device, comprising: a processor, a memory, and a network interface;
the processor is connected to a memory for providing data communication functions, a network interface for storing program code, and a processor for calling the program code to perform the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the steps of the method according to any one of claims 1 to 7.
CN202011053192.4A 2020-09-29 2020-09-29 Encryption method, device, equipment and medium for compressing ciphertext of information Pending CN112131591A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011053192.4A CN112131591A (en) 2020-09-29 2020-09-29 Encryption method, device, equipment and medium for compressing ciphertext of information
PCT/CN2021/109259 WO2022068359A1 (en) 2020-09-29 2021-07-29 Encryption method and apparatus for compressing ciphertext of information, and device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011053192.4A CN112131591A (en) 2020-09-29 2020-09-29 Encryption method, device, equipment and medium for compressing ciphertext of information

Publications (1)

Publication Number Publication Date
CN112131591A true CN112131591A (en) 2020-12-25

Family

ID=73843142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011053192.4A Pending CN112131591A (en) 2020-09-29 2020-09-29 Encryption method, device, equipment and medium for compressing ciphertext of information

Country Status (2)

Country Link
CN (1) CN112131591A (en)
WO (1) WO2022068359A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468583A (en) * 2021-07-26 2021-10-01 华链时代(北京)科技有限公司 Encrypted data processing method and device based on block chain and electronic equipment
WO2022068359A1 (en) * 2020-09-29 2022-04-07 深圳壹账通智能科技有限公司 Encryption method and apparatus for compressing ciphertext of information, and device and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10084600B1 (en) * 2018-04-16 2018-09-25 Xage Security, Inc. Decentralized information protection for confidentiality and tamper-proofing on distributed database
CN110532323A (en) * 2019-09-02 2019-12-03 腾讯科技(深圳)有限公司 Pupilage information processing method, device, electronic equipment and storage medium in block chain network
CN110839026A (en) * 2019-11-12 2020-02-25 深圳市网心科技有限公司 Data processing method based on block chain and related equipment
CN111079162A (en) * 2019-12-13 2020-04-28 山东众阳健康科技集团有限公司 Data encryption method, data decryption method and data encryption system based on block chain

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103023892A (en) * 2012-12-03 2013-04-03 江苏乐买到网络科技有限公司 Network information processing system
CN108830600B (en) * 2018-06-19 2022-02-18 方欣科技有限公司 Block chain-based electronic invoice system and implementation method
CN108964916B (en) * 2018-08-03 2021-07-16 中思博安科技(北京)有限公司 Signature generation method, generation device, signature verification method and verification device
WO2020034151A1 (en) * 2018-08-16 2020-02-20 区链通网络有限公司 Block chain inter-node communication method and apparatus, and storage medium and block chain system
CN109948357A (en) * 2018-11-15 2019-06-28 陕西医链区块链集团有限公司 System for connecting medical block chain and Internet of things
CN109347878B (en) * 2018-11-30 2020-06-05 西安电子科技大学 Decentralized data verification and data security transaction system and method
CN110602083B (en) * 2019-09-10 2022-04-29 上海黔易数据科技有限公司 Secure transmission and storage method of digital identity authentication data
CN110830235B (en) * 2019-11-08 2023-03-07 华侨大学 Intelligent vehicle networking trusted data encryption method and system based on block chain
CN111079171A (en) * 2019-11-11 2020-04-28 重庆邮电大学 Block chain-based medical data privacy protection method and storage medium
CN112131591A (en) * 2020-09-29 2020-12-25 深圳壹账通智能科技有限公司 Encryption method, device, equipment and medium for compressing ciphertext of information

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10084600B1 (en) * 2018-04-16 2018-09-25 Xage Security, Inc. Decentralized information protection for confidentiality and tamper-proofing on distributed database
CN110532323A (en) * 2019-09-02 2019-12-03 腾讯科技(深圳)有限公司 Pupilage information processing method, device, electronic equipment and storage medium in block chain network
CN110839026A (en) * 2019-11-12 2020-02-25 深圳市网心科技有限公司 Data processing method based on block chain and related equipment
CN111079162A (en) * 2019-12-13 2020-04-28 山东众阳健康科技集团有限公司 Data encryption method, data decryption method and data encryption system based on block chain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022068359A1 (en) * 2020-09-29 2022-04-07 深圳壹账通智能科技有限公司 Encryption method and apparatus for compressing ciphertext of information, and device and medium
CN113468583A (en) * 2021-07-26 2021-10-01 华链时代(北京)科技有限公司 Encrypted data processing method and device based on block chain and electronic equipment

Also Published As

Publication number Publication date
WO2022068359A1 (en) 2022-04-07

Similar Documents

Publication Publication Date Title
CN111628868B (en) Digital signature generation method and device, computer equipment and storage medium
CN109922084B (en) Key management method and device and electronic equipment
US20130028419A1 (en) System and a method for use in a symmetric key cryptographic communications
WO2022068355A1 (en) Encryption method and apparatus based on feature of information, device, and storage medium
CN112202554B (en) Information processing method, device and equipment for generating key based on attribute of information
CN113691502A (en) Communication method, communication device, gateway server, client and storage medium
WO2022068358A1 (en) Encryption method and apparatus for generating keys on basis of attributes of information, and device
US11616643B2 (en) System and method of management of a shared cryptographic account
CN112202779B (en) Block chain based information encryption method, device, equipment and medium
WO2022068359A1 (en) Encryption method and apparatus for compressing ciphertext of information, and device and medium
CN112804218A (en) Data processing method, device and equipment based on block chain and storage medium
CN112184444A (en) Method, apparatus, device and medium for processing information based on information characteristics
WO2022068360A1 (en) Shared root key-based information processing method and apparatus, and device and medium
CN111404892B (en) Data supervision method and device and server
TW202232913A (en) Generating shared keys
Preethi et al. A high secure medical image storing and sharing in cloud environment using hex code cryptography method—secure genius
CN112100144A (en) Block chain file sharing method and device, storage medium and electronic equipment
CN112133386A (en) Block chain-based information processing method, device, equipment and medium
WO2022068234A1 (en) Encryption method and apparatus based on shared root key, device and medium
Yoosuf Lightweight fog‐centric auditing scheme to verify integrity of IoT healthcare data in the cloud environment
CN112202555B (en) Information processing method, device and equipment for generating random number based on information attribute
Alkhabet et al. Security algorithms for distributed storage system for E-health application over wireless body area network
US20230028854A1 (en) System and method of cryptographic key management in a plurality of blockchain based computer networks
KR20210036700A (en) Blockchain system for supporting change of plain text data included in transaction
WO2022068361A1 (en) Encryption method and apparatus based on amendment amount, and device, and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information

Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant after: ONECONNECT FINANCIAL TECHNOLOGY Co.,Ltd. (SHANGHAI)

Address before: Room 201, Building A, No. 1 Qianwan Road, Qianhaisheng Cooperation Zone, Shenzhen City, Guangdong Province, 518000

Applicant before: ONECONNECT FINANCIAL TECHNOLOGY Co.,Ltd. (SHANGHAI)

CB02 Change of applicant information
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination