《计算机应用》唯一官方网站 ›› 2023, Vol. 43 ›› Issue (6): 1969-1978.DOI: 10.11772/j.issn.1001-9081.2022050719
所属专题: 前沿与综合应用
收稿日期:
2022-05-20
修回日期:
2022-12-27
接受日期:
2022-12-30
发布日期:
2023-06-08
出版日期:
2023-06-10
通讯作者:
马小峰
作者简介:
陈璐瑀(1997—),男,福建宁德人,硕士研究生,主要研究方向:区块链、金融科技基金资助:
Luyu CHEN1, Xiaofeng MA1(), Jing HE1, Shengzhi GONG2, Jian GAO3
Received:
2022-05-20
Revised:
2022-12-27
Accepted:
2022-12-30
Online:
2023-06-08
Published:
2023-06-10
Contact:
Xiaofeng MA
About author:
CHEN Luyu, born in 1997, M. S. candidate. His research interests include blockchain, financial technology.Supported by:
摘要:
为满足当代数字化背景下数据共享的需求,同时兼顾保护隐私数据安全的必要性,提出一种基于TrustZone的区块链智能合约隐私数据授权方法。区块链系统能够在不同应用场景中实现数据共享,并且满足监管的要求;TrustZone可信执行环境(TEE)技术则为隐私计算提供安全的隔离环境。在整体系统中,隐私数据的上传由监管机构完成,其余业务节点需要在获得用户授权的前提下,获得隐私数据的明文信息,从而保护用户的隐私安全。针对技术融合时TrustZone架构存在的内存空间较小的问题,提出一种针对小内存条件的隐私求交算法,其中,通过基于分组计算的思想完成对大数量级数据集合的求交运算。使用不同数量级大小的数据集测试所提算法,结果表明所提算法在时间与空间方面的消耗在极小范围内波动,方差分别约为1.0 s2与0.01 MB2,较为稳定;当增大数据集数量级时,所提算法的时间消耗是可预期的;此外,使用事先排序的数据集能够大幅提高算法性能。
中图分类号:
陈璐瑀, 马小峰, 何敬, 龚生智, 高建. 基于TrustZone的区块链智能合约隐私授权方法[J]. 计算机应用, 2023, 43(6): 1969-1978.
Luyu CHEN, Xiaofeng MA, Jing HE, Shengzhi GONG, Jian GAO. Blockchain smart contract privacy authorization method based on TrustZone[J]. Journal of Computer Applications, 2023, 43(6): 1969-1978.
节点 | 持有密钥 |
---|---|
监管节点 | PK_P、SK_P、PK_A、PK_B |
业务节点A | SK_P、PK_A、SK_A、PK_B |
业务节点B | SK_P、PK_A、PK_B、SK_B |
表1 节点持有密钥
Tab.1 Keys saved in nodes
节点 | 持有密钥 |
---|---|
监管节点 | PK_P、SK_P、PK_A、PK_B |
业务节点A | SK_P、PK_A、SK_A、PK_B |
业务节点B | SK_P、PK_A、PK_B、SK_B |
key | value | 区块hash |
---|---|---|
orgA+timeA1 | user1+userA1 | hash1 |
orgA+timeA2 | user2+userA2 | hash2 |
orgB+timeB1 | user1+userB1 | hash3 |
orgA+timeA3 | user3+userA3 | hash4 |
orgA+timeA4 | user4+userA4 | hash5 |
orgB+timeB2 | user2+userB2 | hash6 |
表2 链上数字身份信息
Tab.2 Digital identity information recorded on blockchain
key | value | 区块hash |
---|---|---|
orgA+timeA1 | user1+userA1 | hash1 |
orgA+timeA2 | user2+userA2 | hash2 |
orgB+timeB1 | user1+userB1 | hash3 |
orgA+timeA3 | user3+userA3 | hash4 |
orgA+timeA4 | user4+userA4 | hash5 |
orgB+timeB2 | user2+userB2 | hash6 |
key | value | 区块hash |
---|---|---|
orgA+timeA1 | user1+userA1 | hash1 |
orgA+timeA2 | user2+userA2 | hash2 |
orgB+timeB1 | user1+userB1 | hash3 |
orgB+timeB2 | user2+userB2 | hash6 |
表3 查询结果
Tab.3 Results of query
key | value | 区块hash |
---|---|---|
orgA+timeA1 | user1+userA1 | hash1 |
orgA+timeA2 | user2+userA2 | hash2 |
orgB+timeB1 | user1+userB1 | hash3 |
orgB+timeB2 | user2+userB2 | hash6 |
序号 | 时间 消耗/s | 最大 占用内存/MB | 序号 | 时间 消耗/s | 最大 占用内存/MB |
---|---|---|---|---|---|
1 | 85.86 | 104.099 6 | 11 | 84.93 | 104.087 6 |
2 | 84.68 | 104.098 2 | 12 | 85.24 | 104.092 3 |
3 | 86.48 | 104.108 5 | 13 | 85.30 | 104.093 5 |
4 | 83.38 | 104.088 6 | 14 | 84.30 | 104.087 3 |
5 | 82.62 | 104.062 9 | 15 | 86.02 | 104.100 5 |
6 | 84.80 | 104.085 7 | 16 | 84.23 | 104.090 2 |
7 | 83.92 | 104.091 0 | 17 | 83.49 | 104.086 7 |
8 | 86.17 | 104.094 5 | 18 | 85.39 | 104.094 6 |
9 | 83.86 | 104.089 5 | 19 | 84.24 | 104.089 3 |
10 | 85.63 | 104.099 2 | 20 | 83.94 | 104.085 9 |
表5 算法稳定性测试结果
Tab.5 Results of algorithm stability test
序号 | 时间 消耗/s | 最大 占用内存/MB | 序号 | 时间 消耗/s | 最大 占用内存/MB |
---|---|---|---|---|---|
1 | 85.86 | 104.099 6 | 11 | 84.93 | 104.087 6 |
2 | 84.68 | 104.098 2 | 12 | 85.24 | 104.092 3 |
3 | 86.48 | 104.108 5 | 13 | 85.30 | 104.093 5 |
4 | 83.38 | 104.088 6 | 14 | 84.30 | 104.087 3 |
5 | 82.62 | 104.062 9 | 15 | 86.02 | 104.100 5 |
6 | 84.80 | 104.085 7 | 16 | 84.23 | 104.090 2 |
7 | 83.92 | 104.091 0 | 17 | 83.49 | 104.086 7 |
8 | 86.17 | 104.094 5 | 18 | 85.39 | 104.094 6 |
9 | 83.86 | 104.089 5 | 19 | 84.24 | 104.089 3 |
10 | 85.63 | 104.099 2 | 20 | 83.94 | 104.085 9 |
序号 | 时间 消耗/s | 最大占用内存/MB | 序号 | 时间 消耗/s | 最大占用内存/MB |
---|---|---|---|---|---|
1 | 51.40 | 104.021 6 | 11 | 50.04 | 104.009 8 |
2 | 50.30 | 104.017 0 | 12 | 50.98 | 104.012 6 |
3 | 52.31 | 104.049 3 | 13 | 48.99 | 103.982 3 |
4 | 49.89 | 104.001 2 | 14 | 49.63 | 103.998 4 |
5 | 48.78 | 103.998 7 | 15 | 50.68 | 104.014 8 |
6 | 50.33 | 104.012 7 | 16 | 50.93 | 104.017 5 |
7 | 49.36 | 104.014 6 | 17 | 51.10 | 104.018 8 |
8 | 51.91 | 104.012 1 | 18 | 49.02 | 103.993 2 |
9 | 49.24 | 103.990 2 | 19 | 50.36 | 104.010 9 |
10 | 50.53 | 104.009 2 | 20 | 50.83 | 103.014 7 |
表6 算法稳定性测试结果(数据集已排序)
Tab.6 Results of algorithm stability test (datasets are sorted)
序号 | 时间 消耗/s | 最大占用内存/MB | 序号 | 时间 消耗/s | 最大占用内存/MB |
---|---|---|---|---|---|
1 | 51.40 | 104.021 6 | 11 | 50.04 | 104.009 8 |
2 | 50.30 | 104.017 0 | 12 | 50.98 | 104.012 6 |
3 | 52.31 | 104.049 3 | 13 | 48.99 | 103.982 3 |
4 | 49.89 | 104.001 2 | 14 | 49.63 | 103.998 4 |
5 | 48.78 | 103.998 7 | 15 | 50.68 | 104.014 8 |
6 | 50.33 | 104.012 7 | 16 | 50.93 | 104.017 5 |
7 | 49.36 | 104.014 6 | 17 | 51.10 | 104.018 8 |
8 | 51.91 | 104.012 1 | 18 | 49.02 | 103.993 2 |
9 | 49.24 | 103.990 2 | 19 | 50.36 | 104.010 9 |
10 | 50.53 | 104.009 2 | 20 | 50.83 | 103.014 7 |
数据集排序情况 | 时间消耗平均值/s | 时间消耗方差/s2 | 最大占用内存平均值/MB | 最大占用内存方差/MB2 |
---|---|---|---|---|
未排序 | 84.73 | 1.037 5 | 104.091 3 | 0.008 9 |
已排序 | 50.33 | 0.976 2 | 104.009 0 | 0.011 6 |
表7 算法测试结果对比
Tab.7 Algorithm test results comparison
数据集排序情况 | 时间消耗平均值/s | 时间消耗方差/s2 | 最大占用内存平均值/MB | 最大占用内存方差/MB2 |
---|---|---|---|---|
未排序 | 84.73 | 1.037 5 | 104.091 3 | 0.008 9 |
已排序 | 50.33 | 0.976 2 | 104.009 0 | 0.011 6 |
数据集排序情况 | 不同数量级大小的时间消耗 | ||||||
---|---|---|---|---|---|---|---|
105 | 5×105 | 106 | 2×106 | 5×106 | 107 | 2×107 | |
未排序 | 16.33 | 55.32 | 84.75 | 165.43 | 360.99 | 529.59 | 657.32 |
已排序 | 13.32 | 38.34 | 50.33 | 91.32 | 186.35 | 253.74 | 287.13 |
表8 不同数量级大小情况下的算法时间消耗对比 (s)
Tab.8 Comparison of algorithm time consumption under different dataset magnitudes
数据集排序情况 | 不同数量级大小的时间消耗 | ||||||
---|---|---|---|---|---|---|---|
105 | 5×105 | 106 | 2×106 | 5×106 | 107 | 2×107 | |
未排序 | 16.33 | 55.32 | 84.75 | 165.43 | 360.99 | 529.59 | 657.32 |
已排序 | 13.32 | 38.34 | 50.33 | 91.32 | 186.35 | 253.74 | 287.13 |
序号 | 数据集 数据量/107 | 时间消耗/s | 序号 | 数据集 数据量/107 | 时间消耗/s |
---|---|---|---|---|---|
1 | 0.01 | 16.33 | 9 | 0.70 | 441.12 |
2 | 0.05 | 55.32 | 10 | 0.80 | 476.23 |
3 | 0.10 | 84.73 | 11 | 0.90 | 502.24 |
4 | 0.20 | 165.43 | 12 | 1.00 | 529.59 |
5 | 0.30 | 242.11 | 13 | 1.20 | 564.32 |
6 | 0.40 | 307.46 | 14 | 1.50 | 603.33 |
7 | 0.50 | 360.99 | 15 | 2.00 | 657.32 |
8 | 0.60 | 404.13 |
表9 不同数量条件下的算法测试结果
Tab.9 Algorithm test results under different quantitative conditions
序号 | 数据集 数据量/107 | 时间消耗/s | 序号 | 数据集 数据量/107 | 时间消耗/s |
---|---|---|---|---|---|
1 | 0.01 | 16.33 | 9 | 0.70 | 441.12 |
2 | 0.05 | 55.32 | 10 | 0.80 | 476.23 |
3 | 0.10 | 84.73 | 11 | 0.90 | 502.24 |
4 | 0.20 | 165.43 | 12 | 1.00 | 529.59 |
5 | 0.30 | 242.11 | 13 | 1.20 | 564.32 |
6 | 0.40 | 307.46 | 14 | 1.50 | 603.33 |
7 | 0.50 | 360.99 | 15 | 2.00 | 657.32 |
8 | 0.60 | 404.13 |
1 | 朱雪忠,代志在. 总体国家安全观视域下《数据安全法》的价值与体系定位[J]. 电子政务, 2020(8):82-92. 10.16582/j.cnki.dzzw.2020.08.008 |
ZHU X Z, DAI Z Z. The value and system orientation of the “Data Security Law” from the perspective of the overall national security concept [J]. E-Government, 2020(8): 82-92. 10.16582/j.cnki.dzzw.2020.08.008 | |
2 | 冯登国,张敏,李昊. 大数据安全与隐私保护[J]. 计算机学报, 2014, 37(1):246-258. 10.3724/SP.J.1016.2014.00246 |
FEND D G, ZHANG M, LI H. Big data security and privacy protection [J]. Chinese Journal of Computers, 2014, 37(1): 246-258. 10.3724/SP.J.1016.2014.00246 | |
3 | 袁勇,王飞跃. 区块链技术发展现状与展望[J]. 自动化学报, 2016, 42(4):481-494. 10.16383/j.aas.2016.c160158 |
YUAN Y, WANG F Y. Blockchain: the state of the art and future Trends[J]. Acta Automatica Sinica, 2016, 42(4):481-494. 10.16383/j.aas.2016.c160158 | |
4 | SZABO N. The idea of smart contracts [EB/OL]. [2022-08-07].. 10.1007/978-3-030-90421-0_48 |
5 | 范吉立,李晓华,聂铁铮,等. 区块链系统中智能合约技术综述[J]. 计算机科学, 2019, 46(11):1-10. 10.11896/jsjkx.190300013 |
FAN J L, LI X H, NIE T Z, et al. Survey on smart contract based on blockchain system [J]. Computer Science, 2019, 46(11):1-10. 10.11896/jsjkx.190300013 | |
6 | 仝秦玮,李洁,王洁,等. 一种基于智能合约的全同态加密方法[J]. 网络空间安全, 2020, 11(9):32-38. 10.3969/j.issn.1674-9456.2020.09.005 |
TONG Q W, LI J, WANG J, et al. A full homomorphic encryption method based on smart contract [J]. Cyberspace Security, 2020, 11(9): 32-38. 10.3969/j.issn.1674-9456.2020.09.005 | |
7 | 董贵山,陈宇翔,范佳,等. 区块链应用中的隐私保护策略研究[J]. 计算机科学, 2019, 46(5):29-35. 10.11896/j.issn.1002-137X.2019.05.004 |
DONG G S, CHEN Y X, FAN J, et al. Research on privacy protection strategies in blockchain application[J]. Computer Science, 2019, 46(5):29-35. 10.11896/j.issn.1002-137X.2019.05.004 | |
8 | 汪金苗,谢永恒,王国威,等. 基于属性基加密的区块链隐私保护与访问控制方法[J]. 信息网络安全, 2020, 20(9):47-51. 10.3969/j.issn.1671-1122.2020.09.010 |
WANG J M, XIE Y H, WANG G W, et al. A method of privacy preserving and access control in blockchain based on attribute-based encryption [J]. Netinfo Security, 2020, 20(9): 47-51. 10.3969/j.issn.1671-1122.2020.09.010 | |
9 | YAN Y, WEI C Z, GUO X P, et al. Confidentiality support over financial grade consortium blockchain [C]// Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data. New York: ACM, 2020: 2227-2240. 10.1145/3318464.3386127 |
10 | VALADARES D C G, WILL N C, CAMINHA J, et al. Systematic literature review on the use of trusted execution environments to protect cloud/fog-based Internet of Things applications [J]. IEEE Access, 2021, 9: 80953-80969. 10.1109/access.2021.3085524 |
11 | HUA Z C, GU J Y, XIA Y B, et al. vTZ: virtualizing ARM TrustZone[C]// Proceeding of the 26th USENIX Security Symposium. Berkeley: USENIX Association, 2017: 541-556. |
12 | AMACHER J, SCHIAVONI V. On the performance of ARM TrustZone: practical experience report[C]// Proceeding of the 2019 IFIP International Conference on Distributed Applications and Interoperable Systems, LNCS 11534. Cham: Springer, 2019:133-151. |
13 | ENKHTAIVAN B, TAKENOUCHI T, SAKO K. A fair anonymous auction scheme utilizing trusted hardware and blockchain [C]// Proceeding of the 17th International Conference on Privacy, Security and Trust. Piscataway: IEEE, 2019: 1-5. 10.1109/pst47121.2019.8949020 |
14 | AYOADE G, KARANDE V, KHAN L, et al. Decentralized IoT data management using blockchain and trusted execution environment[C]// Proceeding of the 2018 IEEE International Conference on Information Reuse and Integration for Data Science. Piscataway: IEEE, 2018:15-22. 10.1109/iri.2018.00011 |
15 | LIANG Y H, LI Y, SHIN B S. FairCs-blockchain-based fair crowdsensing scheme using trusted execution environment[J]. Sensors, 2020, 20(11): No.3172. 10.3390/s20113172 |
16 | CHENG J R, LI J, XIONG N X, et al. Lightweight mobile clients privacy protection using trusted execution environments for blockchain [J] Computers, Materials and Continua, 2020, 65(3): 2247-2262. 10.32604/cmc.2020.011668 |
17 | ENKHTAIVAN B, INOUE A. Mediating data trustworthiness by using trusted hardware between IoT devices and blockchain [C]// Proceeding of the 2020 IEEE International Conference on Smart Internet of Things. Piscataway: IEEE, 2020:314-318. 10.1109/smartiot49966.2020.00056 |
18 | ZHANG Y X, LI Y, FANG L, et al. Privacy-protected electronic voting system based on blockchin and trusted execution environment[C]// Proceeding of the IEEE 5th International Conference on Computer and Communications. Piscataway: IEEE, 2019:1252-1257. 10.1109/iccc47050.2019.9064387 |
19 | WANG Y, LI J N, ZHAO S Y, et al. Hybridchain: a novel architecture for confidentiality-preserving and performant permissioned blockchain using trusted execution environment [J]. IEEE Access, 2020, 8:190652-190662. 10.1109/access.2020.3031889 |
20 | FU X, WANG H M, SHI P C, et al. Teegraph: a blockchain consensus algorithm based on TEE and DAG for data sharing in IoT[J]. Journal of Systems Architecture, 2022, 122: No.102344. 10.1016/j.sysarc.2021.102344 |
21 | BRANDENBURGER M, CACHIN C, KAPITZA R, et al. Trusted computing meets blockchain: rollback attacks and a solution for Hyperledger Fabric[C]// Proceeding of the 38th Symposium on Reliable Distributed Systems. Piscataway: IEEE, 2019:324-333. 10.1109/srds47363.2019.00045 |
22 | LIND J, NAOR O, EYAL I, et al. Teechain: a secure payment network with asynchronous blockchain access [C]// Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data. New York: ACM, 2019:63-79. 10.1145/3341301.3359627 |
23 | MADDALI L P, THAKUR M S D, VIGNESWARAN R, et al. VeriBlock: a novel blockchain framework based on verifiable computing and trusted execution environment [C]// Proceeding of the 2020 International Conference on Communication Systems and Networks. Piscataway: IEEE, 2020: 1-6. 10.1109/comsnets48256.2020.9027414 |
24 | FENG Q, HE D B, ZEADALLY S, et al. A survey on privacy protection in blockchain system[J]. Journal of Network and Computer Applications, 2019, 126: 45-58. 10.1016/j.jnca.2018.10.020 |
25 | 杨保绚,董攀,张利军,等. 基于TrustZone的安全应用性能优化[J]. 计算机工程与科学, 2020, 42(12):2141-2150. 10.3969/j.issn.1007-130X.2020.12.006 |
YANG B X, DONG P, ZHANG L J, et al. Performance optimization of secure application based on TrustZone [J]. Computer Engineering and Science, 2020, 42(12): 2141-2150. 10.3969/j.issn.1007-130X.2020.12.006 | |
26 | 杨帆,张倩颖,施智平,等. 可信执行环境软件侧信道攻击研究综述[J]. 软件学报, 2023, 34(1):381-403. |
YANG F, ZHANG Q Y, SHI Z P, et al. Survey on software side-channel attacks in trusted execution environment[J]. Journal of Software, 2023, 34(1): 381-403. |
[1] | 陈廷伟, 张嘉诚, 王俊陆. 面向联邦学习的随机验证区块链构建[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2770-2776. |
[2] | 孙晓玲, 王丹辉, 李姗姗. 基于区块链的动态密文排序检索方案[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2500-2505. |
[3] | 黄河, 金瑜. 基于投票和以太坊智能合约的云数据审计方案[J]. 《计算机应用》唯一官方网站, 2024, 44(7): 2093-2101. |
[4] | 李皎, 张秀山, 宁远航. 降低跨分片交易比例的区块链分片方法[J]. 《计算机应用》唯一官方网站, 2024, 44(6): 1889-1896. |
[5] | 赵莉朋, 郭兵. 基于BDLS的区块链共识改进算法[J]. 《计算机应用》唯一官方网站, 2024, 44(4): 1139-1147. |
[6] | 陈美宏, 袁凌云, 夏桐. 基于主从多链的数据分类分级访问控制模型[J]. 《计算机应用》唯一官方网站, 2024, 44(4): 1148-1157. |
[7] | 高改梅, 张瑾, 刘春霞, 党伟超, 白尚旺. 基于区块链与CP-ABE策略隐藏的众包测试任务隐私保护方案[J]. 《计算机应用》唯一官方网站, 2024, 44(3): 811-818. |
[8] | 马海峰, 李玉霞, 薛庆水, 杨家海, 高永福. 用于实现区块链隐私保护的属性基加密方案[J]. 《计算机应用》唯一官方网站, 2024, 44(2): 485-489. |
[9] | 陈姿芊, 牛科迪, 姚中原, 斯雪明. 适用于物联网的区块链轻量化技术综述[J]. 《计算机应用》唯一官方网站, 2024, 44(12): 3688-3698. |
[10] | 高婷婷, 姚中原, 贾淼, 斯雪明. 链上链下一致性保护技术综述[J]. 《计算机应用》唯一官方网站, 2024, 44(12): 3658-3668. |
[11] | 贾淼, 姚中原, 祝卫华, 高婷婷, 斯雪明, 邓翔. 零知识证明赋能区块链的进展与展望[J]. 《计算机应用》唯一官方网站, 2024, 44(12): 3669-3677. |
[12] | 牛科迪, 李敏, 姚中原, 斯雪明. 面向物联网的区块链共识算法综述[J]. 《计算机应用》唯一官方网站, 2024, 44(12): 3678-3687. |
[13] | 王伊婷, 万武南, 张仕斌, 张金全, 秦智. 基于SM9算法的可链接环签名方案[J]. 《计算机应用》唯一官方网站, 2024, 44(12): 3709-3716. |
[14] | 刘德渊, 张金全, 张鑫, 万武南, 张仕斌, 秦智. 基于无证书签密的跨链身份认证方案[J]. 《计算机应用》唯一官方网站, 2024, 44(12): 3731-3740. |
[15] | 孙科硕, 高海英, 宋杨. 面向公有区块链上的私有区块链的多权威属性加密方案[J]. 《计算机应用》唯一官方网站, 2024, 44(12): 3699-3708. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||