Kleptography and Steganography in Blockchains
Total Page:16
File Type:pdf, Size:1020Kb
School of Computing and Communications Kleptography and Steganography in Blockchains Nasser Alsalami Under the Supervision of Professor Bingsheng Zhang and Doctor Antonios Gouglidis Submitted for the degree of Doctor of Philosophy July 2020 Abstract Despite its vast proliferation, the blockchain technology is still evolving, and witnesses continuous technical innovations to address its numerous unresolved issues. An example of these issues is the excessive electrical power consumed by some consensus protocols. Besides, although various media reports have highlighted the existence of objectionable content in blockchains, this topic has not received sufficient research. Hence, this work investigates the threat and deterrence of arbitrary-content insertion in public blockchains, which poses a legal, moral, and technical challenge. In particular, the overall aim of this work is to thoroughly study the risk of manipulating the implementation of randomized cryptographic primitives in public blockchains to mount kleptographic attacks, establish steganographic communication, and store arbitrary content. As part of our study, we present three new kleptographic attacks on two of the most commonly used digital signatures: ring signature and ECDSA. We also demonstrate our kleptographic attacks on two real cryptocurrencies: Bytecoin and Monero. Moreover, we illustrate the plausibility of hijacking public blockchains to establish steganographic channels. Particularly, we design, implement, and evaluate the first blockchain-based broadcast communication tool on top of a real-world cryptocurrency. Furthermore, we explain the detrimental consequences of kleptography and steganography on the users and the future of the blockchain technology. Namely, we show that kleptography can be used to surreptitiously steal the users' secret signing keys, which are the most valuable and guarded secret in public blockchains. After losing their keys, users of cryptocurrencies will inevitably lose their funds. In addition, we clarify that steganography can be used to establish subliminal communication and secretly store arbitrary content in public blockchains, which turns them into cheap cyberlockers. Consequently, the participation in such blockchains, which are known to store unethical content, can be criminalized, hindering the future adoption of blockchains. After discussing the adverse effects of kleptographic and steganographic attacks on blockchains, we survey all of the existing techniques that can defend against these attacks. Finally, due to the shortcomings of the available techniques, we propose four counter- measures that ensure kleptography and steganography-resistant public blockchains. Our countermeasures include two new cryptographic primitives and a generic steganography- resistant blockchain framework (SRBF). This framework presents a universal solution that deters steganography and practically achieves the right to be forgotten (RtbF) in blockchains, which represents a regulatory challenge for current immutable blockchains. i Declaration I hereby declare that the work in this thesis has not been submitted for a degree at any other university. I also certify that the work is entirely my own, and where otherwise, it is duly acknowledged and clearly cited. Signature: Nasser Alsalami - October 26, 2020 ii Acknowledgement This work would not have been completed without the help and support of many persons, to whom I would like to express my most profound appreciation. First and foremost, I would like to express my sincere and utmost gratitude to my supervisors, Prof. Bingsheng Zhang and Dr Antonios Gouglidis. Prof. Zhang's continuous guidance has greatly helped me in every step of this course. His constructive criticism and positive feedback have taught me beyond the subject of our research. Dr Gouglidis has contributed massively to the final year of my Ph.D. His generosity with his time and effort, which isbeyond description, has always inspired me to do my best. I would also like to gratefully recognize the invaluable input and professional assistance of my postgraduate appraisal monitor Dr Alistair Brown. Besides, I wish to extend my gratitude to all of my colleagues in Security Lancaster and all of the staff in the School of Computing and Communications. Words fall short for expressing my heartfelt thanks to my parents, whose love and support have motivated me throughout my studies and career. They are the role model that I strive to follow for their perfect selflessness and countless sacrifices. Moreover, I wish to thank my two kids, Ahmed and Aseela, whose innocence and playfulness have not only kept me going but made each day of this journey more joyful. They have had to stay away from their grandparents, cousins, and relatives, at times felt lonely, and had to put up with their continuously busy parents. For all of this, I sincerely thank them and hope that they can benefit from their experience during this time. Last but not least, I would like to wholeheartedly thank my wife, Arwa, who has made this work possible with her genuine altruism, unparalleled sincerity, and true love. iii Publications [AZ20]: N. Alsalami and B. Zhang. Uncontrolled randomness in blockchains: Covert \bullet bulletin board for illicit activity. In 2020 IEEE/ACM International Symposium on Quality of Service (IWQoS), June 2020. [AZ19a]: N. Alsalami and B. Zhang. SoK: A systematic study of anonymity in \bullet cryptocurrencies. In 2019 IEEE Conference on Dependable and Secure Computing (DSC), pages 1{9, Nov 2019. [AZ19b]: N. Alsalami and B. Zhang. Utilizing public blockchains for censorship \bullet circumvention and IoT communication. In 2019 IEEE Conference on Dependable and Secure Computing (DSC), pages 1{7, Nov 2019. iv Table of Contents Abstract i Declaration ii Acknowledgement iii Publications iv List of Figures ix List of Tables xi 1 Introduction 1 1.1 Overview . 1 1.2 Motivations, Aims, and Objectives . 4 1.3 Contribution . 7 1.4 Thesis Structure . 10 2 Background 12 2.1 Notations . 12 2.2 Preliminary Concepts . 13 2.2.1 Cryptocurrencies . 13 2.2.2 Cryptocurrency wallets . 14 2.2.3 Pseudo-random functions (PRF) . 15 2.2.4 Collision-resistant hash functions (CRH) . 15 2.2.5 Encryption algorithms . 16 2.2.6 Digital signatures . 17 2.2.6.1 ECDSA . 18 2.2.6.2 Ring signature . 18 2.3 Related Work . 22 v 2.3.1 Kleptography . 22 2.3.2 Steganography . 27 2.3.3 Content insertion in blockchains . 29 3 Kleptography in Blockchains 32 3.1 Kleptography . 32 3.2 Significance of Kleptography in Blockchains . 36 3.3 Kleptographic Attack on Ring Signature . 39 3.3.1 Security of kleptographic attack on ring signature . 43 3.4 Kleptographic Attacks on ECDSA . 43 3.4.1 Kleptographic attack-1 on ECDSA: synthetic randomness . 44 3.4.2 Kleptographic attack-2 on ECDSA: rejection sampling . 46 3.4.3 Security of attacks on ECDSA . 46 3.5 Kleptographic Attack Scenarios . 47 3.6 Realization of Kleptographic Attacks . 48 3.6.1 Kleptographic attack on Bytecoin . 49 3.6.2 Kleptographic attack on Monero . 53 3.6.3 Demonstration of kleptography on ECDSA . 55 3.7 Summary . 57 4 Steganography in Blockchains 58 4.1 Steganography . 58 4.2 Steganography in Blockchains . 61 4.2.1 Steganography from kleptographic attacks . 62 4.2.2 Repercussions of steganography on blockchains . 64 4.2.3 Steganographic attack scenarios . 66 4.3 Covert Broadcast Communication in Blockchains . 67 4.3.1 System requirement . 68 4.3.2 System architecture . 68 4.3.3 Skywhisper broadcast encryption . 69 4.3.4 Skywhisper wallet . 71 4.3.5 System operation . 75 4.3.6 Performance and security of Skywhisper . 76 4.4 Summary of Steganography in Blockchains . 79 5 Existing Countermeasures 81 5.1 Kleptography-Resistant Techniques . 82 5.1.1 De-randomization of algorithms . 82 5.1.2 Cascading cryptosystems . 83 5.1.3 Software integrity . 83 vi 5.1.4 Synthetically-random cryptographic primitives . 84 5.1.5 VRFs and controlled randomness . 85 5.1.6 Split-program model . 86 5.1.7 Interactive warden . 87 5.1.8 Reverse firewalls (RF) . 87 5.1.9 Self-guarding protocols . 88 5.2 Current Blockchain-Focused Techniques . 90 5.2.1 Lightweight blockchains . 90 5.2.2 Prunable blockchains . 91 5.2.3 Redactable blockchains . 92 5.2.4 Fees, filters, and self-verifying addresses . 92 5.3 Summary . 93 6 Proposed Countermeasures 95 6.1 Re-randomizable Cryptographic Primitives . 95 6.1.1 Randomizable bilinear-pairing-based ring signature (RRS) . 97 6.2 Aggregate Signatures . 100 6.3 Randomizable and Aggregatable Signature (RAS) . 102 6.4 Steganography-Resistant Blockchain Framework . 104 6.5 Summary of Countermeasures . 109 7 Conclusion and Future Work 110 7.1 Conclusion . 110 7.2 Future Work . 113 Bibliography 115 Appendix A Privacy in Cryptocurrencies 135 A.1 Tiers of Anonymity in Cryptocurrencies . 135 A.2 Privacy Techniques in Cryptocurrencies . 136 A.2.1 Pseudonymous addressing . 136 A.2.2 Ring signatures . 139 A.2.3 Mixers . 140 A.2.4 Commitments . 141 A.2.5 Non-interactive zero-knowledge proofs . 142 A.2.6 Stealth addressing . 144 A.3 Summary of Privacy in Cryptocurrencies . 144 Appendix B Case study: Bytecoin Wallet Bug 146 vii Appendix C Security Proofs 148 C.1 Security proof of Theorem 3.1 . 148 C.2 Security proof of Skywhisper (Theorem 4.1) . 150 C.3 Security proof of RRS ..............................151 C.4 Proof of Dis-aggregation of BGLSAggregateSignature . 153 C.5 Security Proof of RAS ..............................154 viii List of Figures 1.1 Thesis roadmap . 10 2.1 ECDSA signature scheme . 18 2.2 CryptoNote ring signature . 20 3.1 Kleptography/ASA . 33 3.2 Kleptographic attack example: IV replacement . 33 3.3 Kleptography security experiment on subverted signatures . 35 3.4 Generic kleptographic attack on CryptoNote. 40 3.5 Ciphertext stealing CTS (CTR mode) . 41 3.6 Pseudo-code for a generic kleptographic attack on CryptoNote . 42 3.7 Kleptographic attack-1 on ECDSA ...................... 44 3.8 Kleptographic attack-2 on ECDSA ...................... 45 3.9 Subversion attack on crypto wallets .