Information Processing Method, Terminal Device, and Network System
20210135858 · 2021-05-06
Inventors
- Cheng Kang Chu (Singapore, SG)
- David Naccache (Paris, FR)
- Jie Shi (Singapore, SG)
- Chengfang FANG (Singapore, SG)
- Xiwen Fang (Shanghai, CN)
Cpc classification
H04L63/045
ELECTRICITY
H04L9/0825
ELECTRICITY
H04L9/0827
ELECTRICITY
H04L9/0894
ELECTRICITY
H04L67/1097
ELECTRICITY
H04L9/0891
ELECTRICITY
H04L63/0442
ELECTRICITY
International classification
Abstract
An information processing method, a terminal device, and a network system include encrypting, by a first terminal, an authorization key based on a public key of a second terminal to obtain an authorization key ciphertext corresponding to the second terminal, and sending, by the first terminal, the authorization key ciphertext to the second terminal such that the second terminal decrypts the authorization key ciphertext based on a private key of the second terminal to obtain the authorization key, and then performs file decryption.
Claims
1. An information processing method implemented by a first terminal device and comprising: encrypting an authorization key of a current version based on a public key of a second terminal device to obtain a first authorization key ciphertext corresponding to the second terminal device; and sending, to the second terminal device through a server, the first authorization key ciphertext, wherein the first authorization key ciphertext is configured to enable the second terminal device to decrypt, based on a private key of the second terminal device, the first authorization key ciphertext to obtain the authorization key of the current version, obtain a file key from a server based on the authorization key of the current version, and perform file decryption based on the file key.
2. The information processing method of claim 1, further comprising: encrypting a key of an encrypted file based on the authorization key of the current version to obtain a key ciphertext of the encrypted file; and sending the key ciphertext to the server, wherein the key ciphertext of the encrypted file enables the second terminal device to obtain the key ciphertext from the server, decrypt the key ciphertext based on the authorization key of the current version to obtain the key of the encrypted file, and decrypt, based on the key of the encrypted file, the encrypted file stored on the server.
3. The information processing method of claim 1, further comprising: determining a random number of a preset quantity of bits; and sending the random number to the second terminal device through the server to enable the second terminal device to determine the public key and the private key of the second terminal device.
4. The information processing method of claim 1, further comprising: encrypting the authorization key of the current version based on a private key or a secret trapdoor parameter of the first terminal device to obtain an authorization key of a next version; encrypting the authorization key of the next version based on a public key of a third terminal device to obtain a second authorization key ciphertext corresponding to the third terminal device; and sending, to the third terminal device through the server, the second authorization key ciphertext to enable the third terminal device to decrypt, based on a private key of the third terminal device, the second authorization key ciphertext to obtain the authorization key of the next version, obtain the file key from the server based on the authorization key of the next version, and perform the file decryption based on the file key.
5. The information processing method of claim 4, wherein the third terminal device is a destination terminal device for file sharing after the first terminal device revokes a terminal device.
6. The information processing method of claim 4, wherein the authorization key of the next version is configured to enable each the third terminal device to decrypt the authorization key of the next version based on a public key or a public trapdoor parameter of the first terminal device to obtain the authorization key of the current version, obtain the file key from the server based on the authorization key of the current version, and perform the file decryption based on the file key.
7. The information processing method of claim 6, further comprising sending group owner change information to a target terminal device through the server, wherein the group owner change information is configured to enable the target terminal device to encrypt the authorization key of the current version based on a private key or a secret trapdoor parameter of the target terminal device to obtain the authorization key of the next version.
8. The information processing method of claim 1, further comprising: determining, from a preset first database, an authorization key of a next version of the authorization key of the current version, wherein the preset first database comprises authorization keys of a plurality of versions of the first terminal device; encrypting the authorization key of the next version based on a public key of a fourth terminal device to obtain a third authorization key ciphertext corresponding to the fourth terminal device; and sending, to the fourth terminal device through the server, the third authorization key ciphertext is configured to enable the fourth terminal device to decrypt, based on a private key of the fourth terminal device, the third authorization key ciphertext to obtain the authorization key of the next version, obtain the file key from the server based on the authorization key of the next version, and perform the file decryption based on the file key.
9. An information processing method implemented by a second terminal device and comprising: receiving a first authorization key ciphertext corresponding to the second terminal device from a first terminal device through a server, wherein the first authorization key ciphertext is based on an encryption of an authorization key of a current version based on a public key of the second terminal device; decrypting, based on a private key of the second terminal device, the first authorization key ciphertext to obtain the authorization key of the current version; obtaining a file key from the server based on the authorization key of the current version; and performing a file decryption based on the file key.
10. The information processing method of claim 9, further comprising: obtaining a key ciphertext of an encrypted file from the server, wherein the key ciphertext is based on an encryption of a key of the encrypted file based on the authorization key of the current version; decrypting the key ciphertext based on the authorization key of the current version to obtain the key of the encrypted file; and decrypting, based on the key of the encrypted file, the encrypted file stored on the server.
11. The information processing method of claim 9, further comprising: receiving a random number of a preset quantity of bits from the first terminal device through the server; and determining the public key and the private key of the second terminal device based on the random number.
12. A first terminal device comprising: a processor configured to encrypt an authorization key of a current version based on a public key of a second terminal device to obtain a first authorization key ciphertext corresponding to the second terminal device; and a transmitter coupled to the processor and configured to send, to the second terminal device through a server, the first authorization key ciphertext, wherein the first authorization key ciphertext is configured to enable the second terminal device to decrypt, based on a private key of the second terminal device, the first authorization key ciphertext to obtain the authorization key of the current version, obtain a file key from a server based on the authorization key of the current version, and perform a file decryption based on the file key.
13. The first terminal device of claim 12, wherein the processor is further configured to encrypt a key of an encrypted file based on the authorization key of the current version to obtain a key ciphertext of the encrypted file; and the transmitter is further configured to send the key ciphertext to the server, wherein the key ciphertext is configured to enable each the second terminal device to obtain the key ciphertext from the server, decrypt the key ciphertext based on the authorization key of the current version to obtain the key of the encrypted file, and decrypt, based on the key of the encrypted file, the encrypted file stored on the server, and wherein the transmitter is further configured to send the key ciphertext to the server.
14. The first terminal device of claim 12, wherein the processor is further configured to: encrypt the authorization key of the current version based on a private key or a secret trapdoor parameter of the first terminal device to obtain an authorization key of a next version; and encrypt the authorization key of the next version based on a public key of a third terminal device to obtain a second authorization key ciphertext corresponding to the third terminal device; and the transmitter is further configured to send to the third terminal device through the server, the second authorization key ciphertext, wherein the second authorization key ciphertext is configured to enable the third terminal device to decrypt, based on a private key of the third terminal device, the second authorization key ciphertext to obtain the authorization key of the next version, obtain the file key from the server based on the authorization key of the next version, and perform the file decryption based on the file key.
15. The first terminal device of claim 14, wherein the transmitter is further configured to send group owner change information to a target terminal device through the server, and wherein the group owner change information is configured to enable the target terminal device to encrypt the authorization key of the current version based on a private key or a secret trapdoor parameter of the target terminal device to obtain the authorization key of the next version.
16. The first terminal device of claim 12, wherein the processor is further configured to: determine, from a preset first database, an authorization key of a next version of the authorization key of the current version, wherein the preset first database comprises authorization keys of a plurality of versions of the first terminal device; and encrypt the authorization key of the next version based on a public key of a fourth terminal device to obtain a third authorization key ciphertext corresponding to the fourth terminal device; and wherein the transmitter is further configured to send, to the fourth terminal device through the server, the third authorization key ciphertext, wherein the third authorization key ciphertext is configured to enable the fourth terminal device to decrypt, based on a private key of the fourth terminal device, the third authorization key ciphertext to obtain the authorization key of the next version, obtain the file key from the server based on the authorization key of the next version, and perform the file decryption based on the file key.
17. The first terminal device of claim 16, wherein the processor is further configured to obtain the authorization keys based on a preset first random number using a preset first one-way trapdoor function.
18. The first terminal device of claim 17, wherein the processor is further configured to: set the preset first random number as an authorization key of an n.sup.th version, wherein n is an integer greater than or equal to 2; obtain an authorization key of an (n−1).sup.th version based on the authorization key of the n.sup.th version using the preset first one-way trapdoor function; and perform the obtaining step until an authorization key of a first version is obtained.
19. The first terminal device of claim 18, wherein the transmitter is further configured to send group owner change information to a target terminal device through the server, wherein the group owner change information enables the target terminal device to obtain a second database based on a preset second random number using a preset second one-way trapdoor function, and wherein the second database comprises authorization keys of a plurality of versions of the second terminal device.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
DESCRIPTION OF EMBODIMENTS
[0067] An information processing method, an apparatus, a terminal device, and a server provided in the following embodiments of this application may be applicable to a cloud storage service-based scenario, and can effectively ensure user privacy when file sharing is implemented in a group.
[0068] The following describes the solutions provided in the embodiments of this application with reference to a plurality of examples.
[0069]
[0070] S201: A first terminal device encrypts an authorization key (AK) of a current version based on a public key of each of at least one second terminal device, to obtain an authorization key ciphertext corresponding to each second terminal device.
[0071] The first terminal device may be a group owner terminal device, and the at least one second terminal device may be another terminal device that is in a group used for file sharing and that is set by the first terminal device. In the group, the first terminal device is used as a group owner terminal device, and the at least one second terminal device is used as a member terminal device. According to the methods provided in the embodiments of this application, each second terminal device may be enabled to decrypt a file stored by the first terminal device in a server, to share the file stored by the first terminal device in the server.
[0072] Each terminal device, the first terminal device or the second terminal device, has a public key and a private key of the terminal device. The public key of each terminal device may be stored on the server, or may be directly or indirectly sent to another terminal device. However, the private key of each terminal device is stored on the device, and is known only to the device. To be specific, the public key of each terminal device is known to the server or another terminal device, and the private key of each terminal device is unknown to the server or another terminal device.
[0073] For example, the server has the public key of each terminal device, and the public key of each terminal device may include information such as the public key of each second terminal device and a public key of the first terminal device. When the first terminal device needs to share a file to the at least one second terminal device, the server may send the public key of each second terminal device to the first terminal device, to notify the first terminal device of the public key of each second terminal device.
[0074] The authorization key of the current version may be an authorization key in a current phase, and may be a preset initial authorization key, or may be referred to as an authorization key of the first version, or may be a non-initial authorization key, for example, an updated authorization key.
[0075] When learning of the public key of each second terminal device, the first terminal device may encrypt the authorization key of the current version based on the public key of each second terminal device, to obtain the authorization key ciphertext corresponding to each second terminal device.
[0076] For example, if the first terminal device is a terminal device A, the at least one second terminal device may include a terminal device B, a terminal device C, and a terminal device D. A public key of the terminal device B may be denoted as PK.sub.B, a public key of the terminal device C may be denoted as PK.sub.C, and a public key of the terminal device D may be denoted as PK.sub.D. The authorization key of the current version may be the authorization key of the first version, and is denoted as AK.sub.1.
[0077] Therefore, the terminal device A may encrypt AK.sub.1 based on PK.sub.B, to obtain an authorization key ciphertext corresponding to the terminal device B, encrypt AK.sub.1 based on PK.sub.C, to obtain an authorization key ciphertext corresponding to the terminal device C, and encrypt AK.sub.1 based on PK.sub.D, to obtain an authorization key ciphertext corresponding to the terminal device D.
[0078] S202: The first terminal device sends, to each second terminal device through the server, the authorization key ciphertext corresponding to each second terminal device.
[0079] The first terminal device may directly send, to each second terminal device, the authorization key ciphertext corresponding to each second terminal device, or may send, to each second terminal device through another intermediate device such as the server, the authorization key ciphertext corresponding to each second terminal device.
[0080] For example, the first terminal device may first send, to the server, the authorization key ciphertext corresponding to each second terminal device, and the server sends, to each second terminal device, the authorization key ciphertext corresponding to each second terminal device.
[0081] The first terminal device may send the obtained authorization key ciphertext corresponding to the at least one second terminal device to the server, and the server distributes the authorization key ciphertext, that is, sends, to each second terminal device, the authorization key ciphertext corresponding to each second terminal device. When each second terminal device goes online, the server may forward, to each second terminal device, the authorization key ciphertext corresponding to each second terminal device.
[0082] Because the authorization key ciphertext corresponding to each second terminal device is encrypted using the public key of each second terminal device, the authorization key ciphertext corresponding to each second terminal device may be decrypted only using a private key of each second terminal device. The server or another device does not have the private key of each second terminal device. Even if the server or another device receives the authorization key ciphertext corresponding to each second terminal device, the authorization key ciphertext corresponding to each second terminal device cannot be decrypted, and the authorization key of the current version cannot be obtained.
[0083] S203: Each second terminal device receives the authorization key ciphertext that corresponds to each second terminal device and that is from the first terminal device.
[0084] S204: Each second terminal device decrypts, based on the private key of each second terminal device, the authorization key ciphertext corresponding to each second terminal device, to obtain the authorization key of the current version.
[0085] Because the authorization key ciphertext corresponding to each second terminal device is encrypted using the public key of each second terminal device, the authorization key ciphertext corresponding to each second terminal device may be decrypted only using the private key of each second terminal device. However, the private key of each second terminal device is unknown to another device, and is known only to each second terminal device. Therefore, each second terminal device may decrypt, based on the private key of each second terminal device, the authorization key ciphertext corresponding to each second terminal device, to obtain the authorization key of the current version.
[0086] A device outside the group in which the at least one second terminal device is located cannot receive the authorization key ciphertext that corresponds to the device outside the group in which the at least one second terminal device is located and that is sent by the first terminal device. Even if the device can obtain the authorization key ciphertext corresponding to the second terminal device, the device cannot obtain the authorization key of the current version because the device does not have the private key of the second terminal device and cannot decrypt the private key of the second terminal device.
[0087] S205: Each second terminal device obtains a file key from the server based on the authorization key of the current version, and performs file decryption based on the file key.
[0088] Each second terminal device may decrypt, based on the authorization key of the current version, a to-be-analyzed file that is pre-stored by the first terminal device on the server, to implement file sharing with the first terminal device.
[0089] According to the information processing method provided in this embodiment of this application, the first terminal device may encrypt the authorization key of the current version based on the public key of each of at least one second terminal device, to obtain the authorization key ciphertext corresponding to each second terminal device, send, through the server to each second terminal device, the authorization key ciphertext corresponding to each second terminal device such that each second terminal device decrypts, based on the private key of each second terminal device, the authorization key ciphertext corresponding to each second terminal device, to obtain the authorization key of the current version, then obtain the file key from the server based on the authorization key of the current version, and perform file decryption based on the file key. In the information processing method, the authorization key ciphertext is encrypted based on the public key of each second terminal device, and can be decrypted only using the private key of each second terminal device. Therefore, a device that transmits or stores the authorization key ciphertext, such as the server, cannot decrypt the authorization key ciphertext. Even if a hacker can obtain the authorization key ciphertext by exploiting a vulnerability, the hacker cannot decrypt the authorization key ciphertext. This effectively avoids various data security problems and security risks, and ensures data security of user files stored in a cloud and user privacy.
[0090] Optionally, an embodiment of this application may further provide an information processing method.
[0091] S301: A first terminal device encrypts a key of at least one encrypted file based on an authorization key of a current version, to obtain a key ciphertext of the at least one encrypted file.
[0092] When the first terminal device needs to share a file, the first terminal device may notify a server to create a shared folder, put at least one to-be-shared file into the shared folder, and set a sharing group.
[0093] For each file in the shared folder, the first terminal device may select a key of each file, then encrypt each file based on the key of each file, transmit each encrypted file, and store each encrypted file on the server. The key of each file may be a key randomly selected by the first terminal device, and may also be referred to as an FEK of each file. Each encrypted file may be referred to as an encrypted file.
[0094] A member terminal device in the group may also upload a to-be-shared file.
[0095] For a member terminal device U1, the member terminal device U1 may encrypt a to-be-shared file F1 based on the authorization key of the current version, and sends the encrypted to-be-shared file F1 to the server. The server may add the encrypted to-be-shared file F1 to a folder corresponding to the group, and mark a version number, for example, a version number of the authorization key of the current version, for the to-be-shared file F1.
[0096] For the key of the at least one encrypted file, the first terminal device may use the key of the at least one encrypted file as a whole, and encrypt the key of the at least one encrypted file based on the authorization key of the current version, to obtain the key ciphertext of the at least one encrypted file, thereby packaging and encrypting the key of the encrypted file.
[0097] S302: The first terminal device sends the key ciphertext of the at least one encrypted file to the server.
[0098] The first terminal device may send the packaged and encrypted key ciphertext of the at least one encrypted file to the server.
[0099] When sending the at least one encrypted file to the server, the first terminal device may send the key ciphertext of the at least one encrypted file to the server. The first terminal device may send the key ciphertext of the at least one encrypted file to the server in other cases.
[0100] S303: The server receives the key ciphertext of the at least one encrypted file from the first terminal device.
[0101] S304: Each second terminal device obtains the key ciphertext of the at least one encrypted file from the server.
[0102] S305: Each second terminal device decrypts the key ciphertext of the at least one encrypted file based on the authorization key of the current version, to obtain the key of the at least one encrypted file.
[0103] Based on a case in which the foregoing information processing method is performed, each second terminal device may decrypt, based on a private key of each second terminal device, the authorization key ciphertext corresponding to each second terminal device, to obtain the authorization key of the current version. In this case, the authorization key of the current version is known to each second terminal device.
[0104] Therefore, each second terminal device may obtain the key ciphertext that is of the at least one encrypted file and that is stored on the server, and perform decryption based on the authorization key of the current version to obtain the key of the at least one encrypted file.
[0105] Even if the server or another device may learn of the key ciphertext of the at least one encrypted file, because the server or the other device cannot learn of the authorization key of the current version, the server or the other device cannot obtain the key of the at least one encrypted file through decryption. Consequently, file decryption cannot be implemented, thereby effectively ensuring data security.
[0106] S306: Each second terminal device decrypts, based on the key of each encrypted file, each encrypted file stored on the server.
[0107] When obtaining the key of the at least one encrypted file, each second terminal device may decrypt, based on the key of each encrypted file, each encrypted file stored on the server.
[0108] For another device, such as a device that does not belong to a group in which the at least one second terminal device is located, that cannot learn of the key of the encrypted file, because the device cannot learn of the authorization key of the current version, the device cannot obtain the key of the encrypted file through decryption, and therefore cannot access a file stored by the first terminal device on the server.
[0109] For example,
[0110] The terminal device A may randomly select an FEK for each to-be-shared file, and encrypt each file based on the FEK of each file. For an FEK of at least one file, the terminal device A may encrypt the FEK based on an authorization key AK.sub.1 of a current version, to obtain an FEK ciphertext. In addition, the terminal device may encrypt the authorization key AK.sub.1 of the current version based on a public key PK.sub.B of the terminal device B, to obtain an authorization key ciphertext corresponding to the terminal device B, encrypt the authorization key AK.sub.1 of the current version based on a public key PK.sub.C of the terminal device C, to obtain an authorization key ciphertext corresponding to the terminal device C, and encrypt the authorization key AK.sub.1 of the current version based on a public key PK.sub.D of the terminal device D, to obtain an authorization key ciphertext corresponding to the terminal device D.
[0111] The terminal device A sends at least one encrypted file and an FEK ciphertext of the at least one encrypted file to a server, and the server stores the at least one encrypted file and the FEK ciphertext of the at least one encrypted file.
[0112] The terminal device A further sends the authorization key ciphertext corresponding to the terminal device B, the authorization key ciphertext corresponding to the terminal device C, and the authorization key ciphertext corresponding to the terminal device D to the server. The server may send, to the terminal device B, the authorization key ciphertext corresponding to the terminal device B when the terminal device B goes online, send, to the terminal device C, the authorization key ciphertext corresponding to the terminal device C when the terminal device C goes online, and send, to the terminal device D, the authorization key ciphertext corresponding to the terminal device D when the terminal device D goes online.
[0113] The terminal device B may decrypt, based on a private key SK.sub.B of the terminal device B, the authorization key ciphertext corresponding to the terminal device B, to obtain the authorization key AK.sub.1 of the current version.
[0114] The terminal device C may decrypt, based on a private key SK.sub.C of the terminal device C, the authorization key ciphertext corresponding to the terminal device C, to obtain the authorization key AK.sub.1 of the current version.
[0115] The terminal device D may decrypt, based on a private key SK.sub.D of the terminal device D, the authorization key ciphertext corresponding to the terminal device D, to obtain the authorization key AK.sub.1 of the current version.
[0116] Regardless of the terminal device B, the terminal device C, or the terminal device D, as long as the terminal device B, the terminal device C, or the terminal device D can obtain the authorization key AK.sub.1 of the current version, the terminal device B, the terminal device C, or the terminal device D may decrypt the FEK ciphertext on the server based on the authorization key AK.sub.1 of the current version, to obtain the FEK of the at least one encrypted file, and then may access, based on the FEK of each encrypted file, each encrypted file stored on the server.
[0117] For a device other than the terminal device B, the terminal device C, and the terminal device D, because the device cannot learn of the authorization key of the current version, the device cannot obtain a key of the encrypted file through decryption, and therefore, cannot access a file stored by the terminal device A on the server.
[0118] In the information transmission method, after the key of the at least one encrypted file is encrypted based on the authorization key of the current version, the key of the at least one encrypted file may be transmitted to the server such that each second terminal device can decrypt the key of the at least one encrypted file based on the obtained authorization key of the current version, to obtain the key of the at least one encrypted file. In this way, each encrypted file is decrypted based on the key of each encrypted file, thereby avoiding leakage of the key of the encrypted file, ensuring security of the key, and ensuring security of user data.
[0119] Optionally, in any one of the foregoing information processing methods, the first terminal device may obtain a public key, a private key, and a modulus of the first terminal device based on a random number of a preset quantity of bits. In addition, the first terminal device further sends the random number of the preset quantity of bits to each second terminal device. The first terminal device may send the random number of the preset quantity of bits to each second terminal device through the server. That is, the first terminal device may send the random number of the preset quantity of bits to the server, to release the random number of the preset quantity of bits on the server such that the server sends the random number of the preset quantity of bits to each second terminal device.
[0120] When obtaining the random number of the preset quantity of bits, each second terminal device may obtain a public key, a private key, and a modulus of each second terminal device based on the random number of the preset quantity of bits.
[0121] In the modulus of the first terminal device and the modulus of each second terminal device, the first preset bits are the same, that is, are the random numbers of the preset quantity of bits. If the random numbers of the preset quantity of bits are random numbers of K bits, in the modulus of the first terminal device and the modulus of each second terminal device, the first K bits are the same, and are all the random numbers of the K bits.
[0122] According to the information processing method provided in this embodiment of this application, to effectively ensure data security, in some cases, the authorization key needs to be updated to an authorization key in a next phase. For example, the first terminal device may update the authorization key when a sharing user needs to be revoked, when a sharing user needs to be added, or when a to-be-shared file changes.
[0123] For example,
[0124] In the information processing method, the authorization key may be updated only by the group owner terminal device such as the first terminal device, and a member terminal device of the group owner terminal device cannot update the authorization key. It is assumed that a sharing user is newly added in the fourth phase. For a terminal device of the newly added sharing user, the terminal device may learn of the authorization key AK.sub.4 in the fourth phase, then automatically derive the authorization key AK.sub.3 in the third phase based on the authorization key AK.sub.4 in the fourth phase, then automatically derive the authorization key AK.sub.2 in the fourth phase based on the authorization key AK.sub.3 in the third phase, and then automatically derive the authorization key AK.sub.1 in the first phase based on the authorization key AK.sub.2 in the second phase. For the newly added terminal device, if the group owner terminal device such as the first terminal device cannot notify the newly added terminal device of an authorization key in a previous phase, the group owner terminal device may derive the authorization key in the previous phase based on a current authorization key. It is assumed that the terminal device is revoked in the second phase. In this case, the revoked terminal device cannot obtain the authorization key AK.sub.3 in the third phase and the authorization key AK.sub.4 in the fourth phase through derivation, and therefore cannot continue to access a file after the second phase.
[0125] In an implementation, the first terminal device used as the group owner terminal device may update a key based on a private key of the first terminal device and the authorization key in the current phase, to obtain the updated authorization key, that is, an authorization key in a next phase.
[0126] The following is described with reference to examples.
[0127] S601: A first terminal device encrypts an authorization key of a current version based on a private key or a secret trapdoor parameter of the first terminal device, to obtain an authorization key of a next version.
[0128] The authorization key of the next version may be an authorization key that is in a next phase and that corresponds to the authorization key of the current version.
[0129] The first terminal device may encrypt the authorization key of the current version based on the private key of the first terminal device using a one-way trapdoor function, to obtain the authorization key of the next version. The one-way trapdoor function may be, for example, a deterministic one-way trapdoor function, such as a Rivest-Shamir-Adleman (RSA) function or a Rabin function.
[0130] The first terminal device may alternatively encrypt the authorization key of the current version based on the secret trapdoor parameter of the first terminal device using the one-way trapdoor function, to obtain the authorization key of the next version. The secret trapdoor parameter of the first terminal device may include, for example, the private key of the first terminal device and a modulus of the first terminal device.
[0131] It is assumed that if the first terminal device is a terminal device A, and an RSA function is used as an example, the terminal device A may encrypt the authorization key of the current version based on a private key SK.sub.A of the terminal device A and a modulus n.sub.A of the terminal device A using an RSA function shown in the following formula (1), to obtain the authorization key of the next version:
AK.sub.i+1=AK.sub.i.sup.SK.sup.
[0132] AK.sub.i+1 is the authorization key of the next version, that is, the authorization key that is in the next phase and that corresponds to the authorization key of the current version. mod is a modulo function. AK.sub.i is the authorization key of the current version.
[0133] S602: The first terminal device encrypts the updated authorization key based on a public key of each of at least one third terminal device, to obtain an authorization key ciphertext corresponding to each third terminal device.
[0134] If the first terminal device updates the authorization key when revoking a sharing user, the at least one third terminal device may be a destination terminal device used for file sharing after the first terminal device revokes a terminal device. It is assumed that the terminal device A is a group owner terminal device. In a first phase, the terminal device A expects to share a file to a terminal device B, a terminal device C, and a terminal device D. That is, the at least one second terminal device may include the terminal device B, the terminal device C, and the terminal device D. In a second phase, the terminal device A revokes permission of the terminal device D. In this case, the at least one third terminal device may include the terminal device B and the terminal device C.
[0135] If the first terminal device updates the authorization key when a to-be-analyzed file changes, the at least one third terminal device is the at least one second terminal device.
[0136] S603: The first terminal device sends, to each third terminal device through a server, the authorization key ciphertext corresponding to each third terminal device.
[0137] The first terminal device may directly send, to each third terminal device, the authorization key ciphertext corresponding to each third terminal device, or may send, to each third terminal device through another intermediate device such as the server, the authorization key ciphertext corresponding to each third terminal device.
[0138] For example, the first terminal device may first send, to the server, the authorization key ciphertext corresponding to each third terminal device, and the server sends, to each third terminal device, the authorization key ciphertext corresponding to each third terminal device.
[0139] The first terminal device may send the obtained authorization key ciphertext corresponding to the at least one third terminal device to the server, and the server distributes the authorization key ciphertext, that is, sends, to each third terminal device, the authorization key ciphertext corresponding to each third terminal device. When each third terminal device goes online, the server may forward, to each third terminal device, the authorization key ciphertext corresponding to each third terminal device.
[0140] Because the authorization key ciphertext corresponding to each third terminal device is encrypted using the public key of each third terminal device, the authorization key ciphertext corresponding to each third terminal device may be decrypted only using a private key of each third terminal device. The server or another device does not have the private key of each third terminal device. Even if the server or another device receives the authorization key ciphertext corresponding to each third terminal device, the authorization key ciphertext corresponding to each third terminal device cannot be decrypted, and the authorization key of the next version cannot be obtained. Even if the revoked user equipment receives the authorization key ciphertext corresponding to each third terminal device, the user equipment cannot decrypt the authorization key ciphertext corresponding to each third terminal device, and then cannot obtain the authorization key of the next version. Therefore, the user equipment cannot access a file.
[0141] S604: Each third terminal device receives the authorization key ciphertext that corresponds to each third terminal device and that is from the first terminal device.
[0142] S605: Each third terminal device decrypts, based on the private key of each third terminal device, the authorization key ciphertext corresponding to each third terminal device, to obtain the authorization key of the next version.
[0143] Because the authorization key ciphertext corresponding to each third terminal device is encrypted using the public key of each third terminal device, the authorization key ciphertext corresponding to each third terminal device may be decrypted only using the private key of each third terminal device. However, the private key of each third terminal device is unknown to another device, and is known only to each third terminal device. Therefore, each third terminal device may decrypt, based on the private key of each third terminal device, the authorization key ciphertext corresponding to each third terminal device, to obtain the authorization key of the next version.
[0144] A device, for example, the revoked terminal device, outside the group in which the at least one third terminal device is located cannot receive the authorization key ciphertext that corresponds to the device outside the group in which the at least one third terminal device is located and that is sent by the first terminal device. Even if the device can obtain the authorization key ciphertext corresponding to the third terminal device, the device cannot obtain the authorization key of the next version because the device does not have the private key of the third terminal device and cannot decrypt the private key of the third terminal device.
[0145] S606: Each third terminal device obtains a file key from the server based on the authorization key of the next version, and performs file decryption based on the file key.
[0146] The third terminal device may obtain the file key from the server based on the authorization key of the next version, and decrypt, based on the file key, a to-be-shared file pre-stored on the server, thereby implementing file sharing between the first terminal device and the third terminal device.
[0147] In the information processing method, the first terminal device may update the authorization key based on the private key of the first terminal device, separately encrypt the updated authorization key based on the public key of the at least one third terminal device, to obtain the authorization key ciphertext corresponding to the at least one third terminal device, and transmit the authorization key ciphertext to each third terminal device such that each third terminal device may perform decryption based on the private key corresponding to each third terminal device, to obtain the updated authorization key, obtain the file key from the server, and perform file decryption based on the file key. In this way, when the first terminal device revokes a terminal device, the revoked terminal device cannot learn of the updated authorization key and cannot perform file decryption, thereby revoking decryption permission of the revoked terminal device and effectively ensuring data security.
[0148] For example,
AK.sub.2=AK.sub.1.sup.SK.sup.
[0149] When obtaining the authorization key AK.sub.2 in the second phase, the terminal device A may encrypt the authorization key AK.sub.2 in the second phase based on a public key PK.sub.B of the terminal device B, to obtain an authorization key ciphertext that is in the second phase and that corresponds to the terminal device B, and encrypt the authorization key AK.sub.2 in the second phase based on a public key PK.sub.C of the terminal device C, to obtain an authorization key ciphertext that is in the second phase and that corresponds to the terminal device C.
[0150] The terminal device A further sends, to a server, the authorization key ciphertext that is in the second phase and that corresponds to the terminal device B and the authorization key ciphertext that in the second phase and that corresponds to the terminal device C. The server may send, to the terminal device B when the terminal device B goes online, the authorization key ciphertext that is in the second phase and that corresponds to the terminal device B, and send, to the terminal device C when the terminal device C goes online, the authorization key ciphertext that is in the second phase and that corresponds to the terminal device C.
[0151] The terminal device B may decrypt, based on a private key SK.sub.B of the terminal device B, the authorization key ciphertext that is in the second phase and that corresponds to the terminal device B, to obtain the authorization key AK.sub.2 in the second phase.
[0152] The terminal device C may decrypt, based on a private key SK.sub.C of the terminal device C, the authorization key ciphertext that is in the second phase and that corresponds to the terminal device C, to obtain the authorization key AK.sub.2 in the second phase.
[0153] The terminal device D has been revoked by the terminal device A, and has only the authorization key in the first phase, but does not obtain the authorization key in the second phase that is sent by the terminal device A through the terminal device D. In addition, the terminal device D does not have a private key of the terminal device A. Therefore, the terminal device D cannot automatically derive the authorization key in the second phase. As a result, decryption permission of the terminal device D is revoked, thereby ensuring data security.
[0154] Based on the foregoing information processing method, an embodiment of this application may further provide an information processing method.
[0155] S801: A first terminal device sends a public key of the first terminal device to each third terminal device.
[0156] The first terminal device may directly send the public key of the first terminal device to each third terminal device, or may send the public key of the first terminal device to each third terminal device through another intermediate device such as a server.
[0157] For example, the first terminal device may first send the public key of the first terminal device to the server, and the server stores the public key of the first terminal device, and sends the public key of the first terminal device to each third terminal device.
[0158] The server may store a public key of a group owner terminal device in each phase.
[0159] S802: Each third terminal device receives the public key of the first terminal device from the first terminal device.
[0160] Each third terminal device may receive the public key of the first terminal device sent by the server from the first terminal device.
[0161] S803: Each third terminal device decrypts, based on the public key of the first terminal device, an authorization key of a next version, to obtain an authorization key of a current version.
[0162] S804: Obtain a file key from the server based on the authorization key of the current version, and perform file decryption based on the file key.
[0163] Each third terminal device may decrypt, based on the public key of the first terminal device using a one-way trapdoor function, the authorization key of the next version, to obtain the authorization key of the current version. The one-way trapdoor function may be, for example, a deterministic one-way trapdoor function, such as an RSA function or a Rabin function.
[0164] Alternatively, each third terminal device may decrypt, based on a public trapdoor parameter of the first terminal device using a one-way trapdoor function, the authorization key of the next version, to obtain the authorization key of the current version. The public trapdoor parameter of the first terminal device may include the public key and a modulus of the first terminal device.
[0165] It is assumed that if a fourth terminal device is a terminal device E, and an RSA function is used as an example, the fourth terminal device may decrypt the authorization key of the next version based on a public key PK.sub.A of the terminal device A and a modulus n.sub.A of the terminal device A using an RSA function shown in the following formula (3), to obtain the authorization key of the current version:
AK.sub.i=AK.sub.i+1.sup.PK.sup.
[0166] AK.sub.i+1 is the authorization key of the next version, that is, the authorization key that is in the next phase and that corresponds to the authorization key of the current version. mod is a modulo function. AK.sub.i is the authorization key of the current version.
[0167] Especially for a newly added terminal device, according to the information processing method, the first terminal device may send, to each third terminal device, only the authorization key ciphertext corresponding to each third terminal device such that each third terminal device performs decryption using the private key of each third terminal device, to obtain the authorization key of the next version, the first terminal device does not need to send an authorization key in a previous phase to each third terminal device, and each third terminal device may decrypt the authorization key of the next version based on the public key of the first terminal device that is learned by each third terminal device, to derive the authorization key of the previous version. In this way, the information processing method can reduce traffic and key management and storage, and improve efficiency of key distribution and management.
[0168] Based on the foregoing information processing method, an embodiment of this application may further provide an information processing method.
[0169] S901: A first terminal device sends group owner change information to a target terminal device through a server.
[0170] The first terminal device may be a current group owner terminal device. The target terminal device may be a destination group owner terminal device. The group owner terminal device may also be referred to as a group manager (GM). In this case, the first terminal device may be denoted as a GM 1, and the target terminal device may be denoted as a GM 2.
[0171] The first terminal device may send the group owner change information to the target terminal device through the server. That is, the first terminal device may send the group owner change information to the server, where the group owner change information includes information about the target terminal device such that the server forwards the group owner change information to the target terminal device. The server further records a group owner change record. The group owner change record may include at least information such as an identifier of a group owner terminal device in each phase, and a public key and a modulus of the group owner terminal device in each phase.
[0172] The first terminal device sends the group owner change information to the target terminal device such that the target terminal device confirms the group owner change information.
[0173] S902: The target terminal device receives the group owner change information from the first terminal device.
[0174] S903: The target terminal device encrypts an authorization key of a current version based on a private key of the target terminal device, to obtain an authorization key of a next version.
[0175] After receiving the group owner change information from the first terminal device, the target terminal device may determine to accept the first terminal device. When a group owner identity of the first terminal device is changed to the target terminal device, a next phase starts. Then, the target terminal device, used as the changed group owner terminal device, needs to update the authorization key, and may encrypt the current authorization key based on the private key of the target terminal device, to obtain the authorization key of the next version.
[0176] The authorization key of the current version may be an authorization key generated or updated by the first terminal device.
[0177] Alternatively, the target terminal device may encrypt the current authorization key based on a secret trapdoor parameter of the target terminal device using a one-way trapdoor function, to obtain the authorization key of the next version. The secret trapdoor parameter of the target terminal device may include the private key and a modulus of the target terminal device.
[0178] Therefore, when the target terminal device is used as the changed group owner terminal device, not all authorization keys in previous phases need to be re-calculated, and only a public key and a modulus of the group owner terminal device in each phase need to be recorded. As a result, update of authorization keys in all phases can be avoided, and a key ciphertext of a file that affects encryption also needs to be re-encrypted, greatly reducing an amount of communication and an amount of calculation.
[0179] For example,
AK.sub.3=AK.sub.2.sup.SK.sup.
[0180] When obtaining the authorization key AK.sub.3 in the third phase, the terminal device B may encrypt the authorization key AK.sub.3 in the third phase based on a public key PK.sub.A of the terminal device A, to obtain an authorization key ciphertext that is in the third phase and that corresponds to the terminal device A, and encrypt the authorization key AK.sub.3 in the third phase based on a public key PK.sub.C of the terminal device C, to obtain an authorization key ciphertext that is in the third phase and that corresponds to the terminal device C.
[0181] The terminal device B further sends, to the server, the authorization key ciphertext that is in the third phase and that corresponds to the terminal device A and the authorization key ciphertext that in the third phase and that corresponds to the terminal device C. The server may send, to the terminal device A when the terminal device A goes online, the authorization key ciphertext that is in the third phase and that corresponds to the terminal device B, and send, to the terminal device C when the terminal device C goes online, the authorization key ciphertext that is in the third phase and that corresponds to the terminal device C.
[0182] The terminal device A may decrypt, based on a private key SK.sub.A of the terminal device A, the authorization key ciphertext that is in the third phase and that corresponds to the terminal device A, to obtain the authorization key AK.sub.3 in the third phase.
[0183] The terminal device C may decrypt, based on a private key SK.sub.C of the terminal device C, the authorization key ciphertext that is in the third phase and that corresponds to the terminal device C, to obtain the authorization key AK.sub.3 in the third phase.
[0184] After the group owner terminal device is changed to the terminal device B, the terminal device B may update the authorization key based on a private key of the terminal device B, thereby effectively ensuring file access security after a group owner is updated, and ensuring data security.
[0185]
[0186] When receiving the authorization key ciphertext corresponding to the terminal device E, the terminal device E may decrypt, based on a private key of the terminal device E, the authorization key ciphertext corresponding to the terminal device E, to obtain the authorization key in the third phase.
[0187] The terminal device E may obtain, from a server, a public key PK.sub.B and a modulus n.sub.B of the terminal device B, and a public key PK.sub.A and a modulus n.sub.A of a terminal device A.
[0188] The terminal device E may decrypt a key AK.sub.3 in the third phase based on the public key PK.sub.B and the modulus n.sub.B of the terminal device B using the following formula (5), to obtain a key AK.sub.2 in a second phase:
AK.sub.2=AK.sub.3.sup.PK.sup.
[0189] The terminal device E may decrypt the key AK.sub.2 in the second phase based on the public key PK.sub.A and the modulus n.sub.A of the terminal device A using the following formula (6), to obtain a key AK.sub.1 in a first phase:
AK.sub.1=AK.sub.2.sup.PK.sup.
[0190] For a newly added terminal device, the group owner terminal device, that is, the terminal device B, may send, to the terminal device E, only the authorization key ciphertext of the terminal device E such that the terminal device E performs decryption using the private key of the terminal device E, to obtain the authorization key in the third phase. The terminal device B does not need to send an authorization key in a previous phase to the terminal device E. The terminal device E may also decrypt the authorization key based on a public key that is of the group owner terminal device in the previous phase and that is learned by the terminal device E, to derive the authorization key in the previous phase, for example, an authorization key in the second phase and an authorization key in the first phase. In this way, the information processing method can reduce traffic and key management and storage, and improve efficiency of key distribution and management.
[0191] In another implementation, as the group owner terminal device, the first terminal device may determine, from a preset first database, an authorization key of a next version as an authorization key in a next phase.
[0192] The following is described with reference to examples.
[0193] S1201: A first terminal device determines, from a preset first database, an authorization key of a next version of an authorization key of a current version, where the first database includes authorization keys of a plurality of versions of the first terminal device.
[0194] The first database may be a database of authorization keys of the first terminal device, and includes authorization keys of a plurality of versions. All the authorization keys of the plurality of versions may be obtained by the first terminal device.
[0195] In this implementation, the first terminal device, that is, a group owner terminal device, can update the authorization key without calculation, but determines an authorization key of a next version from the first database to update the authorization key.
[0196] Optionally, before determining, by a first terminal device, from a preset first database, an authorization key of a next version of an authorization key of a current version in S1201 in the information processing method, the method may further include obtaining, by the first terminal device, the authorization keys of the plurality of versions in the first database based on a preset first random number using a preset first one-way trapdoor function.
[0197] The first random number may be randomly selected by the first terminal device. Therefore, the first random number may also be referred to as a private key of the first terminal device. The first terminal device has a “trapdoor” for updating a version authorization key, and another device cannot learn of the first random number, and therefore cannot calculate the authorization key of the next version.
[0198] The preset first one-way trapdoor function may be a hash chain function, which is also referred to as a hash function, for example, may be any one of a message-digest algorithm 5 (MD5) function, a Secure Hash Algorithm (SHA) function, and the like.
[0199] Optionally, the first terminal device may use the first random number as an authorization key of an n.sup.th version of the first terminal device, where n is an integer greater than or equal to 2, and the first terminal device may obtain an authorization key of an (n−1).sup.th version of the first terminal device based on the authorization key of the n.sup.th version using the first one-way trapdoor function, until an authorization key of the first version of the first terminal device is obtained. In this way, the first terminal device can obtain authorization keys, that is, the authorization keys in the first database, of n versions of the first terminal device.
[0200] If the first terminal device is a terminal device A, the first random number may be denoted as SK.sub.A, and the terminal device A may use the first random number SK.sub.A as the authorization key AK.sub.nA of the n.sup.th version of the terminal device A and obtain the authorization key AK.sub.(i-1)A of the (n−1).sup.th version of the terminal device A using an SHA function shown in the following formula (7). i may be any integer greater than or equal to 2 and less than n:
AK.sub.(i-1)A=SHA(AK.sub.iA). formula (7)
[0201] That is, in the first database, an authorization key of an (i−1).sup.th version of the terminal device A may be obtained using a hash value of an authorization key of an i.sup.th version of the terminal device A.
[0202] After all the authorization keys of the plurality of versions in the first database of the first terminal device are used, the first terminal device may reselect a random number, and obtain the authorization keys of the plurality of versions of the first terminal device using the preset first one-way trapdoor function, to update the first database. For example, the first terminal device may be reset as a new group owner terminal device by executing a process of changing the group owner terminal device. The reset first terminal device reselects a random number, and obtains the authorization keys of the plurality of versions of the first terminal device using the preset first one-way trapdoor function.
[0203] S1202: The first terminal device encrypts the authorization key of the next version based on a public key of each of at least one fourth terminal device, to obtain an authorization key ciphertext corresponding to each fourth terminal device.
[0204] The at least one fourth terminal device is a destination terminal device used for file sharing after the first terminal device revokes a terminal device.
[0205] S1203: The first terminal device sends, to each fourth terminal device through a server, the authorization key ciphertext corresponding to each fourth terminal device.
[0206] For a specific description of S1203, refer to S603. Details are not described herein again.
[0207] S1204: Each fourth terminal device receives the authorization key ciphertext that corresponds to each fourth terminal device and that is sent by the first terminal device.
[0208] For a specific description of S1204, refer to S604. Details are not described herein again.
[0209] S1205: Each fourth terminal device decrypts, based on a private key of each fourth terminal device, the authorization key ciphertext corresponding to each fourth terminal device, to obtain the authorization key of the next version.
[0210] For a specific description of S1205, refer to S605. Details are not described herein again.
[0211] S1206: Each fourth terminal device obtains a file key from the server based on the authorization key of the next version, and performs file decryption based on the file key.
[0212] For a specific description of S1206, refer to S606. Details are not described herein again.
[0213] Optionally, when obtaining the authorization key of the next version, each fourth terminal device may further obtain the authorization key of the current version based on the authorization key of the next version using the preset first one-way trapdoor function, and performs file decryption based on the authorization key of the current version.
[0214] The authorization key of the (n−1).sup.th version in the first database is obtained based on the authorization key of the n.sup.th version using the preset first one-way trapdoor function. Therefore, each fourth terminal device uses the preset first one-way trapdoor function based on the authorization key of the next version, to obtain the authorization key of the current version. For example, each third terminal device may obtain the authorization key of the current version based on a hash value of the authorization key of the next version.
[0215] In the information processing method, the first terminal device may determine, from the preset first database, the authorization key of the next version of the authorization key of the current version, to update the authorization key, separately encrypt the authorization key of the next version based on the public key of the at least one fourth terminal device, to obtain the authorization key ciphertext corresponding to the at least one fourth terminal device, and transmit the authorization key ciphertext to each fourth terminal device such that each fourth terminal device can perform decryption based on the private key corresponding to the fourth terminal device, to obtain the updated authorization key, and then perform file decryption. In this way, when the first terminal device revokes a terminal device, the revoked terminal device cannot learn of the updated authorization key and cannot perform file decryption, thereby revoking decryption permission of the revoked terminal device and effectively ensuring data security.
[0216] For example, the terminal device A is the group owner terminal device, and in a first phase, the terminal device A expects to share a file to a terminal device B, a terminal device C, and a terminal device D. An authorization key in the first phase may be AK.sub.1. In a second phase, the terminal device A revokes permission of the terminal device D, and the terminal device A may select, based on AK.sub.1, an authorization key of a next version of AK.sub.1 from a database of the terminal device A as an authorization key AK.sub.2 in the second phase.
[0217] When obtaining the authorization key AK.sub.2 in the second phase, the terminal device A may encrypt the authorization key AK.sub.2 in the second phase based on a public key PK.sub.B of the terminal device B, to obtain an authorization key ciphertext that is in the second phase and that corresponds to the terminal device B, and encrypt the authorization key AK.sub.2 in the second phase based on a public key PK.sub.C of the terminal device C, to obtain an authorization key ciphertext that is in the second phase and that corresponds to the terminal device C.
[0218] The terminal device A further sends, to a server, the authorization key ciphertext that is in the second phase and that corresponds to the terminal device B and the authorization key ciphertext that in the second phase and that corresponds to the terminal device C. The server may send, to the terminal device B when the terminal device B goes online, the authorization key ciphertext that is in the second phase and that corresponds to the terminal device B, and send, to the terminal device C when the terminal device C goes online, the authorization key ciphertext that is in the second phase and that corresponds to the terminal device C.
[0219] The terminal device B may decrypt, based on a private key SK.sub.B of the terminal device B, the authorization key ciphertext that is in the second phase and that corresponds to the terminal device B, to obtain the authorization key AK.sub.2 in the second phase.
[0220] The terminal device C may decrypt, based on a private key SK.sub.C of the terminal device C, the authorization key ciphertext that is in the second phase and that corresponds to the terminal device C, to obtain the authorization key AK.sub.2 in the second phase.
[0221] The terminal device D has been revoked by the terminal device A, and has only the authorization key in the first phase, but does not obtain the authorization key in the second phase that is sent by the terminal device A through the terminal device D. In addition, the terminal device D does not have a private key of the terminal device A. Therefore, the terminal device D cannot automatically derive the authorization key in the second phase. As a result, decryption permission of the terminal device D is revoked, thereby ensuring data security.
[0222] Based on the foregoing information processing method, an embodiment of this application may further provide an information processing method.
[0223] S1301: A first terminal device sends group owner change information to a target terminal device through a server.
[0224] For a specific description of S1301, refer to S901. Details are not described herein again.
[0225] S1302: The target terminal device receives the group owner change information from the first terminal device.
[0226] For a specific description of S1302, refer to S902. Details are not described herein again.
[0227] S1303: The target terminal device obtains a second database based on a preset second random number using a preset second one-way trapdoor function, where the second database includes authorization keys of a plurality of versions of a second terminal device.
[0228] The second random number may be randomly selected by the target terminal device. Therefore, the second random number may also be referred to as a private key of the second terminal device. The second terminal device has a “trapdoor” for updating a version authorization key, and another device cannot learn of the second random number, and therefore cannot calculate the authorization key of the next version.
[0229] The preset second one-way trapdoor function may be a hash chain function, also referred to as a hash function, and may be, for example, any one of an MD5 function, an SHA function, or the like.
[0230] Optionally, the target terminal device may use the second random number as an authorization key of an n.sup.th version of the target terminal device, where n is an integer greater than or equal to 2, and the target terminal device may obtain an authorization key of an (n−1).sup.th version of the target terminal device based on the authorization key of the n.sup.th version using the second one-way trapdoor function, until an authorization key of the first version of the target terminal device is obtained. In this way, the target terminal device can obtain authorization keys, that is, the authorization keys in the second database, of n versions of the target terminal device.
[0231] If the target terminal device is a terminal device B, the second random number may be denoted as SK.sub.B, and the terminal device B may use the second random number SK.sub.B as the authorization key AK.sub.nB of the n.sup.th version of the terminal device B and obtain the authorization key AK.sub.(i-1)B of the (n−1).sup.th version of the terminal device B using an SHA function shown in the following formula (8). i may be any integer greater than or equal to 2 and less than n:
AK.sub.(i-1)B=SHA(AK.sub.iB). formula (8)
[0232] That is, in the first database, an authorization key of an (i−1).sup.th version of the terminal device B may be obtained using a hash value of an authorization key of an i.sup.th version of the terminal device B.
[0233] If the terminal device A changes a group owner to the terminal device B in a second phase, the current authorization key may be AK.sub.2A. The terminal device B may further encrypt the current authorization key AK.sub.2A using the authorization key of the first version in the second database, that is, the authorization key AK.sub.1B of the first version of the terminal device B, and then send the encrypted current authorization key to the server such that the server records the encrypted current authorization key AK.sub.2A to a version change history of the authorization key.
[0234] Therefore, when the target terminal device is used as the changed group owner terminal device, the target terminal device can obtain authorization keys in previous phases based on the updated authorization key with reference to the version change history in the server, without recalculating all the authorization keys in the previous phases. As a result, update of the authorization keys in all the phases is avoided, and a key ciphertext of a file that affects encryption also needs to be re-encrypted, greatly reducing an amount of communication and an amount of calculation.
[0235] For example, the terminal device A is the group owner terminal device, and in a third phase, the terminal device A expects to change the group owner terminal device to the terminal device B. The terminal device A may send group owner update information to the server, and the server forwards the group owner change information to the terminal device B. After receiving the group owner update information, the terminal device B may be determined as the group owner terminal device, and may obtain the n authorization keys of the terminal device B based on a random number, such as SK.sub.B, of the terminal device B using the SHA function shown in the foregoing formula (8), and the authorization key AK.sub.1B of the first version of the terminal device B is used as the authorization key AK.sub.3 in the third phase.
[0236] When obtaining the authorization key AK.sub.3 in the third phase, the terminal device B may encrypt the authorization key AK.sub.3 in the third phase based on a public key PK.sub.A of the terminal device A, to obtain an authorization key ciphertext that is in the third phase and that corresponds to the terminal device A, and encrypt the authorization key AK.sub.3 in the third phase based on a public key PK.sub.C of the terminal device C, to obtain an authorization key ciphertext that is in the third phase and that corresponds to the terminal device C.
[0237] The terminal device B further sends, to the server, the authorization key ciphertext that is in the third phase and that corresponds to the terminal device A and the authorization key ciphertext that in the third phase and that corresponds to the terminal device C. The server may send, to the terminal device A when the terminal device A goes online, the authorization key ciphertext that is in the third phase and that corresponds to the terminal device B, and send, to the terminal device C when the terminal device C goes online, the authorization key ciphertext that is in the third phase and that corresponds to the terminal device C.
[0238] The terminal device A may decrypt, based on a private key SK.sub.A of the terminal device A, the authorization key ciphertext that is in the third phase and that corresponds to the terminal device A, to obtain the authorization key AK.sub.3 in the third phase.
[0239] The terminal device C may decrypt, based on a private key SK.sub.C of the terminal device C, the authorization key ciphertext that is in the third phase and that corresponds to the terminal device C, to obtain the authorization key AK.sub.3 in the third phase.
[0240] After the group owner terminal device is changed to the terminal device B, the terminal device B may update the authorization key based on a private key of the terminal device B, thereby effectively ensuring file access security after a group owner is updated, and ensuring data security.
[0241] The terminal device B is used as the group owner terminal device. In the third phase, if the terminal device B expects to add a terminal device E to a group in which a user file is shared, the terminal device B may decrypt, using a public key of the terminal device E, the authorization key in the third phase, to obtain an authorization key ciphertext corresponding to the terminal device E.
[0242] When receiving the authorization key ciphertext corresponding to the terminal device E, the terminal device E may decrypt, based on a private key of the terminal device E, the authorization key ciphertext corresponding to the terminal device E, to obtain the authorization key in the third phase.
[0243] If a new terminal device, such as the terminal device E, wants to view a file of a historical version, the terminal device E needs to calculate an authorization key of the historical version based on the authorization key of the third version, and then performs file decryption. The terminal device E needs to determine whether an encrypted version authorization key between an authorization key of a to-be-decrypted version and an authorization key in a current phase, for example, the authorization key in the third phase, is recorded in the server. If no, the terminal device E may calculate the authorization key of the to-be-decrypted version based on the authorization key in the current phase, for example, the authorization key in the third phase, using a hash function. If yes, the terminal device E finds the encrypted version authorization key from the server, and the terminal device E may obtain an authorization key of the first version of the current group owner terminal device using a hash function, then decrypt the encrypted version authorization key in the historical record based on the authorization key of the first version of the current group owner terminal device, then obtain an authorization key of each version of the current group owner terminal device using the encrypted version authorization key as a base point and using a hash function, until the authorization key of the to-be-decrypted version is obtained.
[0244] In an implementation, the first terminal device used as the group owner terminal device may update a key based on a secrete trapdoor parameter of the first terminal device and the authorization key in the current phase, to obtain the updated authorization key, that is, an authorization key in a next phase.
[0245]
[0246] S1401: A first terminal device obtains an authorization key of a next version based on a secret trapdoor parameter of the first terminal device using a one-way trapdoor function.
[0247] The secret trapdoor parameter of the first terminal device may be denoted as C.sub.GM1, and the authorization key of the next version may be, for example, _AK.sub.V+1.
[0248] S1402: The first terminal device encrypts the authorization key of the next version based on a public key of each of at least one third terminal device, to obtain an authorization key ciphertext that is of the next version and that corresponds to each third terminal device.
[0249] The at least one third terminal device may be a terminal device other than the to-be-revoked terminal device in member terminal devices.
[0250] The first terminal device may obtain public keys of all the member terminal devices from metadata of a group. The metadata of the group may be stored in the first terminal device, or may be stored on a server. If the metadata of the group is on the server, the first terminal device further needs to obtain the metadata of the group from the server.
[0251] If the revoked terminal device is a member terminal device U2, at least one second terminal device may be a terminal device other than the member terminal device U2, that is, does not include the member terminal device U2.
[0252] S1403: The first terminal device sends, to each third terminal device through the server, a version number of the next version and the authorization key ciphertext that is of the next version and corresponds to each third terminal device.
[0253] The first terminal device may send, to the server, the authorization key ciphertext that is of the next version and that corresponds to each third terminal device. The server receives the authorization key ciphertext that is of the next version, that corresponds to each third terminal device, and that is sent by the first terminal device.
[0254] The server may further update a version number from V to V+1, and add a public trapdoor parameter P.sub.GM1 of the first terminal device to a version history.
[0255] S1404: Each third terminal device receives, from the first terminal device, the version number of the next version and the authorization key ciphertext that is of the next version and that corresponds to each third terminal device.
[0256] S1405: Each third terminal device decrypts, based on a private key of each third terminal device, the authorization key ciphertext that is of the next version and that corresponds to each third terminal device, to obtain the authorization key of the next version.
[0257] S1406: Each third terminal device obtains a file key from the server based on the received version number of the next version and the authorization key of the next version, and performs file decryption based on the file key.
[0258] The server may further send update success information to the first terminal device, and update the metadata of the group. The metadata of the group further includes information about the member terminal device and version information.
[0259] The first terminal device may further update the metadata of the group that is stored in the first terminal device, and after updating the metadata of the group, send the metadata of the group to the server, and the server stores the metadata of the group.
[0260] In the information processing method, the first terminal device may update the authorization key based on the secret trapdoor parameter of the first terminal device, separately encrypt the updated authorization key based on the public key of the at least one third terminal device, to obtain the authorization key ciphertext corresponding to the at least one third terminal device, and transmit the authorization key ciphertext to each third terminal device such that each third terminal device may perform decryption based on the private key corresponding to each third terminal device, to obtain the updated authorization key, and then perform file decryption. In this way, when the first terminal device revokes a terminal device, the revoked terminal device cannot learn of the updated authorization key and cannot perform file decryption, thereby revoking decryption permission of the revoked terminal device and effectively ensuring data security.
[0261]
[0262] S1501: A first terminal device sends group owner change information to a target terminal device through a server.
[0263] The first terminal device may send a group owner change request to the server. After receiving the group owner change request, the server may first switch an identity of a group owner from the first terminal device to the target terminal device, and send the group owner change information to the target terminal device such that the target terminal device confirms the identity of the group owner. The group owner change request may include the group owner change information, for example, information about the target terminal device.
[0264] S1502: The target terminal device receives the group owner change information sent by the server.
[0265] S1503: The target terminal device generates a secret trapdoor parameter and a public trapdoor parameter of the target terminal device, obtains an authorization key of a current version, and obtains an authorization key of a next version based on the secret trapdoor parameter of the target terminal device using a one-way trapdoor function.
[0266] The target terminal device may be a GM 2. The secret trapdoor parameter of the target terminal device may be C.sub.GM2, and the public trapdoor parameter of the target terminal device may be P.sub.GM2. The authorization key of the next version may be AK.sub.V+1.
[0267] The target terminal device further sends a version number of the next version and the public trapdoor parameter of the target terminal device to the server.
[0268] The server receives the version number of the next version and the public trapdoor parameter of the target terminal device that are sent by the target terminal device.
[0269] The server may add the received version number V+1 of the next version and the received public trapdoor parameter P.sub.GM2 of the target terminal device to the version history.
[0270] The target terminal device further obtains a public key of the member terminal device in the group, and the target terminal device encrypts the authorization key of the next version based on a public key of each member terminal device in the group, to obtain an authorization key ciphertext that is of the next version and that corresponds to each member terminal device.
[0271] The target terminal device may obtain public keys of all the member terminal devices from the metadata of the group. The target terminal device may obtain the metadata of the group from the server.
[0272] The target terminal device further sends, to the server, the authorization key ciphertext that is of the next version and that corresponds to each member terminal device, and the server sends, to each member terminal device, the version number of the next version and the authorization key ciphertext that is of the next version and that corresponds to each member terminal device.
[0273] The server further updates the metadata of the group. The metadata of the group may further include information about the changed group owner terminal device, and a public trapdoor parameter, version information, and the like of the changed group owner terminal device.
[0274] Each member terminal device performs file decryption based on the received version number of the next version and the received authorization key ciphertext that is of the next version and that corresponds to each member terminal device.
[0275] The first terminal device and the target terminal device further separately update the metadata that is of the group and that is stored by the first terminal device and the target terminal device.
[0276] According to the information processing method, when the group owner terminal device is changed, the changed group owner terminal device may update the authorization key, thereby ensuring file security. In addition, after the group owner terminal device is changed, the changed group owner terminal device does not need to recalculate the authorization key, and each member terminal device may also derive a key with reference to a public trapdoor parameter of a group owner terminal device corresponding to each version in the version history, to obtain an authorization key of each historical version. In this way, the information processing method can reduce traffic and key management and storage, and improve efficiency of key distribution and management.
[0277] Based on the information processing method shown in
[0278] If V.sub.F2=V.sub.current, the member terminal device U1 may decrypt the file F2 based on the authorization key AK.sub.current of the current version.
[0279] If V.sub.F2<V.sub.current, the member terminal device U1 may obtain the version history from the server. The version history may include a public trapdoor parameter of a group owner terminal device corresponding to each version, for example, {(v.sub.1, P.sub.GM1), (vn, P.sub.GMn)}. The member terminal device U1 may obtain an authorization key of a previous version of the current version based on the authorization key AK.sub.current of the current version and the public trapdoor parameter P.sub.GMX that is of the group owner terminal device and that corresponds to the current version using the one-way trapdoor function, repeat execution, and when the obtained version number of the authorization key is the same as the version number V.sub.F2 of the file F2, decrypt the file F2 based on the authorization key of the same version number.
[0280] An embodiment of this application may further provide a terminal device. The terminal device may be used as a first terminal device, and has any function of the first terminal device in any method in
[0281] It should be understood that the terminal device 1600 has any function of the first terminal device in any method in
[0282] The terminal device provided in the foregoing embodiment of this application may be implemented in a plurality of product forms. For example, the terminal device may be configured as a general-purpose processing system. For example, the terminal device may be implemented using a general bus architecture. For example, the terminal device may be implemented by an ASIC. The following provides several possible product forms of the terminal device in the embodiments of this application. It should be understood that the following is merely an example, and the possible product forms in the embodiments of this application are not limited thereto.
[0283]
[0284] As a possible product form, the terminal device may be implemented by a device, and the terminal device includes a processor 1702 and a transceiver 1704. Optionally, the terminal device may further include a storage medium 1703.
[0285] As another possible product form, the terminal device is also implemented using a general-purpose processor, that is, implemented using a commonly known chip. The general-purpose processor includes a processor 1702 and a transceiver interface 1705/transceiver pin 1706. Optionally, the general-purpose processor may further include a storage medium 1703.
[0286] As another possible product form, the terminal device may alternatively be implemented using the following: one or more field-programmable gate arrays (FPGAs), a programmable logic device (PLD), a controller, a state machine, gate logic, a discrete hardware component, any other suitable circuit, or any combination of circuits that can perform various functions described in this application.
[0287] Optionally, an embodiment of this application further provides a computer-readable storage medium. The computer-readable storage medium may include an instruction. When the instruction is run on a computer, the computer is enabled to perform any information processing method performed by the first terminal device in
[0288] Optionally, an embodiment of this application further provides a computer program product including an instruction. When the computer program product is run on a computer, the computer is enabled to perform any information processing method performed by the first terminal device in
[0289] Functions of the computer program product may be implemented using hardware or software. When the functions are implemented using software, the functions may be stored in a computer-readable medium or transmitted as one or more instructions or code in the computer-readable storage medium.
[0290] The terminal device, the computer-readable storage medium, and the computer program product in the embodiments of this application may perform any information transmission method performed by the first terminal device in
[0291] An embodiment of this application may further provide a terminal device. The terminal device may be used as a second terminal device, and has any function of the second terminal device in any method in
[0292] It should be understood that the terminal device 1800 has any function of the second terminal device in any method in
[0293] The terminal device provided in the foregoing embodiment of this application may be implemented in a plurality of product forms. For example, the terminal device may be configured as a general-purpose processing system. For example, the terminal device may be implemented using a general bus architecture. For example, the terminal device may be implemented by an ASIC. The following provides several possible product forms of the terminal device in the embodiments of this application. It should be understood that the following is merely an example, and the possible product forms in the embodiments of this application are not limited thereto.
[0294]
[0295] As a possible product form, the terminal device may be implemented by a device, and the terminal device includes a processor 1902 and a transceiver 1904. Optionally, the terminal device may further include a storage medium 1903.
[0296] As another possible product form, the terminal device is also implemented using a general-purpose processor, that is, implemented using a commonly known chip. The general-purpose processor includes a processor 1902 and a transceiver interface 1905/transceiver pin 1906. Optionally, the general-purpose processor may further include a storage medium 1903.
[0297] As another possible product form, the terminal device may alternatively be implemented using the following: one or more FPGAs, a PLD, a controller, a state machine, gate logic, a discrete hardware component, any other suitable circuit, or any combination of circuits that can perform various functions described in this application.
[0298] Optionally, an embodiment of this application further provides a computer-readable storage medium. The computer-readable storage medium may include an instruction. When the instruction is run on a computer, the computer is enabled to perform any information processing method performed by the second terminal device in
[0299] Optionally, an embodiment of this application further provides a computer program product including an instruction. When the computer program product is run on a computer, the computer is enabled to perform any information processing method performed by the second terminal device in
[0300] Functions of the computer program product may be implemented using hardware or software. When the functions are implemented using software, the functions may be stored in a computer-readable medium or transmitted as one or more instructions or code in the computer-readable storage medium.
[0301] The terminal device, the computer-readable storage medium, and the computer program product in the embodiments of this application may perform any information transmission method performed by the second terminal device in
[0302] An embodiment of this application may further provide a network system. The network system may include a first terminal device, a server, and at least one second terminal device. The first terminal device is connected to the server, and the server is further connected to each second terminal device. The first terminal device may be the terminal device in any one of
[0303] The network system may be a cloud storage system. The system may implement the information processing method in any one of the foregoing embodiments. For a specific implementation process and beneficial effects of the system, refer to the foregoing descriptions. Details are not described herein again.
[0304] It should be understood that the term “and/or” in this specification describes only an association relationship for describing associated objects and represents that three relationships may exist. For example, A and/or B may represent the following three cases: only A exists, both A and B exist, and only B exists. In addition, the character “/” in this specification usually indicates an “or” relationship between the associated objects.
[0305] It should be understood that in the embodiments of this application, “B corresponding to A” indicates that B is associated with A, and that B may be determined based on A. However, it should further be understood that determining B based on A does not mean that B is determined based on only A. B may alternatively be determined based on A and/or other information.
[0306] In this application, “at least one” means one or more, and “a plurality of” means two or more. The term “and/or” describes an association relationship between associated objects and may indicate three relationships. For example, A and/or B may indicate the following cases: only A exists, both A and B exist, and only B exists, where A and B may be singular or plural. The character “I” generally indicates an “or” relationship between the associated objects. “At least one of the following items (pieces)” or a similar expression means any combination of the items, including any combination of singular items (pieces) or plural items (pieces). For example, at least one item (piece) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c may be singular or plural.
[0307] A person of ordinary skill in the art may be aware that, in combination with the examples described in the embodiments disclosed in this specification, units and algorithm steps may be implemented by electronic hardware, computer software, or a combination thereof. To clearly describe interchangeability between the hardware and the software, the foregoing has generally described compositions and steps of each example based on functions. Whether the functions are performed by hardware or software depends on particular applications and design constraint conditions of the technical solutions. A person skilled in the art may use a different method to implement the described function for each particular application, but it should not be considered that the implementation goes beyond the scope of this application.
[0308] It may be clearly understood by a person skilled in the art that, for convenience and brevity of description, for a specific working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiments. Details are not described herein again.
[0309] In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely an example. For example, division into units is merely logical function division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings, the direct couplings, or the communication connections may be implemented through some interfaces, and indirect couplings or communication connections between the apparatuses or the units may be connections in an electrical form, a mechanical form, or another form.
[0310] The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, to be specific, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions of the embodiments in this application.
[0311] In addition, functional units in the embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software functional unit.
[0312] With descriptions of the foregoing implementations, a person skilled in the art may clearly understand that this application may be implemented by hardware, firmware, or a combination thereof. When the embodiments of this application are implemented by software, the foregoing functions may be stored in a computer-readable medium or transmitted as one or more instructions or code in the computer-readable medium. The computer-readable medium includes a computer storage medium and a communications medium, and the communications medium includes any medium that enables a computer program to be transmitted from one place to another. The storage medium may be any available medium accessible to a computer. The following provides an example but does not impose a limitation. The computer-readable medium may include a RAM, a ROM, an electrically erasable programmable ROM (EEPROM), a compact disc ROM (CD-ROM), another compact disc storage or magnetic disk storage medium or another magnetic storage device, or any other medium that can carry or store expected program code in a form of an instruction or a data structure and can be accessed by a computer. In addition, any connection may be appropriately defined as a computer-readable medium. For example, if software is transmitted from a website, a server, or another remote source through a coaxial cable, an optical fiber/cable, a twisted pair, a digital subscriber line (DSL) or wireless technologies such as infrared ray, radio, and microwave, the coaxial cable, optical fiber/cable, twisted pair, DSL, or the wireless technologies such as infrared ray, radio, and microwave are included in fixation of a medium to which they belong. A disk and a disc used in this application include a compact disc (CD), a laser disc, an optical disc, a digital versatile disc (DVD), a floppy disk, and a BLU-RAY DISC. The disk usually copies data in a magnetic manner, but the disc copies data optically through a laser. The foregoing combination should also be included in the protection scope of the computer-readable medium.
[0313] The foregoing descriptions are merely specific implementations of the embodiments of this application, but are not intended to limit the protection scope of the embodiments of this application. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in the present disclosure shall fall within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application shall be subject to the protection scope of the claims.