CN114710271A - Method and device for sharing encrypted data, storage medium and electronic equipment - Google Patents

Method and device for sharing encrypted data, storage medium and electronic equipment Download PDF

Info

Publication number
CN114710271A
CN114710271A CN202210276787.9A CN202210276787A CN114710271A CN 114710271 A CN114710271 A CN 114710271A CN 202210276787 A CN202210276787 A CN 202210276787A CN 114710271 A CN114710271 A CN 114710271A
Authority
CN
China
Prior art keywords
private key
key factor
terminal device
random number
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210276787.9A
Other languages
Chinese (zh)
Other versions
CN114710271B (en
Inventor
周云宏
李向锋
张妍
郑亚杰
颜雪薇
王佳欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING CERTIFICATE AUTHORITY
Original Assignee
BEIJING CERTIFICATE AUTHORITY
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 BEIJING CERTIFICATE AUTHORITY filed Critical BEIJING CERTIFICATE AUTHORITY
Priority to CN202210276787.9A priority Critical patent/CN114710271B/en
Publication of CN114710271A publication Critical patent/CN114710271A/en
Application granted granted Critical
Publication of CN114710271B publication Critical patent/CN114710271B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/20Network architectures or network communication protocols for network security for managing network security; network security policies in general
    • H04L63/205Network architectures or network communication protocols for network security for managing network security; network security policies in general involving negotiation or determination of the one or more network security mechanisms to be used, e.g. by negotiation between the client and the server or between peers or by selection according to the capabilities of the entities involved
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds

Abstract

The embodiment of the application provides a method, a device, a storage medium and electronic equipment for sharing encrypted data, wherein the method comprises the following steps: generating a first random number and a second random number; sending a first random number to the first terminal equipment so that the first terminal equipment can calculate a first intermediate value by using the first random number; sending a second random number to the second terminal device so that the second terminal device can calculate a second intermediate value by using the second random number and the first intermediate value; calculating a fourth private key factor by using the first random number, the second private key factor and the second intermediate value; receiving a data sharing request which is sent by second terminal equipment and carries a third private key factor; the data sharing request is used for requesting to share the encrypted data; decrypting the encrypted data by using the third private key factor and the fourth private key factor to obtain data to be shared; and sending the data to be shared to the second terminal equipment. By means of the technical scheme, convenience can be improved.

Description

Method and device for sharing encrypted data, storage medium and electronic equipment
Technical Field
The present application relates to the field of data sharing technologies, and in particular, to a method, an apparatus, a storage medium, and an electronic device for sharing encrypted data.
Background
With the development of internet technology, more and more applications select to store a large amount of data in the cloud, and the files in the cloud can be accessed locally through a proper identity authentication and access control mechanism, even a plurality of third-party applications exist, and a special storage space is increased to be provided for users to use in a renting mode. Such as cloud albums, cloud documents, cloud disks, and the like, and may even be blockchains. In this mode, the user would typically want to encrypt all or part of the data, since the user cannot unconditionally trust the third party storage space, which may be concerned about data leakage or illegal use.
At present, the existing proxy re-encryption method supports a proxy server to convert a ciphertext encrypted by a user with a public key into a ciphertext that another user can decrypt with a private key, and does not reveal the private key and plaintext information of the user. For example, the first device utilizes its public key PAAfter the original data M is encrypted, the encrypted data C is obtained, and the encrypted data C can use a private key S stored by the first equipmentADecryption is performed, and then the first device can upload the encrypted data C to the cloud server. Subsequently, when the second device needs to decrypt the encrypted data C, the conversion key K can be generated for itABAnd the cloud server can use the conversion key KABThe encrypted data C is converted into intermediate data C 'and the intermediate data C' may be transmitted to the second device. Subsequently, the second device may use the private key SBAnd decrypting the intermediate data C' to obtain the original data M. Therefore, under the mechanism, the original data M and the private key S cannot be obtained by the cloud serverAAnd a private key SBIt can only obtain the conversion key KABThereby ensuring the safety of data.
In the process of implementing the invention, the inventor finds that the following problems exist in the prior art: the existing proxy re-encryption method has the technical problem of inconvenience. For example, although the existing proxy re-encryption method can basically realize the sharing of the first device to the second device, the first device and the second device are non-peer in data decryption, that is, the first device can share the document to the second device, but the second device cannot share the modified data encryption to the first device using the own key, and if encryption is required, the second device needs to use the proxy re-encryption mechanism again.
Disclosure of Invention
An embodiment of the application aims to provide a method, a device, a storage medium and an electronic device for sharing encrypted data, so as to achieve the effect of improving convenience.
In a first aspect, an embodiment of the present application provides a method for sharing encrypted data, where the method is applied to a server in a data protection system, the data protection system includes a first terminal device, a second terminal device, and the server, and the first terminal device stores a first private key factor for calculating a first shared private key, and the server stores a second private key factor for calculating the first shared private key, and the method includes: generating a first random number and a second random number; sending a first random number to the first terminal equipment so that the first terminal equipment can calculate a first intermediate value by using the first random number and the first private key factor; sending a second random number to the second terminal device so that the second terminal device can calculate a second intermediate value by using a third private key factor randomly generated by the second terminal device, the second random number and the first intermediate value; the third private key factor is used for calculating a second shared private key, and the second shared private key and the first shared private key are the same private key; receiving a second intermediate value returned by the second terminal equipment; calculating a fourth private key factor for calculating a second shared private key using the first random number, the second private key factor, and the second intermediate value; receiving a data sharing request which is sent by second terminal equipment and carries a third private key factor; the data sharing request is used for requesting to share encrypted data encrypted by the first terminal equipment by using a first private key factor; decrypting the encrypted data by using the third private key factor and the fourth private key factor to obtain data to be shared; and sending the data to be shared to the second terminal equipment.
Therefore, according to the embodiment of the application, the first terminal device and the second terminal device are equivalent in data decryption by means of the technical scheme, and compared with the existing proxy re-encryption method, the method is more convenient and fast in supporting the cross-device file sharing scene through the external storage service.
In one possible embodiment, the fourth privacy factor is calculated by the following formula:
Figure BDA0003556065170000031
wherein d is4Is a fourth private key factor, d2Is a second private key factor, β is a second intermediate value; rho2Is a second random number, p1Is a first random number.
In one possible embodiment, the second intermediate value is calculated by the following formula:
β=α(d3ρ2)-1
wherein alpha is a first intermediate value and d3Is the third private key factor.
In one possible embodiment, the first intermediate value is calculated by the following formula:
α=d1ρ1
wherein d is1Is a first private key factor.
In a second aspect, an embodiment of the present application provides a method for sharing encrypted data, where the method is applied to a second terminal device in a data protection system, the data protection system includes a first terminal device, a server, and the second terminal device, and the first terminal device stores a first private key factor for calculating a first shared private key, and the server stores a second private key factor for calculating the first shared private key, and the method includes: receiving a second random number sent by the server; calculating a second intermediate value by using a third private key factor, a second random number and the first intermediate value which are randomly generated by the first private key factor; the third private key factor is used for calculating a second shared private key, the second shared private key and the first shared private key are the same private key, and the first intermediate value is calculated by the first terminal device by using the first random number and the first private key factor sent by the server; sending the second intermediate value to the server, so that the server calculates a fourth private key factor for calculating the second shared private key by using the first random number, the second private key factor and the second intermediate value; sending a data sharing request carrying a third private key factor and used for requesting to share the encrypted data encrypted by the first terminal equipment by using the first private key factor to the server, so that the server decrypts the encrypted data by using the third private key factor and a fourth private key factor to obtain the data to be shared; and receiving the data to be shared sent by the server.
In a third aspect, an embodiment of the present application provides an apparatus for sharing encrypted data, where the apparatus is applied to a server in a data protection system, the data protection system includes a first terminal device, a second terminal device, and the server, and the first terminal device stores a first private key factor for calculating a first shared private key, and the server stores a second private key factor for calculating the first shared private key, and the apparatus includes: the generating module is used for generating a first random number and a second random number; the first sending module is used for sending a first random number to the first terminal equipment so that the first terminal equipment can calculate a first intermediate value by using the first random number and a first private key factor; the second sending module is used for sending a second random number to the second terminal equipment so that the second terminal equipment can calculate a second intermediate value by using a third private key factor, the second random number and the first intermediate value which are randomly generated by the second terminal equipment; the third private key factor is used for calculating a second shared private key, and the second shared private key and the first shared private key are the same private key; the first receiving module is used for receiving a second intermediate value returned by the second terminal equipment; the first calculation module is used for calculating a fourth private key factor used for calculating the second shared private key by using the first random number, the second private key factor and the second intermediate value; the second receiving module is used for receiving a data sharing request which is sent by the second terminal equipment and carries a third private key factor; the data sharing request is used for requesting to share encrypted data encrypted by the first terminal equipment by using a first private key factor; the decryption module is used for decrypting the encrypted data by using the third private key factor and the fourth private key factor to obtain data to be shared; and the third sending module is used for sending the data to be shared to the second terminal equipment.
In one possible embodiment, the fourth private key factor is calculated by the following formula:
Figure BDA0003556065170000041
wherein d is4Is a fourth private key factor, d2Is a second private key factor, β is a second intermediate value; rho2Is a second random number, p1Is a first random number.
In one possible embodiment, the second intermediate value is calculated by the following formula:
β=α(d3ρ2)-1
wherein alpha is a first intermediate value and d3Is the third private key factor.
In one possible embodiment, the first intermediate value is calculated by the following formula:
α=d1ρ1
wherein d is1Is a first private key factor.
In a fourth aspect, an embodiment of the present application provides an apparatus for sharing encrypted data, where the apparatus is applied to a second terminal device in a data protection system, the data protection system includes a first terminal device, a server, and the second terminal device, and the first terminal device stores a first private key factor for calculating a first shared private key, and the server stores a second private key factor for calculating the first shared private key, and the apparatus includes: the third receiving module is used for receiving a second random number sent by the server; the second calculation module is used for calculating a second intermediate value by utilizing a third private key factor, a second random number and the first intermediate value which are randomly generated by the second calculation module; the third private key factor is used for calculating a second shared private key, the second shared private key and the first shared private key are the same private key, and the first intermediate value is calculated by the first terminal device by using the first random number and the first private key factor sent by the server; the fourth sending module is used for sending the second intermediate value to the server so that the server can calculate a fourth private key factor for calculating the second shared private key by using the first random number, the second private key factor and the second intermediate value; the fifth sending module is used for sending a data sharing request carrying a third private key factor and used for requesting to share the encrypted data encrypted by the first terminal equipment by using the first private key factor to the server, so that the server can decrypt the encrypted data by using the third private key factor and the fourth private key factor to obtain the data to be shared; and the fourth receiving module is used for receiving the data to be shared sent by the server.
In a fifth aspect, the present application provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the method according to the first aspect or any optional implementation manner of the first aspect.
In a sixth aspect, the present application provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the method of the second aspect or any optional implementation manner of the second aspect.
In a seventh aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is running, the machine-readable instructions when executed by the processor performing the method of the first aspect or any of the alternative implementations of the first aspect.
In an eighth aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is running, the machine-readable instructions when executed by the processor performing the method of the second aspect or any of the alternative implementations of the second aspect.
In a ninth aspect, the present application provides a computer program product comprising a storage medium storing a computer program, which when executed by at least one processor, causes the at least one processor to perform the method of the first aspect or any of the alternative implementations of the first aspect.
In a tenth aspect, the present application provides a computer program product comprising a storage medium storing a computer program which, when executed by at least one processor, causes the at least one processor to perform the method of the second aspect or any of the alternative implementations of the second aspect.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic diagram illustrating a data protection system provided in an embodiment of the present application;
fig. 2 is a flowchart illustrating a method for sharing encrypted data according to an embodiment of the present application;
fig. 3 is a block diagram illustrating a structure of an apparatus for sharing encrypted data according to an embodiment of the present application;
fig. 4 is a block diagram illustrating a structure of an apparatus for sharing encrypted data according to an embodiment of the present application;
fig. 5 shows a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
At present, in addition to the method of proxy re-encryption, there are several methods as follows:
one is that the data file may be encrypted by using a password or the like. For example, a zip compressed file may be encrypted using a password derived key using an encryption algorithm, and when a user retrieves encrypted data from an external storage, the same password may be entered for use in decryption using a method equivalent to encryption. However, the method is simple and easy to use, but the complexity of the password is insufficient, so that the method cannot be used for simple brute force cracking, and the complex password is difficult to memorize;
the other is to encrypt the data by the operator of the third-party storage space, and when the user accesses the data, the data is decrypted and then provided at the storage server. And because the key is complex enough, the method can resist guess type and violence analysis type attacks and effectively resist the behavior of stealing user data by external attackers. However, for users, besides worrying about data acquisition by external personnel, the users also worry about the storage space operators actively or passively stealing user data, and the encryption mode cannot cope with the threat;
the other method is that the user uses the own held key to encrypt. Since the key is very sensitive data, in the formal scenario, compliance is to use a dedicated cryptographic module to generate and store the key. According to the requirement of the secondary cryptographic module, after the key is generated in the cryptographic module, the key is difficult to export and copy to other devices, so that the encrypted data in a certain device is difficult to decrypt and use across the devices. So it faces problems including:
the device can not be repaired when the device is lost or damaged, especially when the user uses the mobile device;
when a user has a plurality of devices, the data can not be used across the devices;
when a user wants to authorize other people to use own data, the user needs to decrypt the data and then transmit the decrypted data to other people, and the operation is complex;
another way is to use a client and server cooperative approach to accomplish decryption, which can mathematically divide the key into a server component and a client component (e.g., the server side stores a key factor, and the client side also stores a key factor), which, although it can reduce the risk of secure storage and use of the terminal key, is of little help to solve the above problems.
Based on this, the embodiment of the present application provides a smart sharing scheme for implementing cross-device encrypted data, by generating a first random number and a second random number by a server, and calculating a first intermediate value by a first terminal device using the first random number and a first secret key factor stored in advance, and also calculating a second intermediate value by a second terminal device using a third secret key factor generated randomly by the second terminal device, the second random number and the first intermediate value, and also calculating a fourth secret key factor for calculating a second shared secret key by the server using the first random number, the second secret key factor and the second intermediate value, and finally the second terminal device may interact with the server based on the third secret key factor, so that the encrypted data encrypted by the first terminal device may be accessed.
Therefore, according to the embodiment of the application, the first terminal device and the second terminal device are equivalent in data decryption by means of the technical scheme, and compared with the existing proxy re-encryption method, the method is more convenient and fast in supporting the cross-device file sharing scene through the external storage service.
For example, since the second terminal device and the server generate the third private key factor and the fourth private key factor which are matched with each other, and the third private key factor and the fourth private key factor can generate the second shared private key which is the same as the first shared private key, no matter the second shared terminal accesses the encrypted data encrypted by the first shared terminal, or the second shared terminal shares the data encrypted by the second shared terminal with the first shared terminal, it is not necessary to perform an additional process (for example, perform a process of proxy re-encryption once again, etc.) again, so that convenience can be improved.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a data protection system according to an embodiment of the present disclosure. As shown in fig. 1, the data protection system includes a first terminal device, a second terminal device, and a server. The server can be respectively connected with the first terminal device and the second terminal device in a communication mode, and the second terminal device can also be connected with the first terminal device in a communication mode.
It should be understood that the specific device of the first terminal device, the specific device of the second terminal device, the specific device of the server, and the like may all be set according to actual needs, and the embodiment of the present application is not limited thereto.
For example, the first terminal device may be a mobile phone, a computer, or the like.
For another example, the server may be a single server, a server cluster, or the like.
In order to facilitate understanding of the embodiments of the present application, the following description is given by way of specific examples.
Specifically, the server generates a first random number and a second random number. Subsequently, the server may transmit the first random number to the first terminal device. Correspondingly, the first terminal equipment receives the first random number sent by the server. And the first terminal equipment can calculate a first intermediate value by utilizing the first random number and the first private key factor and sends the first intermediate value to the server.
And the server may also transmit the second random number to the second terminal device. Correspondingly, the second terminal equipment receives the second random number sent by the server. And the second terminal equipment calculates a second intermediate value by using the third private key factor, the second random number and the first intermediate value which are randomly generated by the second terminal equipment, and sends the second intermediate value to the server.
And the server may calculate a fourth private key factor for calculating the second shared private key using the first random number, the second private key factor, and the second intermediate value.
And under the condition that the first terminal equipment allows the second terminal equipment to access the encrypted data, the second terminal equipment sends a data sharing request carrying a third private key factor to the server. Correspondingly, the server receives the data sharing request sent by the second terminal device.
And the server can decrypt the encrypted data by using the third private key factor and the fourth private key factor to obtain the data to be shared, and sends the data to be shared to the second terminal equipment. Correspondingly, the second terminal equipment receives the data to be shared sent by the server.
It should be understood that, although fig. 1 shows a specific schematic diagram of a data protection system, it should be understood by those skilled in the art that the data protection system may also be configured according to actual needs, and the embodiments of the present application are not limited thereto.
For example, the data protection system may also include more terminal devices.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for sharing encrypted data according to an embodiment of the present application. The method shown in fig. 2 is applied to a data protection system, the data protection system includes a first terminal device, a second terminal device and a server, and the first terminal device stores a first private key factor for calculating a first shared private key, and the server stores a second private key factor for calculating the first shared private key, including:
in step S211, the server acquires the encrypted data and stores the encrypted data in the external storage device.
It should be understood that the specific device of the external storage device may be set according to actual requirements, and the embodiments of the present application are not limited thereto.
For example, the external storage device may be a database or the like.
In order to facilitate understanding of step S211, the following description is made by specific embodiments.
In particular, the first terminal device and the server may cooperatively generate a key pair such that the first terminal device may hold a first private key factor and the server may hold a second private key factor. And, the first private key factor and the second private key factor may have the following relationship:
d=ξ(d1,d2);
wherein d is a first shared private key, d1Is a first private key factor, d2Is the second private key factor.
It should also be understood that the specific function of the ξ function may be set according to actual needs, and the embodiments of the present application are not limited to this.
For example, the function may vary depending on the particular key scheme (e.g., modulo plus modulo reduction, modulo multiplication, etc. for the elliptic curve cryptosystem; modulo plus modulo reduction, etc. for the RSA scheme).
Subsequently, the user may first encrypt the data to be uploaded by using a key on the own device (e.g., the first terminal device) to obtain encrypted data. And after the encrypted data are uploaded, the server can store the encrypted data in the external storage device. At this time, the user can complete decryption using the cryptographic module of the terminal side (e.g., first terminal device) in cooperation with the service of the cryptographic service side (e.g., server).
It should also be understood that the manner of obtaining the key, the specific method of encryption, and the like may be set according to actual requirements, and the embodiment of the present application is not limited thereto.
For example, the key may be obtained by u-key or the like.
For another example, the encryption method may be an SM2 encryption algorithm, an ECIES encryption algorithm, an RSA encryption algorithm, or the like.
It should also be understood that the specific manner in which the user can use the cryptographic module at the terminal side and the service at the cryptographic service side to cooperatively complete decryption may be set according to actual requirements, and the embodiment of the present application is not limited thereto.
In step S212, the server generates a first random number and a second random number.
It should be understood that the specific number of the first random number and the specific number of the second random number may be set according to actual requirements as long as it is ensured that the first random number and the second random number are randomly generated, and the embodiment of the present application is not limited thereto.
Step S213, the server transmits the first random number to the first terminal device. Correspondingly, the first terminal equipment receives the first random number sent by the server.
In step S214, the first terminal device calculates a first intermediate value by using the first random number and the first private key factor.
It should be appreciated that the first private key factor may be a result of fragmenting the first shared private key.
That is, the embodiment of the present application may segment a decryption private key (e.g., a first shared private key for decryption) by using a secure multi-party computing technology based on the idea of cooperative cryptography, and a participant can only use a key component without knowing a complete key.
Correspondingly, the second private key factor is also similar and will not be described one by one subsequently.
It should also be understood that, the first terminal device may use the first random number and the first private key factor, and the specific formula for calculating the first intermediate value may be set according to actual requirements, and the embodiment of the present application is not limited to this time.
For example, the first intermediate value may be calculated by the following formula:
α=d1ρ1
wherein, d1Is a first private key factor, p1Is a first random number.
In step S215, the first terminal device sends the first intermediate value to the second terminal device. Correspondingly, the second terminal device receives the first intermediate value sent by the first terminal device.
In step S216, the server transmits the second random number to the second terminal device. Correspondingly, the second terminal equipment receives the second random number sent by the server.
In step S217, the second terminal device calculates a second intermediate value by using the third private key factor, the second random number and the first intermediate value, which are randomly generated by the second terminal device.
It should be understood that the third private key factor may also be referred to as a secret value or the like.
It should also be understood that the specific value of the third private key factor may be set according to actual requirements, as long as it is ensured that the third private key factor is randomly generated by the second terminal device, and the embodiment of the present application is not limited thereto.
It should also be understood that the specific formula for the second terminal device to calculate the second intermediate value by using the randomly generated third private key factor, the second random number, and the first intermediate value may be set according to actual requirements, and the embodiment of the present application is not limited to this time.
For example, the second intermediate value may be calculated by the following formula:
β=α(d3ρ2)-1
where β is a second intermediate value, α is a first intermediate value, d3Is a third private key factor, p2Is a second random number.
In step S218, the second terminal device sends the second intermediate value to the server. Correspondingly, the server receives the second intermediate value sent by the second terminal device.
In step S219, the server calculates a fourth private key factor for calculating the second shared private key using the first random number, the second private key factor, and the second intermediate value.
It should be understood that, by using the first random number, the second private key factor, and the second intermediate value, the server may calculate a specific formula for calculating the fourth private key factor of the second shared private key according to actual requirements, and the embodiment of the present application is not limited to this time.
For example, the fourth private key factor may be calculated by the following formula:
Figure BDA0003556065170000131
wherein, d4Is a fourth private key factor; d is a radical of2Is a second private key factor; β is a second intermediate value; ρ is a unit of a gradient2Is a second random number; rho1Is a first random number.
Therefore, the following relationship can be determined by the above-described correlation step:
Figure BDA0003556065170000132
d=d1d2=d3d4
wherein d is the first shared private key or the second shared private key.
In addition, on the basis that the first terminal device and the server can have private key factor pairs (namely, the first private key factor and the second private key factor) which are exclusive to the first terminal device and the server, through the steps, the second terminal device and the server can also have private key factor pairs (namely, the third private key factor and the fourth private key factor), and the shared private keys corresponding to the two private key factor pairs are the same.
Step S220, in a case that the first terminal device allows the second terminal device to access the encrypted data, the second terminal device generates a data sharing request carrying the third private key factor. Wherein the data sharing request is for requesting sharing of encrypted data encrypted by the first terminal device using the first private key factor.
Step S221, the second terminal device sends a data sharing request to the server. Correspondingly, the server receives the data sharing request sent by the second terminal device.
Step S222, the server decrypts the encrypted data by using the third private key factor and the fourth private key factor, so as to obtain the data to be shared.
It should be understood that the specific method for the server to decrypt the encrypted data by using the third private key factor and the fourth private key factor may be set according to actual requirements, and the embodiment of the present application is not limited to this time.
For example, after step S219, the second terminal device and the server may decrypt the encrypted data based on a cooperative decryption manner, and obtain the data to be shared (i.e., the original data). For example, in the case that the encrypted data is the encrypted data uploaded by the first terminal device, the second terminal device may decrypt the encrypted data based on a cooperative decryption manner to obtain the original data.
It should also be understood that the specific process by which the second terminal device and the server can decrypt the encrypted data based on the cooperative decryption may be set according to actual needs, and the embodiment of the present application is not limited thereto.
For example, the second terminal device and the server may decrypt the encrypted data based on an existing cooperative cryptographic algorithm.
In step S223, the server sends the data to be shared to the second terminal device. Correspondingly, the second terminal equipment receives the data to be shared sent by the server.
Therefore, according to the embodiment of the application, the first terminal device and the second terminal device are equivalent in data decryption by means of the technical scheme, and compared with the existing proxy re-encryption method, the method is more convenient and fast in supporting the cross-device file sharing scene through the external storage service.
In order to facilitate understanding of the embodiments of the present application, the following description is given by way of specific examples.
Specifically, in a scenario where encrypted data uploaded by the first terminal is to be shared with the second terminal device (i.e., data sharing across devices), the first terminal device and the second terminal device are both installed with a cryptographic module and a file sharing application program that implement the above mechanism, and the server provides an external storage service, and provides a cryptographic function while storing the encrypted data, where the cryptographic function may also be provided by a separate cryptographic service provider. And the user encrypts one or more files on the first terminal device, and the server stores the encrypted files in the external storage device.
In addition, the following two cases are included in the sharing of the encrypted data uploaded by the first terminal to the second terminal device:
first case
Under the condition that the first terminal device and the second terminal device belong to the same user and the first terminal device can share the uploaded encrypted data to the second terminal device through short-distance communication or code scanning two-dimensional codes and the like, the first terminal device sends a request carrying a session identifier for allowing the second terminal device to access the encrypted data to the server in response to the operation that the user selects to allow other terminal devices to use the encrypted data on an external storage file application program of the first terminal device. Correspondingly, the server receives the request sent by the first terminal device.
Then, the server may generate a first random number based on the request, and transmit information carrying the session identifier, the first random number, and other additional requests to the cryptographic module in the first terminal device through the secure channel, and the cryptographic module in the first terminal device generates a first intermediate value in the manner of step S214, and the cryptographic module in the first terminal device may generate a two-dimensional code based on the first intermediate value.
And the user receives the notification on the second terminal device, the file sharing application program is triggered to be opened, then the code scanning function is opened, the two-dimension code is scanned, and the first intermediate value and the session identifier are obtained through analysis from the two-dimension code. And the cryptographic module of the second terminal device transmits the session identification and the information requesting to open the file (or requesting to share the encrypted data) to the server through the secure channel.
And the server receives and stores the data in the request of the second terminal equipment, generates a second random number at the same time, and transmits the session identifier and the second random number to a password module of the second terminal equipment through a secure channel.
And, the second terminal device may generate a second intermediate value through the method of step S217 and transmit the session identifier and the second intermediate value to the server through the secure channel.
Subsequently, the server may operate according to steps S220 and S223, and destroy the session identifier and the temporary data of the represented session after completion.
To this end, the second terminal device has the capability of decrypting the file encrypted by the first terminal device, and the two terminal devices can be used in parallel.
In addition, under the condition that the user replaces the terminal equipment, after the operation is executed, the user can select to disable the shared file through the first terminal equipment, and send a terminal disabling request carrying the session identifier and other additional data to the server through the secure channel. And after receiving the terminal disabling request, the server can destroy the second private key factor and inform the first terminal equipment so that the first terminal equipment can destroy the first private key factor.
It will of course be appreciated that in addition to the above embodiments, device management may also be selected on the second terminal device and the first terminal device may be disabled. The specific implementation manner of the disabling is similar to the related steps of destroying the first private key factor and the second private key factor.
Second case
Under the condition that the first terminal device is the device of the first user, the second terminal device is the device of the second user, and the first terminal device can share the uploaded encrypted data to the second terminal device, the second terminal device can use the application program and can send a request to the server to open a specific file through the secure channel.
Subsequently, the server may determine that the specific file belongs to the first terminal device, and may notify the first terminal device.
And after the first terminal equipment and the second terminal equipment can reach an agreement according to the existing negotiation process, the first terminal equipment can prove the identity to the server through a strong authentication identity technology, and send information allowing the second terminal equipment to decrypt to the server, and if the second terminal equipment is not approved to decrypt, the subsequent process is not required to be executed.
It should be understood that the specific means by which the first terminal device can prove the identity to the server through the strong authentication identity technology may be set according to actual needs, and the embodiment of the present application is not limited thereto.
For example, the identity may be certified to the server by two-factor authentication, cryptographic modules, keys, digital certificates, etc. or other means on the first terminal device.
And the first terminal device may generate a first intermediate value using the password of the first terminal device and may also generate a string τ of a certain length according to steps S213 and S214, may then calculate a hash value of the string τ using a preset hash algorithm, and may transmit a message including the session identifier and a specific value determined by the first intermediate value and the hash value to the server through the secure channel.
It should be understood that the specific algorithm of the preset hash algorithm may be set according to actual requirements, and the embodiment of the present application is not limited thereto.
It should also be understood that the specific calculation manner of the specific value determined by the first intermediate value and the hash value may be set according to actual requirements, and the embodiment of the present application is not limited thereto.
For example, the specific value may be calculated by the following formula:
a=βxor h;
wherein a is a specific value, β is a first intermediate value, xor is an exclusive-or operation, and h is a hash value.
It will also be appreciated that the number of bits of the hash function output (which may be 128 bits, for example) is chosen to be the same as the number of bits of the first intermediate value.
It should be noted that, although the above is described by taking the exclusive or operation as an example, it should be understood by those skilled in the art that the first intermediate value may also be related and protected by other means or algorithms as long as the second terminal device is ensured to be able to parse the first intermediate value from the received data, and the embodiment of the present application is not limited thereto.
For example, the first terminal device may encrypt the first intermediate value using a hash value, and so on.
And the first terminal device may notify the second terminal device of the message about the character string τ by telephone or the like.
And, the server may transmit a message of the session identifier and a specific value determined by the first intermediate value and the hash value to the second terminal device. And after the server receives the message, the second terminal equipment can analyze the session identifier and the specific value. Subsequently, the second terminal device may obtain the first intermediate value by the character string τ calculation. Subsequently, the second terminal device may generate a second intermediate value and transmit the second intermediate value to the server as per step S217.
And the server may perform related operations according to steps S220 and S223, and destroy the session identifier and the temporary data of the session corresponding thereto after the encrypted data sharing operation across the devices.
To this end, the second terminal device has the capability of decrypting the file encrypted by the first terminal device. However, the decryption of the second terminal device needs to be performed according to the following steps:
the second terminal device opens the file stored externally, after the server receives the opening request, it searches whether there is the strategy that permits the second terminal device to open the encrypted file, if there is the strategy, it checks the strategy, the strategy includes but not limited to whether it is in the authorized time range or whether it exceeds the authorized times; if the strategy does not exist or the strategy check does not allow, the server refuses to decrypt cooperatively with the second terminal equipment; if the strategy allows, the server and the second terminal device can cooperatively complete decryption according to a cooperative decryption method.
According to the process, the second terminal device can cooperate with the server to complete decryption under the restriction policy set by the first terminal device under the condition that the second terminal device and the first terminal device negotiate to be consistent. And the first terminal equipment can cancel the permission of the second terminal equipment at any time after the identity is authenticated.
In summary, the embodiment of the application can effectively prevent the situation that the data cannot be decrypted when the user equipment is lost or damaged. For example, the user may complete the operation described in the present application with the second terminal device in an available state after the initialization of the first terminal device is completed, so that the second terminal device may exist as a backup of the first terminal device, and if the first terminal device is lost or damaged, the data may be opened by the second terminal device.
And the embodiment of the application can support that a plurality of devices held by a user can open the encrypted data of a certain device. For example, when the first terminal device and the second terminal device perform the operations described in the present application, the second terminal device has the same encryption and decryption capabilities as the first terminal device with the cooperation of the server, but the keys are different. Therefore, the data encrypted by the first terminal equipment can be normally opened at the second terminal equipment, and the data encrypted by the second terminal equipment can also be opened at the first terminal equipment.
And the embodiment of the application can support the user to authorize the encrypted file to other people. For example, the user may be authorized by the first terminal device to the second terminal device when necessary, so that the second terminal device has the same encryption and decryption capabilities as the first terminal device in cooperation with the server, but at the same time, through the setting of the policy, the second terminal device must complete decryption in cooperation with the server. Therefore, the second terminal device can normally open the ciphertext file within the scope permitted by the policy, but if the policy is violated, the server refuses to cooperate with the server part completing the cooperative decryption, so that the first terminal device can effectively control the authorization policy of data sharing.
It should be understood that the above method for sharing encrypted data is only exemplary, and those skilled in the art can make various changes, modifications or variations according to the above method and still fall within the scope of the present application.
For example, although described above in terms of fixed steps, one skilled in the art will appreciate that it is not a limitation of the steps involved.
Referring to fig. 3, fig. 3 shows a block diagram of a device 300 for sharing encrypted data according to an embodiment of the present application, it should be understood that the device 300 corresponds to the method of the foregoing method embodiment, and can perform various steps on the server side in the foregoing method embodiment, and specific functions of the device 300 may be referred to the description above, and detailed descriptions are appropriately omitted here to avoid repetition. The device 300 includes at least one software function module that can be stored in a memory in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the device 300. Specifically, the apparatus 300 is applied to a server in a data protection system, the data protection system includes a first terminal device, a second terminal device and the server, and the first terminal device stores a first private key factor for calculating a first shared private key, and the server stores a second private key factor for calculating the first shared private key, the apparatus 300 includes:
a generating module 310, configured to generate a first random number and a second random number;
a first sending module 320, configured to send the first random number to the first terminal device, so that the first terminal device calculates a first intermediate value by using the first random number and the first private key factor;
a second sending module 330, configured to send a second random number to the second terminal device, so that the second terminal device calculates a second intermediate value by using a third private key factor, the second random number, and the first intermediate value, which are randomly generated by the second terminal device; the third private key factor is used for calculating a second shared private key, and the second shared private key and the first shared private key are the same private key;
the first receiving module 340 is configured to receive a second intermediate value returned by the second terminal device;
a first calculating module 350, configured to calculate a fourth private key factor for calculating the second shared private key by using the first random number, the second private key factor, and the second intermediate value;
a second receiving module 360, configured to receive a data sharing request carrying a third private key factor sent by a second terminal device; the data sharing request is used for requesting to share encrypted data encrypted by the first terminal equipment by using a first private key factor;
the decryption module 370 is configured to decrypt the encrypted data by using the third private key factor and the fourth private key factor to obtain data to be shared;
a third sending module 380, configured to send the data to be shared to the second terminal device.
In one possible embodiment, the fourth private key factor is calculated by the following formula:
Figure BDA0003556065170000201
wherein d is4Is a fourth private key factor, d2Is a second private key factor, β is a second intermediate value; rho2Is a second random number, p1Is a first random number.
In one possible embodiment, the second intermediate value is calculated by the following formula:
β=α(d3ρ2)-1
wherein alpha is a first intermediate value and d3Is the third private key factor.
In one possible embodiment, the first intermediate value is calculated by the following formula:
α=d1ρ1
wherein d is1Is the first private key factor.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
Referring to fig. 4, fig. 4 shows a block diagram of a device 400 for sharing encrypted data according to an embodiment of the present application, and it should be understood that the device 400 corresponds to the method of the foregoing method embodiment, and can perform each step on the second terminal device side in the foregoing method embodiment, and specific functions of the device 400 may be referred to the description above, and detailed descriptions are appropriately omitted here to avoid redundancy. The device 400 includes at least one software function module that can be stored in a memory in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the device 400. Specifically, the apparatus 400 is applied to a second terminal device in a data protection system, the data protection system includes a first terminal device, a server and the second terminal device, the first terminal device stores a first private key factor for calculating a first shared private key, and the server stores a second private key factor for calculating the first shared private key, the apparatus 400 includes:
a third receiving module 410, configured to receive a second random number sent by the server;
a second calculating module 420, configured to calculate a second intermediate value by using a third private key factor, a second random number, and the first intermediate value, which are randomly generated by the second calculating module; the third private key factor is used for calculating a second shared private key, the second shared private key and the first shared private key are the same private key, and the first intermediate value is calculated by the first terminal device by using the first random number and the first private key factor sent by the server;
a fourth sending module 430, configured to send the second intermediate value to the server, so that the server calculates a fourth private key factor for calculating the second shared private key by using the first random number, the second private key factor, and the second intermediate value;
a fifth sending module 440, configured to send, to the server, a data sharing request carrying the third private key factor and used for requesting to share the encrypted data encrypted by the first terminal device by using the first private key factor, so that the server decrypts the encrypted data by using the third private key factor and the fourth private key factor to obtain the data to be shared;
a fourth receiving module 450, configured to receive the data to be shared sent by the server.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
Referring to fig. 5, fig. 5 is a block diagram illustrating an electronic device 500 according to an embodiment of the present disclosure. Electronic device 500 may include a processor 510, a communication interface 520, a memory 530, and at least one communication bus 540. Wherein the communication bus 540 is used for realizing direct connection communication of these components. The communication interface 520 in the embodiment of the present application is used for communicating signaling or data with other devices. Processor 510 may be an integrated circuit chip having signal processing capabilities. The Processor 510 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be 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. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor 510 may be any conventional processor or the like.
The Memory 530 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 530 stores computer readable instructions, and when the computer readable instructions are executed by the processor 510, the electronic device 500 may perform the steps of the corresponding apparatus side in the above method embodiments.
The electronic device 500 may further include a memory controller, an input-output unit, an audio unit, a display unit.
The memory 530, the memory controller, the processor 510, the peripheral interface, the input/output unit, the audio unit, and the display unit are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements may be electrically coupled to each other via one or more communication buses 540. The processor 510 is used to execute executable modules stored in the memory 530.
The input and output unit is used for providing input data for a user to realize the interaction of the user and the server (or the local terminal). The input/output unit may be, but is not limited to, a mouse, a keyboard, and the like.
The audio unit provides an audio interface to the user, which may include one or more microphones, one or more speakers, and audio circuitry.
The display unit provides an interactive interface (e.g. a user interface) between the electronic device and a user or for displaying image data for reference by the user. In this embodiment, the display unit may be a liquid crystal display or a touch display. In the case of a touch display, the display can be a capacitive touch screen or a resistive touch screen, which supports single-point and multi-point touch operations. The support of single-point and multi-point touch operations means that the touch display can sense touch operations simultaneously generated from one or more positions on the touch display, and the sensed touch operations are sent to the processor for calculation and processing.
It will be appreciated that the configuration shown in FIG. 5 is merely illustrative and that the electronic device 500 may include more or fewer components than shown in FIG. 5 or may have a different configuration than shown in FIG. 5. The components shown in fig. 5 may be implemented in hardware, software, or a combination thereof.
The present application also provides a storage medium having a computer program stored thereon, which, when executed by a processor, performs the method of the method embodiments.
The present application also provides a computer program product which, when run on a computer, causes the computer to perform the method of the method embodiments.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the system described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (12)

1. A method for sharing encrypted data, the method being applied to a server in a data protection system, the data protection system comprising a first terminal device, a second terminal device and the server, and the first terminal device storing a first private key factor for calculating a first shared private key, and the server storing a second private key factor for calculating the first shared private key, the method comprising:
generating a first random number and a second random number;
sending the first random number to the first terminal device so that the first terminal device can calculate a first intermediate value by using the first random number and the first private key factor;
sending the second random number to the second terminal device so that the second terminal device can calculate a second intermediate value by using a third private key factor randomly generated by the second terminal device, the second random number and the first intermediate value; wherein the third private key factor is used to compute a second shared private key, and the second shared private key and the first shared private key are the same private key;
receiving the second intermediate value returned by the second terminal equipment;
calculating a fourth private key factor for calculating a second shared private key using the first random number, the second private key factor, and the second intermediate value;
receiving a data sharing request carrying the third private key factor sent by the second terminal device; wherein the data sharing request is used for requesting to share the encrypted data encrypted by the first terminal equipment by using the first private key factor;
decrypting the encrypted data by using the third private key factor and the fourth private key factor to obtain data to be shared;
and sending the data to be shared to the second terminal equipment.
2. The method of claim 1, wherein the fourth privacy factor is calculated by the formula:
Figure FDA0003556065160000011
wherein d is4Is the fourth private key factor; d2Is the second private key factor; β is the second intermediate value; rho2Is the second random number; rho1Is the first random number.
3. The method of claim 2, wherein the second intermediate value is calculated by the formula:
β=α(d3ρ2)-1
wherein α is the first intermediate value; d3Is the third private key factor.
4. The method of claim 3, wherein the first intermediate value is calculated by the formula:
α=d1ρ1
wherein d is1Is the first private key factor.
5. A method for sharing encrypted data, the method being applied to a second terminal device in a data protection system, the data protection system comprising a first terminal device, a server and the second terminal device, and the first terminal device storing a first private key factor for calculating a first shared private key, and the server storing a second private key factor for calculating the first shared private key, the method comprising:
receiving a second random number sent by the server;
calculating a second intermediate value by using a third private key factor randomly generated by the random number generator, the second random number and the first intermediate value; the third private key factor is used for calculating a second shared private key, the second shared private key and the first shared private key are the same private key, and the first intermediate value is calculated by the first terminal device by using a first random number sent by the server and the first private key factor;
sending the second intermediate value to the server to facilitate the server to calculate a fourth private key factor for calculating a second shared private key using the first random number, the second private key factor, and the second intermediate value;
sending a data sharing request carrying the third private key factor and used for requesting to share the encrypted data encrypted by the first terminal equipment by using the first private key factor to the server, so that the server decrypts the encrypted data by using the third private key factor and the fourth private key factor to obtain the data to be shared;
and receiving the data to be shared sent by the server.
6. An apparatus for sharing encrypted data, the apparatus being applied to a server in a data protection system, the data protection system comprising a first terminal device, a second terminal device and the server, and the first terminal device storing a first private key factor for calculating a first shared private key, and the server storing a second private key factor for calculating the first shared private key, the apparatus comprising:
the generating module is used for generating a first random number and a second random number;
a first sending module, configured to send the first random number to the first terminal device, so that the first terminal device calculates a first intermediate value by using the first random number and the first private key factor;
a second sending module, configured to send the second random number to the second terminal device, so that the second terminal device calculates a second intermediate value by using a third private key factor randomly generated by the second terminal device, the second random number, and the first intermediate value; wherein the third private key factor is used to compute a second shared private key, and the second shared private key and the first shared private key are the same private key;
a first receiving module, configured to receive the second intermediate value returned by the second terminal device;
a first calculation module for calculating a fourth private key factor for calculating a second shared private key using the first random number, the second private key factor, and the second intermediate value;
a second receiving module, configured to receive a data sharing request carrying the third private key factor sent by the second terminal device; wherein the data sharing request is for requesting sharing of encrypted data encrypted by the first terminal device using the first private key factor;
the decryption module is used for decrypting the encrypted data by using the third private key factor and the fourth private key factor to obtain data to be shared;
and the third sending module is used for sending the data to be shared to the second terminal equipment.
7. The apparatus of claim 6, wherein the fourth private key factor is calculated by the following equation:
Figure FDA0003556065160000041
wherein d is4Is the fourth private key factor, d2Is the second private key factor, β is the second intermediate value; rho2Is the second random number, p1Is the first random number.
8. The apparatus of claim 7, wherein the second intermediate value is calculated by the following equation:
β=α(d3ρ2)-1
wherein α is the first intermediate value, d3Is the third private key factor.
9. The apparatus of claim 8, wherein the first intermediate value is calculated by the following equation:
α=d1ρ1
wherein d is1Is the first private key factor.
10. An apparatus for sharing encrypted data, the apparatus being applied to a second terminal device in a data protection system, the data protection system comprising a first terminal device, a server and the second terminal device, and the first terminal device storing a first private key factor for calculating a first shared private key, and the server storing a second private key factor for calculating the first shared private key, the apparatus comprising:
a third receiving module, configured to receive a second random number sent by the server;
the second calculation module is used for calculating a second intermediate value by using a third private key factor randomly generated by the second calculation module, the second random number and the first intermediate value; the third private key factor is used for calculating a second shared private key, the second shared private key and the first shared private key are the same private key, and the first intermediate value is calculated by the first terminal device by using a first random number sent by the server and the first private key factor;
a fourth sending module, configured to send the second intermediate value to the server, so that the server calculates a fourth private key factor for calculating a second shared private key by using the first random number, the second private key factor, and the second intermediate value;
a fifth sending module, configured to send, to the server, a data sharing request that carries the third private key factor and is used to request sharing of encrypted data encrypted by the first terminal device by using the first private key factor, so that the server decrypts the encrypted data by using the third private key factor and the fourth private key factor, and obtains data to be shared;
and the fourth receiving module is used for receiving the data to be shared sent by the server.
11. An electronic device comprising a processor, a memory and a computer program stored on the memory, wherein the processor executes the computer program to implement the method of sharing encrypted data according to any one of claims 1 to 5.
12. A storage medium comprising a computer program, wherein the computer program, when executed by a processor, implements the method of sharing encrypted data according to any one of claims 1 to 4.
CN202210276787.9A 2022-03-21 2022-03-21 Method and device for sharing encrypted data, storage medium and electronic equipment Active CN114710271B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210276787.9A CN114710271B (en) 2022-03-21 2022-03-21 Method and device for sharing encrypted data, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210276787.9A CN114710271B (en) 2022-03-21 2022-03-21 Method and device for sharing encrypted data, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114710271A true CN114710271A (en) 2022-07-05
CN114710271B CN114710271B (en) 2024-01-30

Family

ID=82168819

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210276787.9A Active CN114710271B (en) 2022-03-21 2022-03-21 Method and device for sharing encrypted data, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114710271B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117056983A (en) * 2023-10-13 2023-11-14 中国移动紫金(江苏)创新研究院有限公司 Multistage controllable data sharing authorization method, device and blockchain system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109309569A (en) * 2018-09-29 2019-02-05 北京信安世纪科技股份有限公司 The method, apparatus and storage medium of collaboration signature based on SM2 algorithm
CN110391900A (en) * 2019-07-04 2019-10-29 晋商博创(北京)科技有限公司 Private key processing method, terminal and cipher key center based on SM2 algorithm

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109309569A (en) * 2018-09-29 2019-02-05 北京信安世纪科技股份有限公司 The method, apparatus and storage medium of collaboration signature based on SM2 algorithm
CN110391900A (en) * 2019-07-04 2019-10-29 晋商博创(北京)科技有限公司 Private key processing method, terminal and cipher key center based on SM2 algorithm

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117056983A (en) * 2023-10-13 2023-11-14 中国移动紫金(江苏)创新研究院有限公司 Multistage controllable data sharing authorization method, device and blockchain system
CN117056983B (en) * 2023-10-13 2024-01-02 中国移动紫金(江苏)创新研究院有限公司 Multistage controllable data sharing authorization method, device and blockchain system

Also Published As

Publication number Publication date
CN114710271B (en) 2024-01-30

Similar Documents

Publication Publication Date Title
US10785019B2 (en) Data transmission method and apparatus
CN106104562B (en) System and method for securely storing and recovering confidential data
RU2589861C2 (en) System and method of user data encryption
US10938792B2 (en) Layered encryption for end to end communication
CN110519046B (en) Quantum communication service station key negotiation method and system based on one-time asymmetric key pair and QKD
US20130028419A1 (en) System and a method for use in a symmetric key cryptographic communications
CN109891423B (en) Data encryption control using multiple control mechanisms
CN104641592A (en) Method and system for a certificate-less authentication encryption (CLAE)
CN107733933B (en) Method and system for double-factor identity authentication based on biological recognition technology
JP2023500570A (en) Digital signature generation using cold wallet
CN113225302B (en) Data sharing system and method based on proxy re-encryption
CN110868291B (en) Data encryption transmission method, device, system and storage medium
CN108768613A (en) A kind of ciphertext password method of calibration based on multiple encryption algorithms
WO2012154503A2 (en) Certificate blobs for single sign on
EP1079565A2 (en) Method of securely establishing a secure communication link via an unsecured communication network
CN109299618B (en) Quantum-resistant computing cloud storage method and system based on quantum key card
Mahalakshmi et al. Effectuation of secure authorized deduplication in hybrid cloud
CN114710271B (en) Method and device for sharing encrypted data, storage medium and electronic equipment
CN112836240A (en) Block chain-based electronic medical data security sharing method, system and medium
CN111355702A (en) Method and system for secure transmission of data sets, medical facility and program product
CN113826096A (en) User authentication and signature apparatus and method using user biometric identification data
KR101793528B1 (en) Certificateless public key encryption system and receiving terminal
WO2015124798A2 (en) Method & system for enabling authenticated operation of a data processing device
CN110176997B (en) Quantum communication service station AKA key negotiation method and system
Surya et al. Single sign on mechanism using attribute based encryption in distributed computer networks

Legal Events

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