Disclosure of Invention
Based on the above problems, the application provides a method, a device, a storage medium and a processor for distributing model files, which aim to improve encryption and decryption efficiency under the condition of ensuring the safety of the model files in the distribution process.
The embodiment of the application discloses the following technical scheme:
The first aspect of the present application provides a model file distribution method, which includes:
the key generation center generates key data of the model owner based on the identifier of the model owner, and generates key data of the model user based on the identifier of the model user;
Encrypting an original model file by a model owner based on an encryption element and a main public key to obtain an encrypted model file, generating a re-encryption key based on key data of the model owner and a public key of a model user, and transmitting the encryption element, the re-encryption key and the encrypted model file to a key agent center;
The key agent center generates a re-encryption ciphertext based on the encryption element and the re-encryption key, and sends the re-encryption ciphertext and the encrypted model file to a model user;
And the model user decrypts the encrypted model file based on the key data of the model user, the re-encrypted ciphertext and the main public key to obtain an original model file.
Optionally, the model owner encrypts the original model file based on the encryption element and the master public key to obtain an encrypted model file, generates a re-encryption key based on the key data of the model owner and the public key of the model user, and sends the encryption element, the re-encryption key and the encrypted model file to a key proxy center, including:
the model owner determines an encryption element based on the random number and a public key of the model user;
The model owner calculates an encryption key based on the encryption element and the main public key;
encrypting the original model file by using the encryption key to obtain an encrypted model file;
generating a re-encryption key based on the key data of the model owner and the public key of the model user;
and sending the encryption element, the re-encryption key and the encrypted model file to a key proxy center.
Optionally, the model owner calculates an encryption key based on the encryption element and the master public key, including:
The model owner calculates an encryption key by using bilinear pairing based on the encryption element and a main public key, wherein the main public key is generated by a key generation center based on a BLS12-381 elliptic curve.
Optionally, the key generating center generates key data of the model owner based on the identifier of the model owner, generates key data of the model user based on the identifier of the model user, and includes:
the key generation center respectively maps the identifier of the model owner and the identifier of the model user to the BLS12-381 elliptic curve by using a public hash function based on the identifier of the model owner and the identifier of the model user to obtain a public key of the model owner and a public key of the model user;
generating a private key of the model owner based on the master private key and the public key of the model owner;
generating a private key of the model user based on the master private key and the public key of the model user;
The key data of the model owner comprises a public key of the model owner and a private key of the model owner, the key data of the model user comprises the public key of the model user and the private key of the model user, and the main private key is generated by a key generation center based on a BLS12-381 elliptic curve.
Optionally, the model user decrypts the encrypted model file based on the key data of the model user, the re-encrypted ciphertext and the master public key to obtain an original model file, which includes:
the model user calculates an encryption key based on the key data of the model user, the re-encryption ciphertext and the main public key, and decrypts the encrypted model file based on the encryption key to obtain an original model file.
A second aspect of the present application provides a model file distribution apparatus, comprising:
A key generation module for generating key data of the model owner based on the identifier of the model owner by the key generation center, and generating key data of the model user based on the identifier of the model user;
the encryption module is used for encrypting the original model file based on the encryption element and the main public key to obtain an encrypted model file, generating a re-encryption key based on the key data of the model owner and the public key of the model user, and sending the encryption element, the re-encryption key and the encrypted model file to the key agent center;
The proxy re-encryption module is used for generating a re-encryption ciphertext by the key proxy center based on the encryption element and the re-encryption key and sending the re-encryption ciphertext and the encrypted model file to a model user;
and the decryption module is used for decrypting the encrypted model file by the model user based on the key data of the model user, the re-encrypted ciphertext and the main public key to obtain an original model file.
Optionally, the encryption module is specifically configured to:
the model owner determines an encryption element based on the random number and a public key of the model user;
The model owner calculates an encryption key based on the encryption element and the main public key;
encrypting the original model file by using the encryption key to obtain an encrypted model file;
generating a re-encryption key based on the key data of the model owner and the public key of the model user;
and sending the encryption element, the re-encryption key and the encrypted model file to a key proxy center.
Optionally, the encryption module is specifically configured to:
The model owner calculates an encryption key by using bilinear pairing based on the encryption element and a main public key, wherein the main public key is generated by a key generation center based on a BLS12-381 elliptic curve.
A third aspect of the present application provides a computer readable storage medium having a computer program stored therein, which when executed by a processor, implements a model file distribution method as provided in any of the implementations of the first aspect.
A fourth aspect of the present application provides a processor for running a computer program which when run performs a model file distribution method as provided in any of the implementations of the first aspect.
Compared with the prior art, the application has the following beneficial effects:
According to the model file distribution method provided by the application, the key generation center generates corresponding key data for different users, and a foundation is laid for the whole process. The model owner encrypts the original model file and generates a re-encryption key, so that the confidentiality of the model file is ensured, and the accurate control of the access authority of the model user is realized. The key proxy center performs a proxy re-encryption operation to generate re-encryption ciphertext specific to the user of the given model, and this mechanism ensures that even the key proxy center cannot decrypt the data content alone, thereby further enhancing data security. After receiving the re-encrypted ciphertext, the model user decrypts the re-encrypted ciphertext, and then recovers the encrypted model file, so that only authorized model users can access the content of the model file, and other unauthorized users cannot decrypt or access the data.
In summary, the method for distributing the model file provided by the application ensures the safety of the model file in the distribution process and can flexibly manage the decryption authority of the user through the close coordination of key generation, data encryption, proxy re-encryption and data decryption links. In addition, the method simplifies the key management and distribution flow and greatly improves the efficiency of the encryption and decryption process.
Detailed Description
As described above, the model file serves as a core output, and security during distribution is extremely important. However, the data volume of the model file is large, and in the distribution process of the model file, the encryption and decryption efficiency is low.
In view of the above problems, the inventors have studied and proposed a model file distribution method, a device, a storage medium and a processor, wherein a key generation center generates key data of a model owner based on an identifier of the model owner, generates key data of the model user based on the identifier of the model user, encrypts an original model file based on an encryption element and a master public key to obtain an encrypted model file, generates a re-encryption key based on the key data of the model owner and the public key of the model user, sends the encryption element, the re-encryption key and the encrypted model file to a key proxy center, and generates a re-encryption ciphertext based on the encryption element and the re-encryption key, and sends the re-encryption ciphertext and the encrypted model file to the model user, and the model user decrypts the encrypted model file based on the key data of the model user, the re-encryption ciphertext and the master public key to obtain the original model file.
In order to make the present application better understood by those skilled in the art, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, the figure is a flowchart of a model file distribution method provided in an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
S101, the key generation center generates key data of the model owner based on the identifier of the model owner, and generates key data of the model user based on the identifier of the model user.
Wherein the key data includes a public key and a private key.
The key generation center generates key data corresponding to the identifier of the user (such as a mailbox address) according to the identifier of the user through the user registration, the private key of the user is kept by the user, the public key of the user is public, and meanwhile, the identifier of the registered user is disclosed. This way it is ensured that the system is able to perform key management safely and efficiently.
S102, the model owner encrypts an original model file based on the encryption element and the main public key to obtain an encrypted model file, generates a re-encryption key based on key data of the model owner and a public key of the model user, and sends the encryption element, the re-encryption key and the encrypted model file to a key agent center.
The encryption element is generated based on the random number and a public key of a model user, and the main public key is generated by a key generation center based on a BLS12-381 elliptic curve.
Model owners refer to owners or producers of original model files that have complete control over the model files, including deciding who can access the files and how to securely transmit and distribute the files. The model owner encrypts the original model file and generates a re-encryption key that allows the key proxy center to generate re-encrypted ciphertext based on the re-encryption key so that only the designated model user can decrypt.
BLS12-381 is a specially designed elliptic curve that is mainly used in modern cryptographic protocols, especially those that require efficient bilinear pairing operations. BLS12-381 is designed to provide about 128 bits of security strength while achieving as high efficiency as possible, particularly in terms of finite field arithmetic and pairing computations. A key feature of the curve is that it supports efficient bilinear pairing operations, which is a special function e: G 1×G2→GT, where G 1、G2 corresponds to different sets of points on the curve, and G 1、G2 has the same prime order, G T is the target group, and the result of bilinear pairing is located within this group.
The original model file is encrypted by the model owner, so that even if the encrypted model file is intercepted in the transmission process, an unauthorized third party cannot access the content of the model file, and the direct interaction with the model user is not needed. The re-encryption key is used, the transmission of the model file is indirectly completed through the key proxy center, the security is further enhanced, the access rights can be flexibly managed, and the differentiated access rights management of different users is realized by generating a unique re-encryption key for each authorized model user.
S103, the key agent center generates a re-encryption ciphertext based on the encryption element and the re-encryption key, and sends the re-encryption ciphertext and the encrypted model file to a model user.
The key proxy center is used as an intermediate party and is responsible for re-encryption operation. By using the re-encryption technique, the private key of the model owner does not need to be directly exposed to other parties, including the key proxy center, which reduces the risk of key disclosure and improves the security of the model file during distribution. Moreover, the key agent center cannot decrypt, so that effective sharing of sensitive data such as model files can be promoted on the premise of ensuring data security, and different model users can utilize the resources under the condition of obtaining authorization, thereby being beneficial to cooperation among cross organizations or departments.
S104, the model user decrypts the encrypted model file based on the key data of the model user, the re-encrypted ciphertext and the main public key to obtain an original model file.
A model user refers to a person or system that wishes to obtain and use a model file, which is the ultimate recipient, but requires an authorization and decryption process to access the original model file. The model owner can only decrypt the content that he or she is authorized to access, but cannot access unauthorized files. That is, the model file is always in an encrypted state during the whole distribution process from the time when the model owner encrypts the model file until the model user decrypts the model file, so that the security of data in transmission and storage is ensured.
In one implementation, the model owner may also be converted into a model user.
According to the model file distribution method provided by the embodiment of the application, the key generation center generates corresponding key data for different users, and a foundation is laid for the whole process. The model owner encrypts the original model file and generates a re-encryption key, so that the confidentiality of the model file is ensured, and the accurate control of the access authority of the model user is realized. The key proxy center performs a proxy re-encryption operation to generate re-encryption ciphertext specific to the user of the given model, and this mechanism ensures that even the key proxy center cannot decrypt the data content alone, thereby further enhancing data security. After receiving the re-encrypted ciphertext, the model user decrypts the re-encrypted ciphertext, and then recovers the encrypted model file, so that only authorized model users can access the content of the model file, and other unauthorized users cannot decrypt or access the data.
In summary, the method for distributing the model file according to the embodiment of the present application ensures the security of the model file during the distribution process and can flexibly manage the decryption authority of the user through the close coordination of the links of key generation, data encryption, proxy re-encryption and data decryption. In addition, the method simplifies the key management and distribution flow and greatly improves the efficiency of the encryption and decryption process.
On the basis of the above embodiment, in order to further perfect the model file distribution method, a step of generating a master public key and a master private key by a key generation center based on a BLS12-381 elliptic curve is added, and a case where a model owner is a user a, a model user is a user B, and the user B is authorized by the user a is taken as an example for explanation.
Referring to fig. 2, a flowchart of another model file distribution method according to an embodiment of the present application is shown. As shown in fig. 2, the method comprises the steps of:
s201, the key generation center generates a main public key and a main private key based on the BLS12-381 elliptic curve.
In one implementation, the BLS12-381 elliptic curve supports efficient bilinear pairing, i.e., e: G 1×G2→GT, where G 1、G2 is the elliptic curve group and G 1、G2 has the same prime order and G T is the target group. Assuming that g 1、g2 is an arbitrary solution to the elliptic curve, the bilinear property e (g 1 a,g2 b)=e(g1,g2)ab) is satisfied.
The key generation center is responsible for generating a master public key (Master Public Key, MPK) and a master private key (MASTER SECRET KEY, MSK) of the system, which is maintained by the key generation center, using the MSK to generate a unique private key (SECRET KEY, SK) for each registered user.
S202, the key generation center generates key data of the user A based on the identifier of the user A, and generates key data of the user B based on the identifier of the user B.
In one possible implementation:
the key generation center respectively maps the identifier of the model owner and the identifier of the model user to the BLS12-381 elliptic curve by using a public hash function based on the identifier of the model owner and the identifier of the model user to obtain a public key of the model owner and a public key of the model user;
generating a private key of the model owner based on the master private key and the public key of the model owner;
generating a private key of the model user based on the master private key and the public key of the model user;
The key data of the model owner comprises a public key of the model owner and a private key of the model owner, the key data of the model user comprises the public key of the model user and the private key of the model user, and the main private key is generated by a key generation center based on a BLS12-381 elliptic curve.
When a user registers, the key generation center generates key data corresponding to the identifier of the user according to the identifier (such as a mailbox address) of the user, and the private key of the user is not disclosed. Meanwhile, the identifier of the registered user is disclosed, the identifier of the user is mapped to the BL S12-381 elliptic curve through the disclosed hash function, and a hash (userID) is obtained through calculation. As shown in fig. 3, fig. 3 illustrates, as an example, an interface of a key generation center, where the interface includes an input box of a user identifier (e.g., a mailbox address), an already generated Master Public Key (MPK), and a public key and a private key generated based on different user identifiers, the input box of the user identifier is used to prompt the user to input the user identifier, clicking a button to generate the public key and the private key corresponding to the user identifier, the already generated Master Public Key (MPK) is :1380691592326724594186135960003899382815651270322861796564223736022537818583 3738690941731901751466743117623235748761242938734920612499869064 0171607831011735349601200344259272762851318018659457840264368706 2933147068669610832139956982426041576255374550870270534456610541 1379513697297856815135739392728231442497838893142769609933949672 53460580639524582652822668114901647824109618695779619493790825352950224579353080395541641911023612676124063389561842845401889091,, the public key corresponding to the user identifier testme@1.2 is 21058861401728980663985884447021035405838484814814859811059094034177309945326, the private key corresponding to the user identifier testme@1.2 is 39491687549403370741353463161408421438259309576462671149757004186696432381700, and the public key corresponding to the user identifier testme@3.4 is 10468031010640112368260533098881573021287039179538204331633349877094358648507,testme@3.4 is 46732394198382223760902488200050195240791549827563437233593297174859079749569.
Illustratively, assume that user a's private key and hash (a) are skA and hA, and user B's private key and hash (B) are skB and hB, where ska=msk hash (a), skB =msk hash (B).
In this BLS12-381 elliptic curve and bilinear pairing based design, the user private keys skA and skB are generated from a combination of the master private key MSK and the user-specific hash values hA, hB. Because of the difficulty of the elliptic curve discrete logarithm problem, an attacker cannot reversely deduce the main private key MSK through the known private key and hash value. In addition, the private keys of different users are independent from each other, the master private key MSK is only mastered by the key generation center and cannot be exposed to any user, even if the private key of a certain user is revealed, the security of the private keys or the master private key of other users cannot be affected, and the security of the system is further enhanced. Therefore, the design effectively protects the security of the main private key MSK, so that the system can safely support encryption and decryption operations in a multi-user environment.
S203, the user A encrypts the original model file based on the encryption element and the main public key to obtain an encrypted model file, generates a re-encryption key based on the key data of the user A and the public key of the user B, and sends the encryption element, the re-encryption key and the encrypted model file to a key agent center.
In one possible implementation:
the model owner determines an encryption element based on the random number and a public key of the model user;
The model owner calculates an encryption key based on the encryption element and the main public key;
encrypting the original model file by using the encryption key to obtain an encrypted model file;
generating a re-encryption key based on the key data of the model owner and the public key of the model user;
and sending the encryption element, the re-encryption key and the encrypted model file to a key proxy center.
Wherein, the model owner calculates an encryption key based on the encryption element and the master public key, including:
The model owner calculates an encryption key by using bilinear pairing based on the encryption element and a main public key, wherein the main public key is generated by a key generation center based on a BLS12-381 elliptic curve.
As shown in fig. 4, fig. 4 illustrates an interface for encrypting data by a user, based on the data provided in fig. 3, in this interface, encryption Key (SK) is a private Key, particularly :39491687549403370741353463161408421438259309576462671149757004186696432381700,Master Public Key(MPK) is a primary public Key, particularly :13806915923267245941861359600038993828156512703228617965642237360225378185833738690941731901751466743117623235748761242938734920612…,My Email is a mailbox address input by a model owner, testme@1.2 is exemplified by RECIPIENT EMAIL is exemplified by a mailbox address of a model user required to be input by the model owner, testme@3.4 is exemplified by a button of Text to Encryption required to be input by the model owner, and GENERATE ENCRYPTED Text is clicked to generate encrypted data according to the input information.
As shown in fig. 5, fig. 5 illustrates a generated user encryption result interface diagram taking the content input in fig. 4 as an example. In the encryption result shown in fig. 5, C1 is an encryption element, specifically :131284680358210663716928307803393070795420238784131897976002513571576972 3601042299595600138866159306413963657165088521250500842040997557 52465336334998530123977197024743383206009265265377466726610001393434120701802281550922187759199,Nonce is a random number, specifically 58d 7a8995ba760617e626a1ebda6833, cipert shows the encrypted data, specifically 1C21330ef6f 080af0fe 387abc0C226e426e3a3C2b3f979b8a90b9a763386e3b 23637b 5C, tag is an encryption key, specifically 6e ea838bb 08239736b 8fc223fade5, and rekey is a re-encryption key, specifically 2315571171843757050511905276204492601569001381853636169930738396465256028458, for subsequent re-encryption operations.
Illustratively, when the user A encrypts the original model file, the encryption element g 1, specifically g 1=G1^(random*hB),g2=MPK=G2 ++MSK, is obtained by introducing a random number random.
Where G 1、G2 is the elliptic curve group, hB is a point where the hash value of user B maps to G 1, random is a random number, belonging to the prime-order finite field Fr, MPK is the master public key, and MSK is the master private key.
The encryption key is calculated by using the bilinear pairing e, specifically:
AES(KEY)=GT=e(g1,g2)=e(G1,G2)^(random*hB*MSK)。
The mechanism uses bilinear pairing to encrypt by introducing random numbers, which can ensure different keys generated by each encryption and prevent replay attack.
Based on the key data of the model owner and the public key of the model user, a re-encryption key rekeyA- > B is obtained, and the specific formula is as follows:
rekeyA->B=sk_A^(hB*hB*~hA)=MSK^(hA*hB*hB*~hA)=MSK^(hB*hB)=sk_B^hB。
Wherein hA is the inverse of hA, i.e., hA. HA=1, and MSK is the primary private key.
The re-encryption key functions to enable data that would otherwise be decrypted only by the model owner to be converted into a form that would only be decrypted by the particular model user without exposing the decryption key of the model owner.
S204, the key agent center generates a re-encryption ciphertext based on the encryption element and the re-encryption key, and sends the re-encryption ciphertext and the encrypted model file to the user B.
The key agent center interface shown in fig. 6, C1 is a received encryption element, specifically :1312846803582106637169283078033930707954202387841318979760025135 715769723601042299595600138866159306413963657165088521250500842049,RK_AB is a re-encryption key, specifically 23155711718437570505119052765204492601569001381853636169930738396465256028458, and clicking on the button GENERATE C Prime (C'), and the generated result is a re-encryption ciphertext shown in fig. 7. The re-encrypted ciphertext GENERATED C Prime generated in FIG. 7, specifically :1545059287865236060747234654599979534126045148996391461596117997904637558709127496561198255140807 0948186974593661621832886922637401265134249694118212896320154992 87720706877297520902945685405181430825890289467946722000450280142447005.
The key proxy center performs proxy re-encryption through the encryption element g 1 and the re-encryption key rekeyA- > B to generate a re-encryption ciphertext C1_prime, and the specific formula is as follows:
Wherein c1_prime=g 1 ++ rekeyA- > B, i.e.: c1_prime' =g 1 and (sk_B) hB.
The key agent center performs the agent re-encryption operation to generate re-encryption ciphertext specific to the specified model user, and this mechanism ensures that even the key agent center cannot independently decrypt the data content, thereby further enhancing the security of the model file distribution process. By adopting the mode of re-encrypting by the key proxy center, the private key of the model owner does not need to be directly exposed to any other party, so that the risk of key leakage is reduced, and the key management is more centralized and efficient. Because the re-encryption process can be automatically carried out, the distribution efficiency of the model files is improved, and meanwhile, the safety of each distribution is ensured. In conclusion, the method for re-encrypting by adopting the key proxy center greatly enhances the security and flexibility of data transmission, and simplifies the key management flow.
S205, the user B decrypts the encrypted model file based on the key data of the user B, the re-encrypted ciphertext and the main public key to obtain an original model file.
In one possible implementation:
the model user calculates an encryption key based on the key data of the model user, the re-encryption ciphertext and the main public key, and decrypts the encrypted model file based on the encryption key to obtain an original model file.
The user decrypting data interface diagram shown in fig. 8, wherein MPK is a master public key, particularly :13806915923267245941861359600038993828156512703228617965642237360225378185833738690941731901751466743117623235748761242938734920612…,sk_B is a private key of a model user, particularly 4673239419838222609060908820005019524097154275643723359329717490749569, c' is a heavy encrypted ciphertext, particularly :1545059787652360607473465459997953412604514899639146159611799790463755870912749656119825514080709481869745936616218328869226374012,ID_B is an identifier of the model user, particularly testme@3.4, nonce (hex) is a random number, particularly 58d 7a8995ba760617e626a1ebda6833, and ciphert ext (hex) is encrypted data, particularly 1c21330ef6f8f080 fe 387abc0c226e426e3a3c2b3f979b8a90b9a763386e3beedd23637b 8b 223 b5c, and a decrypting button is clicked to obtain an encrypted key tag (x), particularly eea b082f 79f36 f fcde 223.
Illustratively, when user B calculates the encryption KEY AES (KEY), user B knows to re-encrypt ciphertext c1_prime and master public KEY MPK, using the nature of the bilinear pairing,
E (C1_prime, MPK) =e (G 1^(random*hB*MSK*hB*hB),G2. Sup. MSK)
=e(G1,G2)^(random*hB*MSK)(hB*hB*MSK)。
Since e (G 1,G2)/(range hbmsk) =gt=aes (KEY),
Let ss=sk_b hB e (c1_prime, MPK)/(ss) =e (G 1,G2) =aes (KEY).
In order to recover the encryption KEY AES (KEY), the user B needs to eliminate the influence of ss, supposing that ss is the inverse of ss, eliminating the rest of items through the inverse to obtain the encryption KEY, and decrypting the encrypted model file by using the encryption KEY to obtain the original model file.
According to the model file distribution method provided by the embodiment of the application, the key center generates the main public key, the main private key and the key data of different users, so that a foundation is laid for the whole process. The model owner encrypts the original model file and generates a re-encryption key, so that the confidentiality of the model file is ensured, and the accurate control of the access authority of the model user is realized. The key proxy center performs a proxy re-encryption operation to generate re-encryption ciphertext specific to the user of the given model, and this mechanism ensures that even the key proxy center cannot decrypt the data content alone, thereby further enhancing data security. After receiving the re-encrypted ciphertext, the model user decrypts the re-encrypted ciphertext, and then recovers the encrypted model file, so that only authorized model users can access the content of the model file, and other unauthorized users cannot decrypt or access the data.
Based on the model file distribution method introduced in the foregoing embodiment, correspondingly, the application further provides a model file distribution device. Fig. 9 is a schematic diagram of the structure of the device. As shown in fig. 9, the model file distribution apparatus includes:
A key generation module 901, configured to generate key data of the model owner based on the identifier of the model owner by the key generation center, and generate key data of the model user based on the identifier of the model user.
The encryption module 902 is configured to encrypt an original model file by a model owner based on an encryption element and a master public key, obtain an encrypted model file, generate a re-encryption key based on key data of the model owner and a public key of a model user, and send the encryption element, the re-encryption key and the encrypted model file to a key proxy center.
The proxy re-encryption module 903 is configured to generate a re-encrypted ciphertext by using a key proxy center based on the encryption element and the re-encryption key, and send the re-encrypted ciphertext and the encrypted model file to a model user.
And the decryption module 904 is configured to decrypt the encrypted model file based on the key data of the model user, the re-encrypted ciphertext and the master public key by the model user, to obtain an original model file.
Optionally, the encryption module is specifically configured to:
the model owner determines an encryption element based on the random number and a public key of the model user;
The model owner calculates an encryption key based on the encryption element and the main public key;
encrypting the original model file by using the encryption key to obtain an encrypted model file;
generating a re-encryption key based on the key data of the model owner and the public key of the model user;
and sending the encryption element, the re-encryption key and the encrypted model file to a key proxy center.
Optionally, the encryption module is specifically configured to:
The model owner calculates an encryption key by using bilinear pairing based on the encryption element and a main public key, wherein the main public key is generated by a key generation center based on a BLS12-381 elliptic curve.
Optionally, the key generation module is specifically configured to:
the key generation center respectively maps the identifier of the model owner and the identifier of the model user to the BLS12-381 elliptic curve by using a public hash function based on the identifier of the model owner and the identifier of the model user to obtain a public key of the model owner and a public key of the model user;
generating a private key of the model owner based on the master private key and the public key of the model owner;
generating a private key of the model user based on the master private key and the public key of the model user;
The key data of the model owner comprises a public key of the model owner and a private key of the model owner, the key data of the model user comprises the public key of the model user and the private key of the model user, and the main private key is generated by a key generation center based on a BLS12-381 elliptic curve.
Optionally, the decryption module is specifically configured to:
the model user calculates an encryption key based on the key data of the model user, the re-encryption ciphertext and the main public key, and decrypts the encrypted model file based on the encryption key to obtain an original model file.
In addition, the embodiment of the application also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and when the program is run by a processor, the model file distribution method as introduced in any mode of the method embodiment is realized.
In addition, the embodiment of the application also provides a processor, which is used for running a computer program, and the program runs to execute the model file distribution method introduced by any implementation mode of the embodiment of the method.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment is mainly described in a different point from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. The apparatus embodiments described above are merely illustrative, wherein elements illustrated as separate elements may or may not be physically separate, and elements illustrated as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The foregoing is only one specific embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the technical scope of the present application should be included in the scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.