# Implementation of an Attribute-Based Encryption Scheme Based on SM9
###### Abstract  
In recent years, attribute-based encryption (ABE) has been widely applied in mobile computing, cloud computing, and the Internet of things, for supporting flexible and fine-grained access control of sensitive data. In this paper, we present a novel attribute-based encryption scheme that is based on bilinear pairing over Barreto and Naehrig curves (BN-curves). The identity-based encryption scheme SM9, which is a Chinese commercial cryptographic standard and a forthcoming part of ISO/IEC11770-3, has been used as the fundamental building block, and thus we first introduce SM9 and present our SM9 implementation in details. Subsequently, we propose the design and implementation of the ABE scheme. Moreover, we also develop a hybrid ABE for achieving lower ciphertext expansion rate when the size of access structure or plaintext is large. The performance and energy consumption of the implementation of the proposed ABE and its hybrid version are evaluated with a workstation, a PC, a smart phone, and an embedded device. The experimental results indicated that our schemes work well on various computing platforms. Moreover, the proposed schemes and their implementations would benefit developers in building applications that fulfill the regulatory compliance with the Chinese commercial cryptographic standard since there is no existing ABE scheme compatible with any Chinese cryptographic standard. attribute-based encryption; identity-based encryption; SM9; BN-curves; bilinear pairing 1  
Y. Shi 1  
of the ciphertext, which implies that only the users who satisfy the specified attributes can decrypt the ciphertext. The resource providers only need to encrypt messages according to the decryptors' attributes, without taking care of their identities and the number of qualified decryptors. This feature significantly reduces the overhead of data encryption and enables resource providers to formulate flexible and scalable access control policies to manage the sharing range of data. The first ABE scheme [3] only supports threshold access control strategies. The community further proposed key-policy ABE [4] and ciphertext-policy ABE to support more flexible access control strategies [5]. In recent years, a number of novel ABE schemes have been proposed with distinct security features [6; 7; 8; 9]. Moreover, specialized ABE schemes for various application scenarios such as cloud computing [10; 11; 12], social networks [13], Internet of things (IoT) [14; 15; 16], blockchains [17; 18], and mobile computing [19; 20], have been proposed. In this paper, we propose an ABE scheme utilizing SM9 IBE as a building block. SM9 is a cryptography standard that defines a set of identity-based cryptographic schemes, including signature, encryption, and key agreement. It originates from a Chinese cryptographic standard [21], and then its signature scheme has been adopted by the International Organization for Standardization as ISO/IEC 14888-3:2018 [22]. Currently, its encryption scheme and key agreement scheme have been formally reviewed as proposals for ISO/IEC 18033-5 [23] and ISO/IEC11770-3 [24], respectively. There is no ABE scheme that is compatible with any Chinese cryptographic standard, as well as the forthcoming ISO standard. Therefore, the proposed ABE scheme is fully compatible with the Chinese standard and the forthcoming international standard to fulfill the regulatory compliance. The SM9 IBE is efficient and bandwidth-saving; for example, it performs better than the ISO/IEC 18033-5 [23] in terms of both computational efficiency and ciphertext size [25]. Our ABE scheme inherits such features of SM9 IBE. The scheme is implemented in Java, and experimental results on PCs, smart phones, and embedded devices indicated that our scheme performs well on typical platforms. As a building block, the SM9 IBE scheme, which is based on bilinear pairings over the prime order elliptic curves that were proposed in [26] (i.e., BN-curves), has been implemented at first.