A fine-grained access control method for IoT data sharing based on blockchain.
By employing a blockchain-based fine-grained access control method for data sharing, the issues of data security and privacy protection in IoT data sharing are addressed. This enables secure sharing between data owners and users, as well as the identification of malicious users, ensuring data security and traceability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies have shortcomings in data security and privacy protection in IoT data sharing, especially in the lack of effective access control schemes for tracking malicious users.
A fine-grained access control method for data sharing based on blockchain is adopted. By constructing a data access model, using an initialization algorithm to generate public parameters and master keys, performing identity authentication and key generation, using symmetric key encryption and hash value to upload data, formulating access policies and sales rules, and generating permission tokens through the blockchain for data sharing and decryption, and combining key tracking algorithms to identify malicious users.
It enables privacy protection and secure information sharing between data owners and users, tracks and prevents unauthorized use by malicious users, encourages data sharing and provides rewards, and ensures data security and traceability.
Smart Images

Figure CN116599706B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet of Things (IoT) access control technology, specifically a blockchain-based fine-grained access control method for IoT data sharing. Background Technology
[0002] The Internet of Things (IoT) technology is closely related to our lives, and it has been widely applied in a range of fields such as smart homes, healthcare, intelligent transportation, and industrial manufacturing. With the development of 5G networks, this growth trend is becoming increasingly apparent. According to Gartner's prediction, there will be 41.6 billion IoT smart devices globally by 2025. Meanwhile, faster 5G networks mean that the massive amounts of data collected from IoT devices will be analyzed and managed more effectively. Among these, personal health data collected by wearable IoT devices, as personal digital assets, can bring certain benefits to individuals. Society encourages individuals to share this data with various research institutions for basic research, and research institutions using this data should reward individuals. Furthermore, with the rapid development of medical technology, the healthcare industry has undergone a transformation from Healthcare 1.0 to Healthcare 4.0, and the widespread adoption of various wearable devices can collect and transmit a range of real-time personal health data, which helps to save and prolong patients' lives.
[0003] Currently, most organizations or individuals tend to store massive amounts of data with cloud service providers (CSPs) for data sharing in order to reduce costs. However, this approach is based on a high degree of trust in cloud service providers, which exposes outsourced data to serious security and privacy risks. Therefore, data security and privacy protection have become particularly important.
[0004] To address the issues of data confidentiality and integrity, data encryption technology is widely used in the security protection of cloud storage data. For example, encryption based on ciphertext policy attributes is one of the most suitable technologies for access control applications in cloud storage servers. Although scholars have made considerable efforts to combine access control with cryptographic schemes to achieve data confidentiality and user privacy protection, many shortcomings still exist, especially in tracking malicious users. Access control schemes not only need to provide convenient data access permissions for legitimately authorized users, but also need to ensure that malicious users can be identified and tracked.
[0005] Blockchain's unforgeable, traceable, transparent, and collectively maintained characteristics can assist IoT systems in terms of privacy, traceability, and interoperability. Blockchain is a distributed ledger with a chain-like structure, originating from Satoshi Nakamoto's 2008 paper, "Bitcoin: A Peer-to-Peer Electronic Cash System." It utilizes a consensus mechanism to make data forgery on the blockchain difficult, effectively preventing malicious users from tampering with and destroying others' private data. Blockchain technology is widely used in industries including, but not limited to, healthcare, insurance, supply chain, government affairs, digital currency, energy trading, and connected vehicles.
[0006] Based on the above issues, how to achieve traceable, privacy-protecting, data-secure, and fine-grained access control for personal data sharing is a technical problem that needs to be solved. Summary of the Invention
[0007] This invention addresses the needs and shortcomings of current technological development by providing a blockchain-based fine-grained access control method for IoT data sharing, thus solving the problem of how to achieve traceability, protect user privacy, ensure data security, and provide fine-grained access control for personal data sharing.
[0008] The present invention provides a fine-grained access control method for IoT data sharing based on blockchain, and the technical solution adopted to solve the above-mentioned technical problems is as follows:
[0009] A blockchain-based fine-grained access control method for IoT data sharing includes the following steps:
[0010] S1. Construct a data access model based on blockchain, smart wearable devices, cloud servers, and authentication centers. Use an initialization algorithm to initialize the authentication center and obtain public parameters and master keys.
[0011] S2. The user authenticates their identity at the authentication center. After authentication, the user uses a key generation algorithm to calculate the decryption key.
[0012] S3. When a user obtains information collected by a smart wearable device and wants to share the data as the data owner, the user first extracts the information digest, encrypts the information using a symmetric key and uploads it to the cloud server, calculates the hash value of the encrypted information and uploads it to the blockchain, then formulates an access policy, encrypts the symmetric key, and uploads the ciphertext of the symmetric key and the information digest to the blockchain. At the same time, the user formulates sales rules and uploads them to the blockchain smart contract.
[0013] S4. When a user, as a data user, views the information summary on the blockchain, receives the sales rules, and wants to obtain the complete information, the data user sends a purchase request to the blockchain. After the blockchain agrees to the purchase request, it uses a token generation algorithm to generate a permission token. The data user sends the permission token to the cloud server and obtains the corresponding encrypted information from the cloud server. It also obtains the corresponding symmetric key ciphertext from the blockchain. When the data user meets the access policy, the data user uses a decryption algorithm to decrypt the encrypted symmetric key to obtain the plaintext information.
[0014] S5. The authentication center uses a key form checking algorithm to check whether the data user's decryption key is in good form. If the decryption key is in good form, it executes a key tracing algorithm to find the data user's identity information UID and determine whether the data user is a malicious user.
[0015] Optionally, perform step S1 to initialize the authentication center using the initialization algorithm to obtain public parameters and the master key. The specific operations are as follows:
[0016] Define a security parameter λ, where G1 and G2 are cyclic multiplication groups with prime number p, and G... T It is a cyclic multiplicative group of prime number p, where e denotes a mapping e: G1 × G2 = G T H and H1 are two different secure cryptographic hash functions, where H:{0,1} * →Z q H1:G1→Z p U represents the global properties of the universe, and mapping U to Z p In the group; Z p The group is a group of positive integers;
[0017] Randomly select g, w, μ, β, η, P from the G1 group, and then... p Randomly select α and a from the group, then select a probabilistic encryption algorithm (Enc, Dec) with different keys k1 and k2, and select a symmetric encryption / decryption algorithm (Ec) with a symmetric key k. sym D sym ), where k1, k2 ∈ Z p , k∈G2;
[0018] Choose one order polynomial f(x) and Points To store secretly, among which This is used to initialize the Shamir thresholding scheme. The common parameters PP = (G1,G2,q,P,g,μ,β,ω,η,g) are obtained. a ,e(g,g) αThe authentication center stores the master key MSK (α, a, b, k1, k2) and publishes the public parameter PP on the blockchain.
[0019] Optionally, step S2 is executed. First, the user submits their identity information UID and attribute set S to the authentication center for identity authentication. The authentication center uses a probabilistic encryption algorithm (Enc, Dec) to calculate:
[0020] Subsequently, the user selects b1, b2, ..., b using the key generation algorithm. n ∈Z p And calculate the decryption key SK UID,S The specific calculation process is as follows:
[0021] SK UID,S ={K0,K′,K1,K′1,K Γ,1 K Γ,2},Γ∈[n],
[0022] K0 = g α / (a+c) w b ,
[0023] K′=c,
[0024] K1 = g b ,
[0025] K′1=g ab ,
[0026]
[0027]
[0028] Where α, a, b are parameters of the master key MSK, w, g, β are parameters of the common parameters PP, and ATTR Γ These are the corresponding user's attribute parameters, b Γ It is in Z p K0, K′, K1, K′1, K are randomly selected from the given information. Γ,1 K Γ,2 It is the decryption key SK UID,S Components;
[0029] Then, the user randomly selects a number using a key generation algorithm. Calculate public key PK UID :
[0030] PK UID =x l P,
[0031] Where P is a public parameter, and the user's public / private key pair is represented as (x l PK UID ).
[0032] Optionally, step S3 is performed whereby the user obtains the collected information from the smart wearable device, specifically including:
[0033] Users use smart wearable devices, which generate data. The data source is authenticated through the BLS aggregation signature algorithm. At this point, the user, as the data owner, obtains the authenticated data and integrates it into information m.
[0034] Further, optionally, step S3 is performed when the user, as the data owner, wants to share the data.
[0035] (3.1) The data owner extracts the digest of information m and uses a symmetric encryption algorithm (E) with symmetric key k. sym D sym Encrypting information m yields ciphertext CT. m Calculate encrypted CT m hash value M * , ciphertext CT m Upload to the cloud server and send the hash value M * Uploaded to the blockchain;
[0036] (3.2) The data owner formulates the access policy (M,ρ) of the symmetric key k of the encrypted information m. With the public parameter PP, attribute set S, symmetric key k, and access policy (M,ρ) as input, the corresponding ciphertext CT is output using the ciphertext policy attribute base encryption algorithm. The digest of information m and the ciphertext CT are uploaded to the blockchain. At the same time, the data owner formulates the sales rules of information m and uploads them to the smart contract of the blockchain.
[0037] Further optional, in step (3.2), the data owner formulates an access policy (M, ρ) for the symmetric key k, taking the public parameter PP, attribute set S, symmetric key k, and access policy (M, ρ) as inputs, and uses the ciphertext policy attribute base encryption algorithm to output the corresponding ciphertext CT, as follows:
[0038] Suppose there exists an l-row n-column share generation matrix M. For i = 1, 2, ..., l, define a function ρ to label the i-th row of M. The attribute ρ(i) comes from the user's attribute set. In the expression based on the linear secret sharing scheme LSSS, the access policy is defined as (M, ρ).
[0039] Randomly select s, y2, ..., y n ∈Z P To form a secret sharing matrix By calculating the inner product We obtain the sharing vector λ = (λ1, λ2, ..., λ). l ), where M i Represents the i-th row of M;
[0040] The data owner randomly selects an s from the G1 group and encrypts the symmetric key k using formula (1) to obtain C. The calculation result is as follows:
[0041] C = ke(g, g) αs , formula (1),
[0042] Where k is the symmetric key to be encrypted, α is a parameter of the master key MSK, and e(g,g) α C is a parameter of the public parameter PP, and C is a ciphertext containing the symmetric key k.
[0043] The data owner uses formulas (2)-(6) to calculate the encrypted CT.
[0044] CT = (CT1, CT2), Formula (2),
[0045] CT1={C,C0,C'0}, Formula (3)
[0046] C0 = g s C'0=g αs , formula (4),
[0047] CT2={(M,ρ),C i,1 C i,2 C i,3}, formula (5),
[0048]
[0049] Where s is randomly selected and belongs to the G1 group, M is an l×n matrix, and the function ρ maps the attributes to each row of matrix M, C, C0, C'0, C i,1 C i,2 C i,3 It is a component of encrypted CT, t i ∈Z p i∈[1,l] is randomly selected.
[0050] Alternatively, in step S4, the data user obtains the permission token as follows:
[0051] Data users send purchase requests to the blockchain, submitting their identity information (UID) and attribute set (S).
[0052] After receiving a purchase request, the blockchain first checks whether the balance of the data user's account address meets the pricing of the sales rules customized by the data owner. If the balance meets the pricing, the next step is executed; otherwise, the purchase request is rejected.
[0053] Once the blockchain approves the purchase request, it generates a permission token for the data user.
[0054] Token = {spe L M * PK UID ,t s ,t′ s},
[0055] Among them, spe L M represents unique identity information for the token. * Representing encrypted CT m hash value, PK UID The public key representing the user of this data, t s The timestamp representing the token, t′ s Represents the expiration time of the token;
[0056] Using formula Calculate the hash value of the token;
[0057] Data users randomly select a number using a key generation algorithm. Using formula PK UID =x l P computes the public key PK UID Where P is a common parameter PP;
[0058] Use the data user's public key PK UID Remove the encryption permission token to get cl=PK UID (Token), send Send to data users at the same time Give it to the cloud server;
[0059] After a data user obtains the encrypted CT from the blockchain, it determines whether the data user's attribute set S satisfies the access policy (M, ρ). If it does, it calculates the attributes shared in S by the row set in matrix M, i.e., I = {i: ρ(i) ∈ S}. If the attribute set S is the authorized set of the access policy (M, ρ), then... Furthermore, it can satisfy the access structure of access policy (M,ρ), and use the ciphertext policy attribute basis decryption algorithm to make {ω i ∈Z p} i∈I To become a set of constants, such that Where Mi It is the i-th row of matrix M;
[0060] The ciphertext CT is decrypted using the ciphertext policy attribute-based decryption algorithm to obtain the symmetric key k of the encrypted information m. The calculation process is as follows:
[0061]
[0062]
[0063] F = D / E = e(g,g) αs ,
[0064] k = C / F,
[0065] Where D, E, and F are intermediate parameters of the ciphertext policy attribute base decryption algorithm for decrypting ciphertext CT, and C is the ciphertext containing the symmetric key k, where k is the symmetric key of the encrypted information m.
[0066] Using a symmetric decryption algorithm with a symmetric key k (E sym D sym Decrypt the ciphertext CT obtained from the cloud server. m We obtain information m, m = D symk (CT m );
[0067] Verify M * =H(E) symk If the equation (m) is true, the data user accepts information m; otherwise, the user rejects information m.
[0068] Alternatively, in step S4, the data user verifies the correctness of the decrypted ciphertext CT using the following formula:
[0069]
[0070] in, C0, C'0, C i,1 C i,2 C i,3 These are components of a encrypted CT scan: K0, K′, K1, K′1, K Γ,1 K Γ,2 It is the decryption key SK UID,S The components are ρ(i), which maps attributes to each row of matrix M, α, a, b are parameters of the master key MSK, w, η, β are parameters in the public parameters PP, and the attribute set S is the authorization set of the access policy (M, ρ).
[0071] Further, optionally, perform step S5, using the public parameter PP, master key MSK, and decryption key SK. UID,SAs input, the decryption key SK is checked using a key-based verification algorithm. UID,S To check if the key format is intact, the formula for the key format check algorithm is as follows:
[0072] (1) K0,K1,K1',K Γ,1 ,K Γ,2 ∈G1,
[0073] (2)e(K′1,g)=e(K1,g a ),
[0074] (3)e(K,g a g K' )=e(g,g) α e(K′1K1 K' ,w),
[0075] Among them, K0, K′, K1, K′1, K Γ,1 K Γ,2 It is the decryption key SK UID,S The components are w, which belongs to the public parameter PP, and α,a, which are parameters of the master key MSK.
[0076] The decryption key SK is determined if and only if (1), (2), and (3) are all true. UID,S The form is intact.
[0077] Optionally, in step S5, the authentication center executes a key tracing algorithm to find the identity information of the data user and determine whether the data user is a malicious user. The specific process is as follows:
[0078] Key tracking algorithms were first developed by SK. UID,S Obtain the relevant parameter K' from the key, and then use the key to decrypt K' to obtain x||y, where
[0079] Suppose we let x' = x, y' = y, if The key tracing algorithm calculates To obtain the UID of data users in order to identify malicious data users;
[0080] if This key tracing algorithm is combined Given points (x', y'), the Shamir thresholding scheme is recovered using the Lagrange interpolation polynomial formula. Secret Value Then judge the equation. If the equation is true, then calculate... The algorithm obtains the data user's UID to identify malicious data users; otherwise, the key tracing algorithm terminates.
[0081] The present invention provides a fine-grained access control method for IoT data sharing based on blockchain, which has the following advantages compared with the prior art:
[0082] (1) This invention realizes privacy protection among data owners, data users and cloud service providers, realizes secure sharing of data information between data owners and data users, and also realizes tracking of malicious users to prevent illegal use of data;
[0083] (2) This invention is applicable to the privacy protection and fine-grained data sharing of Internet of Things data users, and can encourage the sharing of private data to a certain extent. Users who share personal data should be rewarded.
[0084] (3) In the data access model constructed by the present invention, users can only interact with the cloud server and obtain encrypted information if they have a permission token, and can only decrypt the obtained encrypted information if the access policy is met.
[0085] (4) This invention converts user information into polynomial storage, recovers the identity of malicious users through Lagrange interpolation polynomial, and then tracks malicious users to prevent illegal key sharing and illegal use, making it possible to track malicious users who have leaked their private keys. Attached Figure Description
[0086] Appendix Figure 1 This is a logical schematic diagram of the data access model of the present invention. Detailed Implementation
[0087] To make the technical solution, the technical problem solved, and the technical effect of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with specific embodiments.
[0088] Example 1:
[0089] Combined with appendix Figure 1 This embodiment proposes a fine-grained access control method for IoT data sharing based on blockchain, including the following steps:
[0090] S1. Build a data access model based on blockchain, smart wearable devices, cloud servers, and certification centers;
[0091] The authentication center is initialized using an initialization algorithm to obtain public parameters and the master key. The specific steps are as follows:
[0092] Define a security parameter λ, where G1 and G2 are cyclic multiplication groups with prime number p, and G... T It is a cyclic multiplicative group of prime number p, where e denotes a mapping e: G1 × G2 = G TH and H1 are two different secure cryptographic hash functions, where H:{0,1} * →Z q H1:G1→Z p U represents the global properties of the universe, and mapping U to Z p In the group; Z p The group is a group of positive integers;
[0093] Randomly select g, w, μ, β, η, P from the G1 group, and then... p Randomly select α and a from the group, then select a probabilistic encryption algorithm (Enc, Dec) with different keys k1 and k2, and select a symmetric encryption / decryption algorithm (Ec) with a symmetric key k. sym D sym ), where k1, k2 ∈ Z p , k∈G2;
[0094] Choose one order polynomial f(x) and Points To store secretly, among which This is used to initialize the Shamir thresholding scheme. The common parameters PP = (G1,G2,q,P,g,μ,β,ω,η,g) are obtained. a ,e(g,g) α The authentication center stores the master key MSK (α, a, b, k1, k2) and publishes the public parameter PP on the blockchain.
[0095] S2. The user authenticates their identity at the authentication center. After authentication, the user calculates the decryption key using a key generation algorithm, specifically including:
[0096] First, the user submits their identity information (UID) and attribute set (S) to the authentication center for identity verification. The authentication center uses a probabilistic encryption algorithm (Enc, Dec) to calculate:
[0097] Subsequently, the user selects b1, b2, ..., b using the key generation algorithm. n ∈Z p And calculate the decryption key SK UID,S The specific calculation process is as follows:
[0098] S KUID,S ={K0,K′,K1,K′1,K Γ,1 K Γ,2},Γ∈[n],
[0099] K0 = g α / (a+c) wb ,
[0100] K′=c,
[0101] K1 = g b ,
[0102] K′1=g ab ,
[0103]
[0104]
[0105] Where α, a, b are parameters of the master key MSK, w, g, β are parameters of the common parameters PP, and ATTR Γ These are the corresponding user's attribute parameters, b Γ It is in Z p K0, K′, K1, K′1, K are randomly selected from the given information. Γ,1 K Γ,2 It is the decryption key SK UID,S Components;
[0106] Then, the user randomly selects a number using a key generation algorithm. Calculate public key PK UID :
[0107] PK UID =x l P,
[0108] Where P is a public parameter, and the user's public / private key pair is represented as (x l PK UID ).
[0109] S3. When a user obtains information collected by a smart wearable device and wants to share the data as the data owner, the user first extracts the information digest, encrypts the information using a symmetric key and uploads it to the cloud server, calculates the hash value of the encrypted information and uploads it to the blockchain, then formulates an access policy, encrypts the symmetric key, and uploads the ciphertext of the symmetric key and the information digest to the blockchain. At the same time, the user formulates sales rules and uploads them to the smart contract on the blockchain.
[0110] In this step, the user obtains the data collected by the smart wearable device, specifically including:
[0111] Users use smart wearable devices, which generate data. The data source is authenticated through the BLS aggregation signature algorithm. At this point, the user, as the data owner, obtains the authenticated data and integrates it into information m.
[0112] In this step, when a user, as the data owner, wants to share the data,
[0113] (3.1) The data owner extracts the digest of information m and uses a symmetric encryption algorithm (E) with symmetric key k. sym D sym Encrypting information m yields ciphertext CT. m The formula is as follows:
[0114] CT m =E sym (m),
[0115] Computational encrypted CT m hash value M * The formula is as follows:
[0116] M * =H(CT) m ),
[0117] Where H represents the hash function,
[0118] encrypted CT m Upload to the cloud server and send the hash value M * Uploaded to the blockchain;
[0119] (3.2) The data owner formulates the access policy (M,ρ) of the symmetric key k of the encrypted information m. Taking the public parameter PP, attribute set S, symmetric key k, and access policy (M,ρ) as input, the corresponding ciphertext CT is output using the ciphertext policy attribute base encryption algorithm. The operation is as follows:
[0120] Suppose there exists an l-row n-column share generation matrix M. For i = 1, 2, ..., l, define a function ρ to label the i-th row of M. The attribute ρ(i) comes from the user's attribute set. In the expression based on the linear secret sharing scheme LSSS, the access policy is defined as (M, ρ).
[0121] Randomly select s, y2, ..., y n ∈Z P To form a secret sharing matrix By calculating the inner product We obtain the sharing vector λ = (λ1, λ2, ..., λ). l ), where M i Represents the i-th row of M;
[0122] The data owner randomly selects an s from the G1 group and encrypts the symmetric key k using formula (1) to obtain C. The calculation result is as follows:
[0123] C = ke(g, g) αs , formula (1),
[0124] Where k is the symmetric key to be encrypted, α is a parameter of the master key MSK, and e(g,g) α C is a parameter of the public parameter PP, and C is a ciphertext containing the symmetric key k.
[0125] The data owner uses formulas (2)-(6) to calculate the encrypted CT.
[0126] CT = (CT1, CT2), Formula (2),
[0127] CT1={C,C0,C'0}, Formula (3)
[0128] C0 = g s C'0=g αs , formula (4),
[0129] CT2={(M,ρ),C i,1 C i,2 C i,3}, formula (5),
[0130]
[0131] Where s is randomly selected and belongs to the G1 group, M is an l×n matrix, and the function ρ maps the attributes to each row of matrix M, C, C0, C'0, C i,1 C i,2 C i,3 It is a component of encrypted CT, t i ∈Z p i∈[1,l] is randomly selected;
[0132] The digest and ciphertext CT of information m are uploaded to the blockchain. At the same time, the data owner formulates the sales rules for information m and uploads them to the blockchain's smart contract.
[0133] S4. When a user, as a data user, views the information summary on the blockchain, receives the sales rules, and wants to obtain the complete information, the data user sends a purchase request to the blockchain. After the blockchain agrees to the purchase request, it uses a token generation algorithm to generate a permission token. The data user sends the permission token to the cloud server and obtains the corresponding encrypted information from the cloud server. It also obtains the corresponding symmetric key ciphertext from the blockchain. When the data user meets the access policy, the data user uses a decryption algorithm to decrypt the encrypted symmetric key to obtain the plaintext information.
[0134] In step S4, the specific steps for a data user to obtain a permission token are as follows:
[0135] Data users send purchase requests to the blockchain, submitting their identity information (UID) and attribute set (S).
[0136] After receiving a purchase request, the blockchain first checks whether the balance of the data user's account address meets the pricing of the sales rules customized by the data owner. If the balance meets the pricing, the next step is executed; otherwise, the purchase request is rejected.
[0137] Once the blockchain approves the purchase request, it generates a permission token for the data user.
[0138] Token = {spe L M * PK UID ,t s ,t s '},
[0139] Among them, spe L M represents unique identity information for the token. * Representing encrypted CT m hash value, PK UID The public key representing the user of this data, t s The timestamp representing the token, t s 'Represents the expiration time of the token;
[0140] Using formula Calculate the hash value of the token;
[0141] Data users randomly select a number using a key generation algorithm. Using formula PK UID =x l P computes the public key PK UID Where P is a common parameter PP;
[0142] Use the data user's public key PK UID Remove the encryption permission token to get cl=PK UID (Token), send Send to data users at the same time Give it to the cloud server;
[0143] After a data user obtains the encrypted CT from the blockchain, it determines whether the data user's attribute set S satisfies the access policy (M, ρ). If it does, it calculates the attributes shared in S by the row set in matrix M, i.e., I = {i: ρ(i) ∈ S}. If the attribute set S is the authorized set of the access policy (M, ρ), then... Furthermore, it can satisfy the access structure of access policy (M,ρ), and use the ciphertext policy attribute basis decryption algorithm to make {ω i ∈Z p} i∈I To become a set of constants, such that Where M i It is the i-th row of matrix M;
[0144] The ciphertext CT is decrypted using the ciphertext policy attribute-based decryption algorithm to obtain the symmetric key k of the encrypted information m. The calculation process is as follows:
[0145]
[0146]
[0147] F = D / E = e(g,g) αs ,
[0148] k = C / F,
[0149] Where D, E, and F are intermediate parameters of the ciphertext policy attribute base decryption algorithm for decrypting ciphertext CT, and C is the ciphertext containing the symmetric key k, where k is the symmetric key of the encrypted information m.
[0150] Using a symmetric decryption algorithm with a symmetric key k (E sym D sym Decrypt the ciphertext CT obtained from the cloud server. m We obtain information m, m = D symk (CT m );
[0151] Verify M * =H(E) symk If the equation (m) is true, the data user accepts information m; otherwise, the user rejects information m.
[0152] In step S4, the data user verifies the correctness of decrypting the ciphertext CT using the following formula:
[0153]
[0154] in, C0, C'0, C i,1 C i,2 C i,3 These are components of a encrypted CT scan: K0, K′, K1, K′1, K Γ,1 K Γ,2 It is the decryption key SK UID,S The components are ρ(i), which maps attributes to each row of matrix M, α, a, b are parameters of the master key MSK, w, η, β are parameters in the public parameters PP, and the attribute set S is the authorization set of the access policy (M, ρ).
[0155] S5. The authentication center uses a key form checking algorithm to check whether the data user's decryption key is in good form. If the decryption key is in good form, it executes a key tracing algorithm to find the data user's identity information UID and determine whether the data user is a malicious user.
[0156] Execute step S5 with the public parameter PP, master key MSK, and decryption key SK. UID,S As input, the decryption key SK is checked using a key-based verification algorithm. UID,S To check if the key format is intact, the formula for the key format check algorithm is as follows:
[0157] (1) K0,K1,K′1,K Γ,1 ,K Γ,2 ∈G1,
[0158] (2)e(K′1,g)=e(K1,g a ),
[0159] (3)e(K,g a g K' )=e(g,g) α e(K′1K1 K' ,w),
[0160] Among them, K0, K′, K1, K1′, K Γ,1 K Γ,2 It is the decryption key SK UID,S The components are w, which belongs to the public parameter PP, and α,a, which are parameters of the master key MSK.
[0161] The decryption key SK is determined if and only if (1), (2), and (3) are all true. UID,S If the key is in good form, the key form check algorithm outputs 1; otherwise, it outputs 0.
[0162] When the key form verification algorithm outputs 1, the authentication center executes the key tracing algorithm to find the data user's identity information and determine whether the data user is a malicious user. The specific process is as follows:
[0163] Key tracking algorithms were first developed by SK. UID,S Obtain the relevant parameter K' from the key, and then use the key to decrypt K' to obtain x||y, where
[0164] Suppose we let x' = x, y' = y, if The key tracing algorithm calculates To obtain the UID of data users in order to identify malicious data users;
[0165] if This key tracing algorithm is combined Given points (x', y'), the Shamir thresholding scheme is recovered using the Lagrange interpolation polynomial formula. Secret Value Then judge the equation. If the equation is true, then calculate... Obtain the data user's UID to identify malicious data users; otherwise, the key tracing algorithm terminates and outputs ⊥.
[0166] In summary, the fine-grained access control method for IoT data sharing based on blockchain of the present invention can realize secure data sharing between data owners and data users, track malicious users, prevent illegal use of data, and encourage the sharing of private data to a certain extent.
[0167] The above specific examples illustrate the principles and implementation methods of this invention in detail. These embodiments are merely for the purpose of helping to understand the core technical content of this invention. Any improvements and modifications made to this invention by those skilled in the art without departing from the principles of this invention should fall within the patent protection scope of this invention.
Claims
1.A blockchain-based fine-grained access control method for IoT data sharing, characterized in that, The method comprises the following steps: S1, based on the blockchain, smart wearable device, cloud server and authentication center to build a data access model, using the initialization algorithm to initialize the authentication center, get public parameters, master key, the specific operation is as follows: defining a security parameter , , is a cyclic multiplicative group of prime order p, is a cyclic multiplicative group of prime order p, denotes a mapping, , and are two different secure cryptographic hash functions, where , , denotes a large universe attribute universe, mapping to group; group is a positive integer group; In randomly select , in randomly select , then select one with different secret key and probability encryption algorithm , select a symmetric encryption / decryption algorithm with symmetric key , where, , , ; Select one Polynomial And Points Secret storage, wherein To initialize the Shamir threshold scheme Get public parameters And master key The authentication center stores the master key And publicize the public parameters on the blockchain ; S2, the user authenticates at the authentication center, after completing the authentication, the user uses the key generation algorithm to calculate the decryption key: first, the user submits the identity information UID and the attribute set S to the authentication center for identity authentication, the authentication center uses the probabilistic encryption algorithm The calculation is as follows: ; Subsequently, the user selects and computes the decryption key by using a key generation algorithm, as follows: , , , , , , , , wherein , b is a parameter of the master secret key MSK, , g, is a parameter of the public parameter PP, is an attribute parameter of the corresponding user, is randomly selected in , , , , , , is a component of the decryption key . Then, the user randomly selects a number using a key generation algorithm , calculates the public key PK UID : , wherein P belongs to public parameters, and the user's public-private key pair is denoted as ; S3, the user acquires the collection information of the smart wearable device, and as a data owner who wants to share data, first extracts the information digest, uses the symmetric key to encrypt the information and uploads it to the cloud server, calculates the hash value of the encrypted information and uploads it to the blockchain, then formulates the access strategy, encrypts the symmetric key, uploads the ciphertext of the symmetric key and the information digest to the blockchain, at the same time, formulates the sales rules and uploads them to the smart contract of the blockchain; S4, the user as a data user views the information digest from the blockchain, receives the sales rules and wants to obtain the complete information, the data user sends a purchase request to the blockchain, the blockchain agrees to the purchase request and generates a permission token using a token generation algorithm, the data user sends the permission token to the cloud server and obtains the corresponding encrypted information from the cloud server, and obtains the corresponding symmetric key ciphertext from the blockchain, when the data user satisfies the access strategy, the data user uses the decryption algorithm to decrypt the encrypted symmetric key to obtain the plaintext information; S5, the authentication center uses the key form checking algorithm to check whether the form of the decryption key of the data user is intact, and executes the key tracking algorithm when the decryption key form is intact, finds the identity information UID of the data user, and determines whether the data user is a malicious user. 2.The blockchain-based IoT data sharing fine-grained access control method of claim 1, wherein, Step S3 is executed, the user acquires the collection information of the smart wearable device, which specifically includes: The user uses the smart wearable device, the smart wearable device generates data, and the data source is authenticated through the BLS aggregation signature algorithm, at this time, the user as a data owner acquires the authenticated data and integrates it into information m. 3.The blockchain-based IoT data sharing fine-grained access control method of claim 2, wherein, Step S3 is executed, the user as a data owner wants to share data, (3.1) The data owner extracts the summary of information m, uses the symmetric key as the symmetric encryption algorithm encrypts the information m to get the ciphertext , calculates the hash value of the ciphertext , uploads the ciphertext to the cloud server, and uploads the hash value to the blockchain; (3.2) The data owner formulates the access policy of the symmetric key k of the encrypted information m , the public parameter , the attribute set S, the symmetric key k, and the access policy are input, and the corresponding ciphertext is output using the ciphertext policy attribute-based encryption algorithm , the digest of the information m and the ciphertext are uploaded to the blockchain, at the same time, the data owner formulates the sale rule of the information m and uploads it to the smart contract of the blockchain. 4.The blockchain-based IoT data sharing fine-grained access control method of claim 3, wherein, Perform step (3.2), the data owner formulates the access policy of symmetric key k , with public parameters , attribute set S, symmetric key k, access policy , for input, using the ciphertext policy attribute-based encryption algorithm outputs the corresponding ciphertext , the operation is as follows: Assume that there is a share generation matrix of l rows and n columns , for , define a function Label the i-th row, attribute from the attribute set of the user, in the expression based on the linear secret sharing scheme LSSS, the access policy is defined as ; randomly selected , the secret sharing matrix , by calculating the inner product obtaining the share vector where represents the i-th row of Data owners from Randomly select s from the group, and encrypt the symmetric key k using formula (1) to obtain C. The calculation result is as follows: , Equation (1), wherein k is a symmetric key to be encrypted, is a parameter of the master key MSK, is a parameter of the public parameter PP, C is a ciphertext containing the symmetric key k; The data owner uses the formulas (2)-(6) to calculate the ciphertext , , Equation (2), , Equation (3), , , Equation (4), , Equation (5), , , , Equation (6), where s is randomly chosen and belongs to group, M is an l x n matrix, the function p maps the attributes to each row of the matrix M, C, , , , , is a component of the ciphertext CT, is randomly chosen. 5.The blockchain-based IoT data sharing fine-grained access control method of claim 4, wherein, Step S4 is executed, and the specific operation of the data user acquiring the permission token is as follows: The data user sends a purchase request to the blockchain, and submits the identity information UID and the attribute set S at the same time; After receiving the purchase request, the blockchain first checks whether the balance of the account address of the data user meets the pricing of the sales rules customized by the data owner, if the balance meets the pricing, the next step is executed, otherwise the purchase request is rejected; After the blockchain agrees to the purchase request, a permission token Token is generated for the data user, , wherein, represents identity information unique to the Token, represents a ciphertext of a hash value, represents a public key of the data user, represents a timestamp of the Token, represents an expiration time of the Token; The hash value of the Token is calculated using the formula , The data user uses a key generation algorithm to randomly select a number , calculates the public key PK UID using the formula , where P belongs to the public parameters ; using a public key of the data user decrypting the license token Token, to obtain , and sending to the data user, while sending to the cloud server; Data users obtain encrypted data from the blockchain Next, determine whether the attribute set S of the data user satisfies the access policy. When the condition is met, calculate the matrix. The attributes generated by the row set in S are shared with S, i.e. If attribute set S is an access strategy The set of licenses, namely And can satisfy the access policy The access structure is decrypted using a ciphertext policy attribute-based decryption algorithm. To become a set of constants, such that ,in It is a matrix The i-th row; decrypting the ciphertext using a ciphertext policy attribute-based decryption algorithm to obtain a symmetric key k of the encrypted information m, and the calculation process is as follows: , , , , Where D, E, and F are the ciphertext policy attribute-based decryption algorithms used to decrypt ciphertext. The intermediate parameter C is the ciphertext containing the symmetric key k, where k is the symmetric key for encrypting the information m. The symmetric decryption algorithm is used to decrypt the ciphertext obtained from the cloud server using a symmetric key to obtain the information m. ; Verification holds, the data user accepts the information m, otherwise rejects the information m. 6.The blockchain-based IoT data sharing fine-grained access control method of claim 5, wherein, Step S4 is performed, and the data user verifies the correctness of the decrypted ciphertext using the following formula: , wherein , , , , , is a component of the ciphertext CT, , , , , , is a component of the decryption key , maps attributes to each row of the matrix M, , b is a parameter of the master secret key MSK, , , is a parameter in the public parameter PP, the set of attributes S is an authorized set of access policies , . 7.The blockchain-based IoT data sharing fine-grained access control method of claim 6, wherein, Execute step S5 with the public parameter PP, master key MSK, and decryption key. As input, the decryption key is checked using a key-based verification algorithm. To check if the key format is intact, the formula for the key format check algorithm is as follows: (1) , (2) , (3) , wherein , , , , , is a component of the decryption key , belongs to the public parameters PP, , is a parameter of the master key MSK; The decrypted secret key is determined to be in a form of integrity if and only if (1) (2) (3) are all established. The decrypted secret key is determined to be in a form of integrity if and only if (1) (2) (3) are all established. 8.The blockchain-based IoT data sharing fine-grained access control method of claim 7, wherein, Step S5 is executed, the authentication center executes the key tracking algorithm to find the identity information of the data user, and determines whether the data user is a malicious user, the specific process is as follows: The key trace algorithm first obtains relevant parameters from and then uses the key to decrypt to obtain , where ; Assume that let If The key tracking algorithm calculates To obtain the UID of the data user to identify malicious data users; if This key tracking algorithm is combined with and points The Shamir thresholding scheme is recovered using the Lagrange interpolation polynomial formula. Secret Value Then judge the equation If the equation is true, then calculate... The algorithm obtains the data user's UID to identify malicious data users; otherwise, the key tracing algorithm terminates.
Citation Information
Patent Citations
Fine-grained secure sharing method for data of Internet of Things based on alliance chain
CN114979211A