Internet of Things data access control method and system
By using proxy nodes in IoT devices to send device information and data ciphertext to blockchain and IPFS systems, and using CP-ABE algorithm and IOTA blockchain technology to achieve decentralized access control, the security issues of IoT devices in data access control and the performance bottlenecks of traditional blockchain technology are solved, and efficient and secure data access control is achieved.
Patent Information
- Application Number
- CN202510421253.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-04-07
AI Technical Summary
IoT devices are facing the intensification of traditional security problems in data access control, especially new security risks such as unauthorized access, data tampering and information leakage. In addition, traditional blockchain technology has low throughput and large latency, which cannot meet the needs of the Internet of Things field.
Through an IoT data access control method, the proxy nodes are used to send the device information and data ciphertext of the IoT device to the blockchain and IPFS system for storage and management, and the access token is generated based on the CP-ABE algorithm, and decentralized access control is realized through IOTA blockchain technology.
It realizes fine-grained access control, avoids single point of failure of traditional cloud storage, alleviates the problem of low throughput of blockchain, improves the system throughput and scalability, and is suitable for high-frequency scenarios of the Internet of Things.
Smart Images

Figure CN119922025A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an Internet of Things data access control method and system. Background Art
[0002] With the rapid development of the Internet and sensor technology, the Internet of Things has been widely used in various fields on the basis of connecting things to things and people to things, and the data of the Internet of Things has shown an exponential growth. In the field of the Internet of Things, while facing traditional security issues such as software security, hardware security, and network security, IoT devices are also facing more severe new security risks, such as unauthorized access, data tampering, and information leakage. These issues pose a serious threat to the security and privacy of data in the field of the Internet of Things. Access control is an effective means to achieve controlled data sharing. Therefore, the first issue to ensure data security in the Internet of Things environment is to control access to data to ensure that data is not illegally accessed. In traditional Internet of Things systems, data collected by devices are uploaded to centralized cloud servers for storage and management. The centralized model means that there is a trusted entity that can distribute access rights according to access policies. Once the trusted entity is maliciously attacked, the entire access control system will be out of control, all data information will be exposed, and privacy will be completely invalid, which cannot meet the needs of data security and privacy. Blockchain has begun to be used in the field of the Internet of Things with its advantages of decentralization and immutability. However, traditional blockchain technologies such as the Bitcoin system have disadvantages such as low throughput and large latency, resulting in its availability not meeting the requirements of the Internet of Things field. Summary of the invention
[0003] In order to solve the deficiencies mentioned in the above background technology, the purpose of the present invention is to provide an Internet of Things data access control method and system.
[0004] In a first aspect, the purpose of the present invention can be achieved by the following technical solution: a method for controlling access to data of the Internet of Things, the method comprising the following steps: Obtain the device information of the IoT device, send the device information of the IoT device to the blockchain for identity registration based on the proxy node, encrypt the data obtained by the IoT device to obtain the data ciphertext, send the data ciphertext to the IPFS system based on the proxy node to obtain the hash address, and send the hash address to the blockchain for storage based on the proxy node; An access token is generated based on the access policy preset by the data owner and the decryption key of the data ciphertext. The IoT device uses the preset CP-ABE algorithm based on the proxy node to encrypt the access token and send it to the blockchain for storage. Get the collection attributes of data accessors, and match the collection attributes of data accessors with the access policies preset by the data owner. If the match is consistent, use the private key of the preset CP-ABE algorithm to decrypt the access token of the blockchain to obtain the access rights to the data. Otherwise, the access rights to the data cannot be obtained, and the access event is published based on the access rights to the data.
[0005] In combination with the first aspect, in some implementations of the first aspect, the method further includes: the process of sending the device information of the IoT device to the blockchain for identity registration based on the proxy node includes: IoT device a generates a pair of public and private keys (PK a ,SK a ), and then based on the unique identification ID of IoT device a itself a , Public Key PK a 、Private key SK a , generate a signed certificate Cert a ={ID a ,PK a ,sig(SK a ,(ID a ,PK a ))}, where sig(SK a ,(ID a , PK a )) represents the signature of IoT device a; After connecting to the proxy node, according to the proxy node G net The public key PK net , IoT device a generates a signature certificate Cert a Encrypted using an asymmetric encryption algorithm and sent to proxy node G net Indicate your identity; proxy node G net After receiving the encrypted information sent by IoT device a, it uses its own private key SK net Decrypt the information to get the Cert a ; Proxy Node G net Get the Cert by decrypting a Then, according to the public key PK of IoT device a contained in it a For signature sig(SK a ,(ID a , PK a )) Verify and verify Cert a the legality of Proxy Node G net Generate attribute set ATT for IoT device a a ={att a1 ,atta2 ,… ,att ai ,…,att an}, where att ai (i=1,2,3,…,n) represents the i-th attribute of IoT device a, and the attribute is stored in the form of key-value pairs; the proxy node G net According to the unique identification ID of IoT device a a And the attribute set ATT a The attribute set generates an attribute authentication application Re for IoT device a a_att ; Re a_att ={ID a ,G net ,ATT a ,sig(SK net ,(ID a ,G net ,ATT a ))} Proxy Node G ne Apply for attribute authentication a_att The private key is sent to the trusted authority TA in the CP-ABE algorithm system, which verifies the legitimacy of the attribute set. After verifying the legitimacy of the attribute set, TA signs the attribute set and generates an attribute certificate Cert. a_att ; Cert a_att ={ID a ,ATT a ,sig(SK TA ,(ID a ,ATT a ))} The trusted authority TA will send the attribute certificate Cert a_att Send to proxy node G net Represents the attribute set ATT of IoT device a a The authentication indicates that the attributes of IoT device a have passed the legitimacy check; Proxy Node G net In the Tangle of the access control chain, check whether IoT device a has been registered. If not, proxy node G net First use your own private key SK net Yes (ID a ,G net ,PK net ) to sign and generate signature sig(SK net ,(ID a ,G net ,PK net )); then the signature sig(SK net,(ID a ,G net ,PK net )), ID of IoT device a a , proxy node G net The public key PK net , the attribute set ATT of IoT device a a And attribute certificate Cert a_att Assemble into identity registration transaction T reg ; T reg ={ID a , G net , PK net , sig(SK net ,(ID a ,G net ,PK net )),ATT a ,Cert a_att}; Proxy Node G net Run the Markov chain Monte Carlo random walk algorithm MCMC used in the IOTA system to register transaction T in the access control chain reg Select two parent transactions that need to be confirmed; after the parent transaction is checked and passed, the proxy node G net The identity of IoT device a is registered in transaction T by referencing these two parent transactions. reg Add to the Tangle of the access control chain, and broadcast the identity registration transaction T in the blockchain network of the access control chain reg To inform other nodes, so that transaction T reg Get confirmation.
[0006] In combination with the first aspect, in some implementations of the first aspect, the method further includes: the process of sending the data ciphertext to the IPFS system for storage based on the proxy node: After IoT device a collects data, the data is recorded as R a , use the SHA256 algorithm to calculate the data R a The hash value of the SHA256 algorithm is obtained by taking the first 128 bits of the output result of the SHA256 algorithm as the key K, and taking the last 128 bits of the output result of the SHA256 algorithm as the hash fragment seHash. The AES128 symmetric encryption algorithm is used to encrypt the key K and the data R. a The ciphertext eData is obtained as input, and then the IoT device a sends the data message MSG to the proxy node; MSG={eData,seHash,ID a ,descD,timestamp,PK a ,sign} Where: ID a Indicates the identity of IoT device a, which is the sender of data; descD indicates the data R a timestamp indicates the timestamp of sending; sign=sig(SK a ,(eData,seHash, ID a ,descD,timestamp,PK a )), represents the IoT device a’s access to data R a Signature.
[0007] Proxy Node G net Received data message MSG={eData,seHash,ID a ,descD,timestamp,PK a ,sign}, according to the public key PK of IoT device a a Verify the signature sign. After verification, the data R a The ciphertext eData is uploaded to the IPFS storage system, and IPFS returns the hash address IPFS_Hash that identifies the ciphertext eData. net Use the public key PK of IoT device a a Encrypt IPFS_Hash and send it to IoT device a. After receiving the ciphertext, IoT device a uses its own private key SK a Decrypt the ciphertext to get IPFS_Hash and save IPFS_Hash locally for access token construction; The proxy node device converts the data message MSG into a standardized json format and assembles it into a data storage T stor ={IPFS_Hash, seHash, ID a ,descD,timestamp,PK a ,sign}, proxy node G net Run the Markov chain Monte Carlo random walk algorithm MCMC used in the IOTA system, and store data in the data storage chain for data storage transactions T stor Select two parent transactions that need to be confirmed and store the data in transaction T by referencing these two parent transactions. stor Add to the data storage chain's ledger Tangle.
[0008] In combination with the first aspect, in some implementations of the first aspect, the method further includes: the process of generating an access token based on the access policy preset by the data owner and the decryption key of the data ciphertext is as follows: Initialize the CP-ABE algorithm system, and the trusted authority TA generates the system's master key MK and public key PK; Using the Boolean formula strategy in the CP-ABE algorithm, the data R of IoT device a a Determine the access control policy that needs to be embedded in the ciphertext Policy = A1∧A2∧A3∧⋯∧A n , where A i With ATT={att 1, att 2,····, att i,····, att n} in att i One-to-one correspondence, where i=1,2,3, ···· ,n, represents that only when the attribute set of the data accessor satisfies the policy Policy, the data R of IoT device a is allowed to be accessed a ; IoT device a constructs access token Token={sig(SK a ,ID a ), Policy, IPFS_Hash, K}, where sig(SK a ,ID a ) indicates that IoT device a uses its own private key to identify the unique identifier ID of IoT device a a Signature; IPFS_Hash represents data R a The unique identifier of data R a The hash address of the ciphertext in the IPFS system; K represents the address used to decrypt the data R a The key of the ciphertext eData; IoT device a sends the constructed access token Token to the proxy node. The proxy node encrypts the access token Token according to the access control policy Policy set in the Token using the public key PK of the CP-ABE algorithm to obtain enToken. enToken is decrypted by the CP-ABE private key of the data user who complies with the Policy. The proxy node then uses the unique identifier ID of IoT device a to decrypt the access token Token. a , encrypted access token enToken, data R a IPFS_Hash and its own information G net Generate access policy and publish transaction T pol ={ID a ,enToken, G net , IPFS_Hash,sig(ID a ,enToken, G net )}; Proxy Node G net Run the Markov Chain Monte Carlo random walk algorithm MCMC used in the IOTA system and publish transaction T for the access policy in the access control chain pol Select two parent transactions that need to be confirmed; after the parent transaction is checked and passed, the proxy node G net The access policy is published by referencing two parent transactions T pol Add to the access control chain's ledger Tangle.
[0009] In combination with the first aspect, in some implementations of the first aspect, the method further includes: matching the set attribute based on the data accessor with the access policy preset by the data owner, and if the match is consistent, using the private key of the preset CP-ABE algorithm to decrypt the access token of the blockchain to obtain the access rights of the data: Data user B receives data storage transaction T from the data storage chain stor ={IPFS_Hash,seHash, ID a ,descD,timestamp,PK a ,sign} to obtain the data R of IoT device a a After obtaining the unique identifier IPFS_hash, find the storage data R in the access control chain according to the unique identifier IPFS_hash a Transaction T of encrypted access token enToken pol ={ID a ,enToken, G net , IPFS_Hash,sig(ID a ,enToken, G net )}, get enToken; Data user B obtains its own attribute certificate Cert from the access control chain based on its registration information B_att ={ID B ,ATT B ,sig(SK TA ,(ID B ,ATT B ))}, and Cert B_att Send to the trusted authority TA to request TA to distribute the private key; After receiving the request, the trusted institution TA verifies the Cert B_att ={ID B ,ATT B ,sig(SK TA ,(ID B ,ATT B ))} is legal. After verification, according to the attribute set ATTB The master key MK generates a private key CP-ABESK corresponding to the attributes of data user B. B , the trusted institution TA will CP-ABESK B Sent to data user B; Data user B obtains the private key CP-ABESK B After that, the encrypted access token enToken is decrypted to obtain the plain text of the access token Token, Token={sig(SK a ,ID a ),Policy,IPFS_Hash,K}; Data user B downloads data R from the IPFS system according to IPFS_Hash a The ciphertext eData is decrypted using the symmetric key K to obtain the data plaintext R a , and then use the SHA256 algorithm to calculate the data R a The hash value of the SHA256 algorithm is converted into the last 128 bits of the result and the data storage transaction T stor ={IPFS_Hash, seHash, IDa,descD,timestamp, PKa,sign}, if they are consistent, it means that the data has not been tampered with, and data user B obtains data R a access rights.
[0010] In combination with the first aspect, in some implementations of the first aspect, the method further includes: a process of publishing an access event based on the access rights of the data: Based on the access rights of the data, a zero-knowledge proof of access rights is generated and the access log is constructed and published on the blockchain to realize the publication of access events.
[0011] In combination with the first aspect, in some implementations of the first aspect, the method further includes: a process of generating the zero-knowledge proof: Data user B constructs two parameter groups: Public parameter group Public Inputs = {SHA256 (Policy), IPFS_Hash, nonce}, where SHA256 (Policy) represents the hash of the access policy Policy and nonce represents a random number; Private parameter group Private Inputs = {CP-ABESK B ,ATT B ,K,SHA246(R a )}, where SHA256(R a ) represents data R a The hash value of 4 verification logics: data user B’s private key CP-ABESK B The corresponding attributes satisfy the access policy; use CP-ABESK B After decrypting the encrypted access token enToken, the correct key K is obtained; K can decrypt the data corresponding to IPFS_Hash, and the result is complete; the proof process is not replayed, and the data user B encodes the verification logic into an arithmetic circuit with 4 parameters, which are the public parameter group Public Inputs and the private parameter group Private Inputs; Data user B inputs secret data: user attribute set ATT B 、Private key CP-ABESK B , key K, data R a Hash value SHA256(R a ) and input public data: access policy hash value SHA256 (Policy), data R a The unique data identifier IPFS_Hash and random number nonce are compiled and run the arithmetic circuit to obtain the zero-knowledge proof zkp_proof; Access event publishing: Data users assemble access event transactions T based on the public parameter group Public Inputs = {SHA256 (Policy), IPFS_Hash, nonce} and ZKP zero-knowledge proof zkp_proof acclog ={ID B ,access,IPFS_Hash,timestamp,SHA256(Policy),nonce,zkp_proof}, where access indicates that the purpose of this transaction is to access the record of the event. Data user B runs the Markov chain Monte Carlo random walk algorithm MCMC, selects two parent transactions that need to be confirmed, and after the parent transactions are checked, access log transaction T by referencing these two parent transactions. acclog Added to the account book Tangle, indicating data R a Access request was made and access was successfully granted.
[0012] In a second aspect, in order to achieve the above-mentioned object, the present invention discloses an Internet of Things data access control system, comprising: The encryption storage module is used to obtain the device information of the IoT device, send the device information of the IoT device to the blockchain for identity registration based on the proxy node, encrypt the data obtained by the IoT device to obtain the data ciphertext, send the data ciphertext to the IPFS system based on the proxy node to obtain the hash address, and send the hash address to the blockchain for storage based on the proxy node; The token generation module is used to generate an access token based on the access policy preset by the data owner and the decryption key of the data ciphertext. The IoT device uses the preset CP-ABE algorithm based on the proxy node to encrypt the access token and send it to the blockchain for storage; The access control module is used to obtain the collection attributes of data accessors, and match the collection attributes of data accessors with the access policies preset by the data owner. If the match is consistent, the private key of the preset CP-ABE algorithm is used to decrypt the access token of the blockchain to obtain the access rights to the data. Otherwise, the access rights to the data cannot be obtained, and the access event is published based on the access rights to the data.
[0013] In another aspect of the present invention, in order to achieve the above-mentioned purpose, a terminal device is disclosed, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the memory stores a computer program capable of running on the processor, and when the processor loads and executes the computer program, an Internet of Things data access control method as described above is adopted.
[0014] In another aspect of the present invention, in order to achieve the above-mentioned purpose, a computer-readable storage medium is disclosed, in which a computer program is stored. When the computer program is loaded and executed by a processor, an Internet of Things data access control method as described above is adopted.
[0015] Beneficial effects of the present invention: The invention realizes fine-grained access control based on the attribute-based encryption algorithm; uses IPFS technology to store ciphertext of data, which solves the single point failure that may be caused by traditional cloud storage; uses IOTA blockchain technology, and the ledger of IOTA blockchain adopts a directed acyclic graph structure, which alleviates the low throughput and scalability problems of traditional blockchain; dual-chain design, one chain is used for access control, storing identity registration information and the hash address of the data encrypted by the CP-ABE algorithm in the IPFS system. The dual-chain design avoids single-chain resource competition and ensures the improvement of system throughput. At the same time, the dual-chain design ensures that the writing of access policies will not block data writing, which is suitable for high-frequency scenarios of the Internet of Things. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative work. Figure 1 It is a schematic flow chart of the method of the present invention; Figure 2It is a schematic diagram of the technical framework flow of the present invention; Figure 3 It is a performance index diagram of the present invention with the participation of a single node; Figure 4 It is a performance indicator diagram of the present invention with the participation of multiple nodes; Figure 5 This is a performance result diagram of the present invention when facing a double-spending attack; Figure 6 This is a performance diagram of the present invention when facing a node asynchronous attack; Figure 7 It is a schematic diagram of the system structure of the present invention. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] Embodiment 1: like Figure 1 As shown, a method for controlling access to IoT data includes the following steps: S101: Obtain device information of the IoT device, send the device information of the IoT device to the blockchain for identity registration based on the proxy node, encrypt the data obtained by the IoT device to obtain data ciphertext, send the data ciphertext to the IPFS system based on the proxy node to obtain a hash address, and send the hash address to the blockchain for storage based on the proxy node; Specifically, the identity registration process: IoT device a generates a pair of public and private keys (PK a ,SK a ), and then based on the unique identification ID of IoT device a itself a , Public Key PK a 、Private key SK a , generate a signed certificate Cert a ={ID a ,PK a ,sig(SK a ,(ID a ,PK a ))}, where sig(SK a ,(ID a , PK a )) represents the signature of IoT device a.
[0019] After connecting to the proxy node, according to the public key PK of the proxy node net , IoT device a generates a signature certificate Cert a Encrypt using an asymmetric encryption algorithm and send it to the proxy node G net Indicate your identity. Proxy node G net After receiving the encrypted information sent by IoT device a, it uses its own private key SK net Decrypt the information to get the Cert a .
[0020] The proxy node obtains the Cert by decryption a Then, according to the public key PK of IoT device a contained in it a For signature sig(SK a ,(ID a , PK a )) Verify, verify Cert a the legitimacy of.
[0021] Proxy Node G net Generate attribute set ATT for IoT device a a ={att a1 ,att a2 ,… ,att ai ,…,att an}, where att ai (i=1,2,3,…,n) represents the i-th attribute of IoT device a, and the attributes are stored in the form of key-value pairs. net According to the unique identification ID of IoT device a a And the attribute set ATT a The attribute set generates the attribute application Re a_att .
[0022] Re a_att ={ID a ,G net ,ATT a ,sig(SK net ,(ID a ,G net ,ATT a ))} Where sig(SK net ,(ID a ,G net ,ATT a )) represents the proxy node G net A signature generated using your own private key.
[0023] Proxy Node G net Apply the attribute to Rea_att The attribute set is sent to the trusted authority TA of the CP-ABE algorithm, which verifies the legitimacy of the attribute set. After verifying the legitimacy of the attribute set, TA signs the attribute set and generates an attribute certificate Cert. a_att .
[0024] Cert a_att ={ID a ,ATT a ,sig(SK TA ,(ID a ,ATT a ))} Where sig(SK TA ,(ID a ,ATT a )) represents the signature of the attribute set of IoT device a by the trusted authority TA using its own private key.
[0025] The trusted authority TA will send the attribute certificate Cert a_att Send to proxy node G net Represents the attribute set ATT of IoT device a a certification.
[0026] Proxy Node G net In the Tangle of the access control chain, check whether IoT device a has been registered. If not, proxy node G net First use your own private key SK net Yes (ID a ,G net ,PK net ) to sign and generate signature sig(SK net ,(ID a ,G net ,PK net )). Then the signature is used to identify the ID of IoT device a. a , proxy node G net The public key PK net , the attribute set ATT of IoT device a a And attribute certificate Cert a_att Assemble into an identity registration transaction T reg .
[0027] T reg ={ID a , G net , PK net , sig(SK net ,(ID a ,G net ,PK net )),ATT a,Cert a_att}.
[0028] Proxy Node G net Run the Markov Chain Monte Carlo random walk algorithm (MCMC) used in the IOTA system to register transaction T in the access control chain reg Select two parent transactions that need to be confirmed. After the parent transaction is checked, the proxy node G net The identity of IoT device a is registered in transaction T by referencing these two parent transactions. reg Add to the access control chain's ledger Tangle.
[0029] Data Storage: IoT device a collects data (denoted as R a ) and then use the SHA256 algorithm to calculate the data R a The hash value of the data R is obtained by taking the first 128 bits of the SHA256 algorithm output as the key K and the last 128 bits of the SHA256 algorithm output as the hash fragment seHash. seHash is used to a The integrity of the data is verified. Then the AES128 symmetric encryption algorithm is used to encrypt the data with the key K and the data R a The ciphertext eData is obtained as input. Then, the IoT device a sends the data message MSG to the proxy node; MSG={eData,seHash,ID a ,descD,timestamp,PK a ,sign} Where: ID a Indicates the identity of IoT device a, which is the sender of data; descD indicates data R a The label briefly describes the type and content of the data; timestamp indicates the timestamp of sending; sign=sig(SK a ,(eData,seHash, ID a ,descD,timestamp,PK a )), represents the IoT device a’s access to data R a Signature.
[0030] Proxy Node G net Received data message MSG={eData,seHash,ID a ,descD,timestamp,PK a ,sign}, according to the public key PK of IoT device a a Verify the signature sign. After verification, the data R aThe ciphertext eData is uploaded to the IPFS storage system, and IPFS returns a hash address IPFS_Hash that identifies the ciphertext eData. The proxy node uses the public key PK of IoT device a a The IPFS_Hash is encrypted and sent to IoT device a. IoT device a saves the IPFS_Hash locally for subsequent access token construction.
[0031] The proxy node device converts the data message MSG into a standardized json format and assembles it into a data storage T stor ={IPFS_Hash,seHash,ID a ,descD,timestamp,PK a ,sign}. Agent node G net Run the Markov Chain Monte Carlo random walk algorithm (MCMC) used in the IOTA system to store data in the data storage chain for data storage transactions T stor Select two parent transactions that need to be confirmed. Store the data in transaction T by referencing these two parent transactions. stor Add to the data storage chain's ledger Tangle.
[0032] S102: Generate an access token based on the access policy preset by the data owner and the decryption key of the data ciphertext. The IoT device encrypts the access token using the preset CP-ABE algorithm based on the proxy node and sends it to the blockchain for storage. The process of generating an access token based on the preset access policy and the decryption key of the data ciphertext is as follows: The CP-ABE algorithm is initialized, and the trusted authority TA generates the system's master key MK and public key PK.
[0033] Strategy using Boolean formulas. IoT device a data R a Determine the access control policy that needs to be embedded in the ciphertext Policy = A1∧A2∧A3∧⋯∧A n , where A i (i=1,2,3, ···· ,n) and ATT={att 1, att 2,····, att i,····, att n} in att i (i=1,2,3, ···· ,n) one-to-one correspondence. This means that only when the attribute set of the data accessor satisfies the policy Policy, can the data R of IoT device a be accessed. a .
[0034] IoT device a constructs access token Token={sig(SK a ,ID a ), Policy, IPFS_Hash, K}. Among them, sig(SK a ,ID a ) indicates that IoT device a uses its own private key to identify the unique identifier ID of IoT device a a Signature to prevent tampering and denial; IPFS_Hash represents data R a The unique identifier of data R a The hash address of the ciphertext in the IPFS system; K represents the address used to decrypt the data R a The key of the ciphertext eData.
[0035] IoT device a sends the constructed access token Token to the proxy node. Then, the proxy node uses the CP-ABE algorithm to encrypt the access token Token to obtain enToken according to the access control policy Policy set in Token. enToken can only be decrypted by the CP-ABE private key of the data user who complies with the Policy. Then the proxy node uses the unique identifier ID of IoT device a to obtain the access token Token. a , encrypted access token enToken, data R a IPFS_Hash and its own information G net Generate an access policy to publish transaction T pol ={ID a ,enToken, G net , IPFS_Hash,sig(ID a ,enToken, G net )}.
[0036] Proxy Node G net Run the Markov Chain Monte Carlo random walk algorithm (MCMC) used in the IOTA system to publish transaction T for the access policy in the access control chain pol Select two parent transactions that need to be confirmed. After the parent transaction is checked, the proxy node G net The access policy is published by referencing these two parent transactions T pol Add to the access control chain's ledger Tangle.
[0037] S103: Obtain the collection attributes of the data accessors, and match the collection attributes of the data accessors with the access policies preset by the data owner. If the match is consistent, use the private key of the preset CP-ABE algorithm to decrypt the access token of the blockchain to obtain the access rights to the data. Otherwise, the access rights to the data cannot be obtained, and the access event is published based on the access rights to the data.
[0038] The process of matching the collection attributes of the data accessor with the access policy preset by the data owner. If the match is consistent, the private key of the preset CP-ABE algorithm is used to decrypt the access token of the blockchain to obtain the access rights of the data: Data user B receives data storage transaction T from the data storage chain stor ={IPFS_Hash,seHash, ID a ,descD,timestamp,PK a ,sign} to obtain the data R of IoT device a a After obtaining the unique identifier IPFS_hash, find the storage data R in the access control chain according to the unique identifier IPFS_hash a Transaction T of encrypted access token enToken pol ={ID a ,enToken, G net , IPFS_Hash,sig(ID a ,enToken, G net )}, get enToken.
[0039] Data user B obtains its own attribute certificate Cert from the access control chain based on its registration information B_att ={ID B ,ATT B ,sig(SK TA ,(ID B ,ATT B ))}, and then B_att Sent to a trusted authority TA to request TA to distribute the private key.
[0040] After receiving the request, the trusted institution TA verifies the Cert B_att ={ID B ,ATT B ,sig(SK TA ,(ID B ,ATT B ))}, after verification, according to the attribute set ATT B The master key MK generates a private key CP-ABESK corresponding to the attributes of data user B. BThe trusted institution TA will CP-ABESK B Sent to data user B.
[0041] Data user B obtains the private key CP-ABESK B After that, the encrypted access token enToken is decrypted to obtain the plain text of the access token Token, Token={sig(SK a ,ID a ),Policy,IPFS_Hash,K}.
[0042] Data user B downloads data R from the IPFS system according to IPFS_Hash a The ciphertext eData is decrypted using the symmetric key K to obtain the data plaintext R a , and then use the SHA256 algorithm to calculate the data R a The hash value of the SHA256 algorithm is converted into the last 128 bits of the result and the data storage transaction T stor ={IPFS_Hash, seHash, IDa,descD,timestamp, PKa,sign}, if they are consistent, it means that the data has not been tampered with. Data user B obtains data R a access rights.
[0043] Specifically, the zero-knowledge proof generation process: Data user B constructs two parameter groups: Public parameter group Public Inputs = {SHA256 (Policy), IPFS_Hash, nonce}, where SHA256 (Policy) represents the hash of the access policy Policy and nonce represents a random number; Private parameter group Private Inputs = {CP-ABESK B ,ATT B ,K,SHA246(R a )}, where SHA256(R a ) represents data R a The hash value of .
[0044] 4 verification logics: data user B’s private key CP-ABESK B The corresponding attributes satisfy the access policy; use CP-ABESK BAfter decrypting the encrypted access token enToken, the correct key K is obtained; K can decrypt the data corresponding to IPFS_Hash, and the result is complete; the proof process has not been replayed. Data user B encodes these 4 verification logics into an arithmetic circuit, with the parameters being the public parameter group Public Inputs and the private parameter group Private Inputs.
[0045] Data user B inputs secret data: user attribute set ATT B 、Private key CP-ABESK B , key K, data R a Hash value SHA256(R a ) and input public data: access policy hash value SHA256 (Policy), data R a The unique data identifier IPFS_Hash and random number nonce. After compiling and running the arithmetic circuit, the zero-knowledge proof zkp_proof is obtained.
[0046] Access event publishing process: Data users assemble an access event transaction T based on the public parameter group Public Inputs={SHA256(Policy), IPFS_Hash,nonce} and ZKP zero-knowledge proof zkp_proof acclog ={ID B ,access, IPFS_Hash,timestamp,SHA256(Policy),nonce,zkp_proof}, where access indicates that the purpose of this transaction is to access the record of the event. Data user B runs the Markov chain Monte Carlo random walk algorithm (MCMC) and selects two parent transactions that need to be confirmed. After the parent transaction is checked, the access log transaction T is referenced by these two parent transactions. acclog Add to the ledger Tangle to express your opinion on the data R a An access request was made and access rights were successfully obtained. The existence of access event transactions enhances the decentralized auditing of access logs.
[0047] like Figure 2 As shown, a technical implementation process of an IoT data access control method is as follows: Encrypted storage technology process: A1. Signature certificate is sent. IoT device a generates a signature certificate, encrypts the signature certificate and sends it to the proxy node. A2. Device attribute set is sent. The proxy node generates an attribute set for IoT device a and generates an attribute authentication request, which is sent to the trusted institution involved in the private key distribution in the CP-ABE algorithm. A3. Attribute certificate is sent. After the trusted institution verifies the legitimacy of the attribute set, it generates an attribute authentication certificate and sends the attribute authentication certificate to the proxy node. A4. Device information is uploaded to the chain. The proxy node assembles an information identity registration transaction containing IoT device a and publishes the identity registration transaction to the access control chain. A5. Encrypted data is sent. After IoT device a collects data, it encrypts the data and sends it to the proxy node. A6. Encrypted data is uploaded. The proxy node uploads the ciphertext data to the IPFS storage system. A7. Hash address is returned. The IPFS storage system returns the hash address of the ciphertext data to the proxy node. A8. Hash address is sent. The proxy node sends the hash address to IoT device a. A9. Storage transaction is uploaded to the chain. The proxy node assembles a data storage transaction and publishes the data storage transaction to the resource storage chain.
[0048] Token generation technical process: B1. The access policy determines the construction of the access token. IoT device a determines the access policy for the data and constructs the access token. The access token contains the hash address of the data, the access policy, and the key for decrypting the ciphertext of the data stored in the IPFS storage system; B2. The access token is sent. IoT device a sends the access token to the proxy node; B3. The access token is encrypted and uploaded to the chain. The proxy node obtains the public key used for encryption from the trusted organization involved in the private key distribution in the CP-ABE algorithm, encrypts the access token according to the access policy set in the access token, and assembles the access policy publishing transaction, which includes the encrypted access token, the hash address of the data, the owner of the data and other information, and publishes it to the access control chain.
[0049] Access control technical process: C1. Data storage transaction search: the data accessor searches for data storage transactions in the resource storage chain and obtains the hash address of the data from the transaction; C2. Encrypted access token search: the data accessor searches for the access policy issuance transaction corresponding to the data in the access control chain based on the hash address and obtains the encrypted access token from the transaction; C3. Visitor registration information search: the data accessor searches for his / her registration information from the access control chain and obtains his / her attribute set; C4. Attribute set submission: the data accessor submits the attribute set to the trusted institution and requests distribution to the private key corresponding to the attribute; C5. Private key distribution Send, the trusted institution generates the data accessor's private key based on the attribute set and sends it to the data accessor; C6. The private key decrypts the token to obtain the key. The data accessor uses the private key corresponding to the attribute to decrypt the access token and obtains the key for decrypting the data ciphertext; C7. Download the encrypted data and decrypt it. The data accessor downloads the data ciphertext based on the hash address of the data, and then uses the key to decrypt the data ciphertext to obtain the original data; C8. The access event is uploaded to the chain. The data accessor generates a zero-knowledge proof that the key and the original data have been obtained, and assembles it into the access event transaction and publishes it to the access control chain.
[0050] Performance and safety evaluation of the present invention: The performance of the present invention was tested experimentally. The simulation system was deployed and run on a Windows system with 16.0 GB of running memory and AMD Ryzen 7 6800H with Radeon Graphics CPU@3.20 GHz to build an experimental environment for testing.
[0051] Performance evaluation: Single-node and multi-node solutions are designed to evaluate the system throughput and transaction confirmation latency.
[0052] First, we test the system performance under a single full node. That is, when there is only a single full node in the test system, as the number of transactions entering the system per unit time increases, does the system throughput increase? The results are as follows: Figure 3 shown. Figure 3 The horizontal axis is the number of transactions per unit time, the main vertical axis is the confirmation delay (in milliseconds), and the secondary vertical axis is the throughput (tps, the number of transactions processed per second). The blue smooth curve represents the confirmation delay, and the orange smooth curve represents the throughput. The results show that as the number of transactions per unit time increases, the throughput of the system will gradually increase.
[0053] Then, the number of transactions transmitted to the system per unit time is fixed at 8, and the system performance under multiple full nodes is tested. That is, when there are multiple full nodes participating in the test system, as the number of participating full nodes increases, whether the system throughput increases? The results are as follows Figure 4 shown. Figure 4 The horizontal axis represents the number of full nodes, the primary vertical axis is the confirmation delay (in milliseconds), and the secondary vertical axis is the throughput (tps, the number of transactions processed per second). The blue smooth curve represents the confirmation delay, and the orange smooth curve represents the throughput. The results show that as the number of participating full nodes increases, the system throughput will gradually increase.
[0054] The analysis of the above two experimental results shows that the throughput of the present invention will increase with the increase of the number of transactions and the number of participating nodes. It is suitable for the Internet of Things scenario and can meet the high frequency and multi-party participation requirements of the Internet of Things scenario.
[0055] Security Analysis: In order to evaluate the security of the present invention, two common attack scenarios are designed to test the performance of the present invention under the attacks.
[0056] The first test is a double-spending attack, where two transactions with the same fee are sent to the system. As the number of transactions entering the system per unit time increases, the system is tested to see if it can still detect the double-spending attack quickly and minimize the number of transactions connected to illegal transactions. The results are as follows: Figure 5 shown. Figure 5 The horizontal axis represents the number of transactions incoming per unit time, the vertical axis represents the number of affected transactions, the blue line represents the result of the first test, the orange line represents the result of the second test, the gray line represents the result of the third test, and the yellow line represents the result of the fourth test. The results show that the speed of detecting a double-spending attack has nothing to do with the speed of incoming transactions. Once a transaction is directly or indirectly connected to two double-spending transactions, the system can detect a double-spending attack, and one of the two double-spending transactions will be marked as illegal and deleted from the ledger. At the same time, according to the results, although the time to detect a double-spending attack is uncertain, it can be observed that no more than 14 transactions were made during the entire test, indicating that the system can detect a double-spending attack.
[0057] The second test is to test the performance of the system in the face of node desynchronization attacks, and to test the stability of the system after a node in the system loses synchronization. The specific test plan is to set the number of transactions transmitted to the system per unit time to 8, shut down a node after 60 seconds, and restart it after 120 seconds. At the same time, clear the database of the node that lost synchronization, repeat the test three times, and take the average throughput data for analysis. The test results are as follows: Figure 6 As shown, Figure 6The horizontal axis represents the running time (in seconds), the main vertical axis is the confirmation delay (in milliseconds), the secondary vertical axis is the throughput (tps, the number of transactions processed per second), the blue smooth curve represents the confirmation delay, and the orange smooth curve represents the throughput. The results show that although the system throughput is affected within 60 seconds when the nodes lose synchronization, the system performance returns to normal in just 240 seconds. After all nodes are synchronized at 480 seconds, the system can continue to provide services normally. At the same time, the confirmation delay remains stable throughout the experiment, indicating that the system is stable throughout the test.
[0058] The above two test schemes show that this system can cope with common blockchain attack scenarios and has a certain degree of security.
[0059] Embodiment 2: In the second aspect, as Figure 7 As shown, in order to achieve the above-mentioned purpose, the present invention discloses an Internet of Things data access control system, comprising: The encryption storage module 11 is used to obtain the device information of the IoT device, send the device information of the IoT device to the blockchain for identity registration based on the proxy node, encrypt the data obtained by the IoT device to obtain the data ciphertext, send the data ciphertext to the IPFS system based on the proxy node to obtain the hash address, and send the hash address to the blockchain for storage based on the proxy node; The token generation module 12 is used to generate an access token based on the access policy preset by the data owner and the decryption key of the data ciphertext. The IoT device encrypts the access token based on the proxy node using the preset CP-ABE algorithm and sends it to the blockchain for storage; The access control module 13 is used to obtain the collective attributes of the data accessors, and match the collective attributes of the data accessors with the access policies preset by the data owner. If the match is consistent, the private key of the preset CP-ABE algorithm is used to decrypt the access token of the blockchain to obtain the access rights to the data. Otherwise, the access rights to the data cannot be obtained, and the access event is published based on the access rights to the data.
[0060] Based on the same inventive concept, the present invention also provides a computer device, which includes: one or more processors, and a memory for storing one or more computer programs; the program includes program instructions, and the processor is used to execute the program instructions stored in the memory. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is used to implement one or more instructions, specifically for loading and executing one or more instructions in a computer storage medium to implement the above method.
[0061] It should be further explained that, based on the same inventive concept, the present invention also provides a computer storage medium, on which a computer program is stored, and the computer program is executed by the processor to execute the above method. The storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electrical, magnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0062] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0063] The above shows and describes the basic principles, main features and advantages of the present disclosure. Those skilled in the art should understand that the present disclosure is not limited by the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present disclosure. Without departing from the spirit and scope of the present disclosure, the present disclosure may have various changes and improvements, and these changes and improvements fall within the scope of the present disclosure to be protected.
Claims
1. A method for controlling access to Internet of Things data, characterized in that: The method comprises the following steps: Obtain the device information of the IoT device, send the device information of the IoT device to the blockchain for identity registration based on the proxy node, encrypt the data obtained by the IoT device to obtain the data ciphertext, send the data ciphertext to the IPFS system based on the proxy node to obtain the hash address, and send the hash address to the blockchain for storage based on the proxy node; An access token is generated based on the access policy preset by the data owner and the decryption key of the data ciphertext. The IoT device uses the preset CP-ABE algorithm based on the proxy node to encrypt the access token and send it to the blockchain for storage. Get the collection attributes of data accessors, and match the collection attributes of data accessors with the access policies preset by the data owner. If the match is consistent, use the private key of the preset CP-ABE algorithm to decrypt the access token of the blockchain to obtain the access rights to the data. Otherwise, the access rights to the data cannot be obtained, and the access event is published based on the access rights to the data.
2. The method for controlling access to Internet of Things data according to claim 1, characterized in that: The process of sending the device information of the IoT device to the blockchain for identity registration based on the proxy node includes: IoT device a generates a pair of public and private keys (PK a ,SK a ), and then based on the unique identification ID of IoT device a itself a , Public Key PK a 、Private key SK a , generate a signed certificate Cert a ={ID a ,PK a ,sig(SK a ,(ID a ,PK a ))}, where sig(SK a ,(ID a ,PK a )) represents the signature of IoT device a; After connecting to the proxy node, according to the proxy node G net The public key PK net , IoT device a generates a signature certificate Cert a Encrypted using an asymmetric encryption algorithm and sent to proxy node G net Indicate your identity; proxy node G net After receiving the encrypted information sent by IoT device a, it uses its own private key SK net Decrypt the information to get the Cert a ; Proxy Node G net Get the Cert by decrypting a Then, according to the public key PK of IoT device a contained in it a For signature sig(SK a ,(ID a , PK a )) Verify, verify Cert a the legality of Proxy Node G net Generate attribute set ATT for IoT device a a ={att a1 ,att a2 ,… ,att ai ,…,att an }, where att ai (i=1,2,3,…,n) represents the i-th attribute of IoT device a, and the attribute is stored in the form of key-value pairs; the proxy node G net According to the unique identification ID of IoT device a a And the attribute set ATT a The attribute set generates an attribute authentication application Re for IoT device a a_att ; RE a_att ={ID a ,G net ,TO a ,sig(SK net ,(ID a ,G net ,TO a ))} Proxy Node G ne Apply for attribute authentication a_att The private key is sent to the trusted authority TA in the CP-ABE algorithm system, which verifies the legitimacy of the attribute set. After verifying the legitimacy of the attribute set, TA signs the attribute set and generates an attribute certificate Cert. a_att ; Certificate a_att ={ID a ,TO a ,sig(SK TA ,(ID a ,TO a ))} The trusted authority TA will send the attribute certificate Cert a_att Send to proxy node G net Represents the attribute set ATT of IoT device a a The authentication indicates that the attributes of IoT device a have passed the legitimacy check; Proxy Node G net In the Tangle of the access control chain, check whether IoT device a has been registered. If not, proxy node G net First use your own private key SK net Yes (ID a ,G net ,PK net ) to sign and generate signature sig(SK net ,(ID a ,G net ,PK net )); then the signature sig(SK net ,(ID a ,G net ,PK net )), ID of IoT device a a , proxy node G net The public key PK net , the attribute set ATT of IoT device a a And attribute certificate Cert a_att Assemble into identity registration transaction T reg ; T reg ={ID a , G net , P.K. net , itself(SK net ,(ID a ,G net ,PK net )),TO a ,Cert a_att }; Proxy Node G net Run the Markov Chain Monte Carlo random walk algorithm MCMC used in the IOTA system to register transaction T in the access control chain reg Select two parent transactions that need to be confirmed; after the parent transaction is checked and passed, the proxy node G net The identity of IoT device a is registered in transaction T by referencing these two parent transactions. reg Join the access control chain's ledger Tangle, and broadcast the identity registration transaction T in the access control chain's blockchain network reg To inform other nodes, so that transaction T reg Get confirmation.
3. The method for controlling access to Internet of Things data according to claim 2, characterized in that: The process of sending the data ciphertext to the IPFS system for storage based on the proxy node: After IoT device a collects data, the data is recorded as R a , use the SHA256 algorithm to calculate the data R a The hash value of the SHA256 algorithm is obtained by taking the first 128 bits of the output result of the SHA256 algorithm as the key K, and taking the last 128 bits of the output result of the SHA256 algorithm as the hash fragment seHash. The AES128 symmetric encryption algorithm is used to encrypt the key K and the data R. a The ciphertext eData is obtained as input, and then the IoT device a sends the data message MSG to the proxy node; MSG={eData,seHash,ID a ,descD,timestamp,PK a ,sign} Where: ID a Indicates the identity of IoT device a, which is the sender of data; descD indicates the data R a timestamp indicates the timestamp of sending; sign=sig(SK a ,(eData,seHash, ID a ,descD,timestamp,PK a )), represents the IoT device a’s access to data R a signature; Proxy Node G net Received data message MSG={eData,seHash,ID a ,descD,timestamp,PK a ,sign}, according to the public key PK of IoT device a a Verify the signature sign. After verification, the data R a The ciphertext eData is uploaded to the IPFS storage system, and IPFS returns the hash address IPFS_Hash that identifies the ciphertext eData. net Use the public key PK of IoT device a a Encrypt IPFS_Hash and send it to IoT device a. After receiving the ciphertext, IoT device a uses its own private key SK a Decrypt the ciphertext to get IPFS_Hash and save IPFS_Hash locally for access token construction; The proxy node device converts the data message MSG into a standardized json format and assembles it into a data storage T stor ={IPFS_Hash, seHash, ID a ,descD,timestamp,PK a ,sign}, proxy node G net Run the Markov chain Monte Carlo random walk algorithm MCMC used in the IOTA system, and store data in the data storage chain for data storage transactions T stor Select two parent transactions that need to be confirmed and store the data in transaction T by referencing these two parent transactions. stor Add to the data storage chain's ledger Tangle.
4. The method for controlling access to Internet of Things data according to claim 1, characterized in that: The process of generating an access token based on the access policy preset by the data owner and the decryption key of the data ciphertext is as follows: Initialize the CP-ABE algorithm system, and the trusted authority TA generates the system's master key MK and public key PK; Using the Boolean formula strategy in the CP-ABE algorithm, the data R of IoT device a a Determine the access control policy that needs to be embedded in the ciphertext Policy = A1∧A2∧A3∧⋯∧A n , where A i With ATT={att 1, att 2,····, att i,····, att n } in att i One-to-one correspondence, where i=1,2,3, ···· ,n, represents that only when the attribute set of the data accessor satisfies the policy Policy, the data R of IoT device a is allowed to be accessed a ; IoT device a constructs access token Token={sig(SK a ,ID a ), Policy, IPFS_Hash, K}, where sig(SK a ,ID a ) indicates that IoT device a uses its own private key to identify the unique identifier ID of IoT device a a Signature; IPFS_Hash represents data R a The unique identifier of data R a The hash address of the ciphertext in the IPFS system; K represents the address used to decrypt the data R a The key of the ciphertext eData; IoT device a sends the constructed access token Token to the proxy node. The proxy node encrypts the access token Token according to the access control policy Policy set in the Token using the public key PK of the CP-ABE algorithm to obtain enToken. enToken is decrypted by the CP-ABE private key of the data user who complies with the Policy. The proxy node then uses the unique identifier ID of IoT device a to decrypt the access token Token. a , encrypted access token enToken, data R a IPFS_Hash and its own information G net Generate access policy and publish transaction T pol ={ID a ,enToken, G net , IPFS_Hash,sig(ID a ,enToken, G net )}; Proxy Node G net Run the Markov Chain Monte Carlo random walk algorithm MCMC used in the IOTA system and publish transaction T for the access policy in the access control chain pol Select two parent transactions that need to be confirmed; after the parent transaction is checked and passed, the proxy node G net The access policy is published by referencing two parent transactions T pol Add to the access control chain's ledger Tangle.
5. The method for controlling access to Internet of Things data according to claim 1, characterized in that: The process of matching the set attributes of the data accessor with the access policy preset by the data owner, and if the match is consistent, using the private key of the preset CP-ABE algorithm to decrypt the access token of the blockchain to obtain the access rights of the data: Data user B receives data storage transaction T from the data storage chain stor ={IPFS_Hash,seHash, ID a ,descD,timestamp,PK a ,sign} to obtain the data R of IoT device a a After obtaining the unique identifier IPFS_hash, find the storage data R in the access control chain according to the unique identifier IPFS_hash a Transaction T of encrypted access token enToken pol ={ID a ,enToken, G net , IPFS_Hash,sig(ID a ,enToken, G net )}, get enToken; Data user B obtains its own attribute certificate Cert from the access control chain based on its registration information B_att ={ID B ,ATT B ,sig(SK TA ,(ID B ,ATT B ))}, and Cert B_att Send to the trusted authority TA to request TA to distribute the private key; After receiving the request, the trusted institution TA verifies the Cert B_att ={ID B ,ATT B ,sig(SK TA ,(ID B ,ATT B ))} is legal. After verification, according to the attribute set ATT B The master key MK generates a private key CP-ABESK corresponding to the attributes of data user B. B , the trusted institution TA will CP-ABESK B Sent to data user B; Data user B obtains the private key CP-ABESK B After that, the encrypted access token enToken is decrypted to obtain the plain text of the access token Token, Token={sig(SK a ,ID a ),Policy,IPFS_Hash,K}; Data user B downloads data R from the IPFS system according to IPFS_Hash a The ciphertext eData is decrypted using the symmetric key K to obtain the data plaintext R a , and then use the SHA256 algorithm to calculate the data R a The hash value of the SHA256 algorithm is converted into the last 128 bits of the result and the data storage transaction T stor ={IPFS_Hash, seHash, IDa,descD,timestamp, PKa,sign}, if they are consistent, it means that the data has not been tampered with, and data user B obtains data R a access rights.
6. The method for controlling access to data of the Internet of Things according to claim 1, characterized in that: The process of publishing access events based on data access rights: Based on the access rights of the data, a zero-knowledge proof of access rights is generated and the access log is constructed and published on the blockchain to realize the publication of access events.
7. The method for controlling access to data of the Internet of Things according to claim 6, characterized in that: The generation process of the zero-knowledge proof: Data user B constructs two parameter groups: Public parameter group Public Inputs = {SHA256 (Policy), IPFS_Hash, nonce}, where SHA256 (Policy) represents the hash of the access policy Policy and nonce represents a random number; Private parameter group Private Inputs = {CP-ABESK B ,ATT B ,K,SHA246(R a )}, where SHA256(R a ) represents data R a The hash value of 4 verification logics: data user B’s private key CP-ABESK B The corresponding attributes satisfy the access policy; use CP-ABESK B After decrypting the encrypted access token enToken, the correct key K is obtained; K can decrypt the data corresponding to IPFS_Hash, and the result is complete; the proof process is not replayed, and the data user B encodes the verification logic into an arithmetic circuit with 4 parameters, which are the public parameter group Public Inputs and the private parameter group Private Inputs; Data user B inputs secret data: user attribute set ATT B 、Private key CP-ABESK B , key K, data R a Hash value SHA256(R a ), enter the public data: access policy hash value SHA256 (Policy), data R a The unique data identifier IPFS_Hash and random number nonce are compiled and run the arithmetic circuit to obtain the zero-knowledge proof zkp_proof; Access event publishing: Data users assemble access event transactions T based on the public parameter group Public Inputs = {SHA256 (Policy), IPFS_Hash, nonce} and ZKP zero-knowledge proof zkp_proof acclog ={ID B ,access, IPFS_Hash,timestamp,SHA256(Policy),nonce,zkp_proof}, where access indicates that the purpose of this transaction is to access the record of the event. Data user B runs the Markov chain Monte Carlo random walk algorithm MCMC, selects two parent transactions that need to be confirmed, and after the parent transactions are checked, access log transaction T is accessed by referencing these two parent transactions. acclog Added to the account book Tangle, indicating data R a Access request was made and access was successfully granted.
8. An Internet of Things data access control system, using an Internet of Things data access control method according to any one of claims 1 to 7, characterized in that: include: An encryption storage module is used to obtain device information of the IoT device, send the device information of the IoT device to the blockchain for identity registration based on the proxy node, encrypt the data obtained by the IoT device to obtain data ciphertext, and send the data ciphertext to the blockchain for storage based on the proxy node; The token generation module is used to obtain the device information of the IoT device, send the device information of the IoT device to the blockchain for identity registration based on the proxy node, encrypt the data obtained by the IoT device to obtain the data ciphertext, send the data ciphertext to the IPFS system based on the proxy node to obtain the hash address, and send the hash address to the blockchain for storage based on the proxy node; The access control module is used to obtain the collection attributes of data accessors, and match the collection attributes of data accessors with the access policies preset by the data owner. If the match is consistent, the private key of the preset CP-ABE algorithm is used to decrypt the access token of the blockchain to obtain the access rights to the data. Otherwise, the access rights to the data cannot be obtained, and the access event is published based on the access rights to the data.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: The memory stores a computer program that can be run on a processor. When the processor loads and executes the computer program, an Internet of Things data access control method as described in any one of claims 1 to 7 is adopted.
10. A computer-readable storage medium having a computer program stored therein, characterized in that: When the computer program is loaded and executed by the processor, an Internet of Things data access control method according to any one of claims 1 to 7 is adopted.
Citation Information
Patent Citations
Internet of Things equipment lightweight authentication and access authorization method based on DAG block chain
CN113949544A
Traceable access control method based on double block chains
CN114826652A
Internet of Things trusted data sharing method, system and device and storage medium
CN118713902A
IoT-oriented access control method based on smart contract and CP-ABE
CN119030739A
Token-based remote login using attribute-based encryption
US20250007717A1
Cited By
Data transaction system
CN121010379A