https://doi.org/10.31449/inf.v44i2.3090 Informatica 44 (2020) 115–125 115 Privacy Preserving Visual Log Service with Temporal Interval Query using Interval Tree-based Searchable Symmetric Encryption Viet-An Pham, Dinh-Hieu Hoang, Huy-Hoang Chung-Nguyen, Mai-Khiem Tran and Minh-Triet Tran Faculty of Information Technology - Software Engineering Lab - University of Science, VNU-HCM E-mail: pvan@apcs.vn, hdhieu@apcs.vn, cnhhoang@apcs.vn, tmkhiem@selab.hcmus.edu.vn, tmtriet@fit.hcmus.edu.vn Keywords: searchable symmetric encryption, temporal interval query, visual concept extraction Received: March 15, 2020 Visual logs become widely available via personal cameras, visual sensors in smart environments, or surveil- lance systems. Storing such data in public services is a common convenient solution, but it is essential to devise a mechanism to encrypt such data to protect sensitive information while enabling the capability to query visual content even in encrypted format at the services. More precisely, we need smart systems that their security and practicality must be balanced against each other. As far as we know, in spite of their importance in preserving personal privacy, such reliable systems have not gained sufficient attention from researchers. This motivates our proposal to develop a smart secure service for visual logs with a tempo- ral interval query. In our system, visual log data are analyzed to generate high-level contents, including entities, scenes, and activities happening in visual data. Then our system supports data owners to query these high-level contents from their visual logs at the server-side in a temporal interval while the data are still encrypted. Our searchable symmetric encryption scheme TIQSSE utilizes interval tree structure and we prove that our scheme achieves efficient search and update time while also maintaining all important security properties such as forward privacy, backward privacy, and it does not leak information outside the desired temporal range. Povzetek: Problem uravnoteženja proizvodne poti je predstavljen odprto, brez omejitev npr. števila delavcev, zato je izviren. Avtorji testirajo veˇ c algoritmov in predlagajo najboljšega. 1 Introduction In daily activities, people usually take photos and record video clips to capture moments and events in their lives. Besides, with the booming trend of developing smart inter- active environments, such as smart homes, offices, or even cities, visual sensors are densely integrated to our habitats to record then analyse external contexts, such as monitoring users, objects, activities, etc. Consequently, visual lifelogs become increasingly available and are usually uploaded to store in online storage services. In this paper, we target two challenging problems to bet- ter develop an online storage service for private visual data: (i) to search photos or video clips based on their content, and (ii) to protect private data leakage at server-side acci- dentally or intentionally. First, we aim to bridge the gap between visual data and their semantics by allowing data owners to search with key- words. Each photo or frame in a video clip is processed to extract high-level concepts, including entities, scene at- tributes, activities, etc. Different types of high-level con- cept extractors can be plugged into our framework to meet specific requirements in real applications. Consequently, a photo or video frame can be considered as a document or a set of concepts, which are ready to be retrieved by key- words. We also demonstrate a prototype smart edge cam- era which can be re-configured remotely to generate visual data with associated extracted concepts. Second, a typical solution to protect data secrecy is to encrypt before uploading data to an online storage server. However, after encryption, data are no longer suitable to be searched normally. Symmetric Searchable Encryption (SSE), first proposed by Song et al. [23], can be used as a promising solution to privately save data while maintaining the ability to search in a collection of encrypted records. We adopt the approach of SSE in our proposed solution, and carefully design it to ensure the property of a dynamic SSE [13], i.e. to add, update, and delete data efficiently without re-encrypting the whole database. Besides, we also consider the forward and backward pri- vacy criteria for SSE. Informally, the former means that an update query does not leak information if a newly added document contains keywords that were searched in the past, while the latter is to make sure that it is impossible to re- trieve data from deleted files. Forward privacy has been receiving a lot of attention, while backward privacy is only studied in recent years. Most of the existing schemes suf- fer from key-size overgrowing after deletion queries [2, 4], thus limits the practicality of these schemes. Moreover, in particular cases, there are new security 116 Informatica 44 (2020) 115–125 V .-A. Pham et al. properties that must be satisfied: search only in a tempo- ral interval, and do not leak any information outside of the requested range. For example, a police wants to check the private security camera of a company from a range of time for a criminal event. The company wants to provide the information exactly from the requested range and not leak any information from other temporal intervals. A similar problem is when we want to search for some disease in a medical database in a temporal interval, it is best to prevent leaking information of patients in other time. This moti- vates us to define Temporal Interval Query SSE (TIQSSE), a new SSE problem to search by keywords for documents in a particular temporal interval. This work is the extension paper of previous TIQSSE work [20], with more in-depth explanations and analysis. This paper is also a significantly enhanced version of [7]. Our previous work only guarantees a one-sided access pat- tern. For more clarity, the one-sided access pattern means that it can only preclude adversaries from extracting in- formation about the documents that were added after the queried interval, while still leaking information of doc- uments that were added before the requested range. In this paper, there is a great improvement on security since our SSE scheme now guarantees two-sided access pattern, which means it also prevents adversaries from gaining in- formation of added documents. Our newly defined problem is different from the existing range query SSE schemes [1, 14]. In a range query SSE scheme, a server returns every document whose key/iden- tifier is in a queried range. In our temporal interval SSE problem, the server only examines documents whose iden- tifiers are inside the temporal interval to select the docu- ments containing a query keywordw. Our secure SSE scheme does not suffer from key-size overgrowing after sufficient deleting queries like previous schemes. Our idea is based on o’o& from Raphael Bost et al. [2] in 2016 and modifies it to match our problem. Al- though there are many improved constructions later [4, 24], these ideas are not suitable for our problems that the use cases we target require efficient deletion operations which (1) have an acceptable time complexity and (2) do not in- crease server-side usage. Our main contributions in this paper are as follows. – We propose a solution for a public visual data stor- age service to assist data owners to search their pho- tos and video clips with keywords, i.e. concepts ex- tracted from visual content, and preserve data pri- vacy in query and data manipulation (insert, update, delete). We also develop a prototype smart edge cam- era to handle concept extraction for recorded photos or video clips. – We also define TIQSSE as a new SSE problem to search with encrypted documents in a temporal in- terval while preventing data leakage outside the re- quested range. We then propose an efficient solution to search for a keyword in documents within a deter- mined time range and achieves both forward and back- ward privacy. In Section 2, we briefly review approaches and methods related to the two main aspects of our work, visual retrieval with concepts, and searchable symmetric encryption. We propose a smart secure framework for visual data storage service and smart edge camera in Section 3. in Section 4, We review the necessary preliminaries of cryptography, then define the novel TIQSSE problem. Our scheme which tackles this problem is introduced in Section 5. The secu- rity analysis of our proposed scheme is presented in Section 6. In Section 7, we draw our conclusion and discuss some fascinating directions for future works. 2 Related work 2.1 Visual retrieval with semantic concepts Visual log retrieval is one of the important problems to analyse and understand visual content. Different ap- proaches have been proposed to provide users with var- ious modalities to input queries and get retrieved results [17, 18, 26]. Visual semantic concepts from images are usually used as tags or keywords for interactive retrieval systems[26, 25]. The concepts can be detected using avail- able APIs, such as Google Cloud Vision API, or pre-trained object detectors, such as Yolo [21], FasterRCNN [22], etc. Besides, scene attributes and categories [30] can be ex- tracted from images to augment further environmental in- formation of visual data[25]. Some works also utilize cap- tioning [27] or activity recognition to capture the dynamic nature of an image or video clip[16, 15]. In this work, we propose to integrate different concept extractors to create the associated metadata for each photo or video clip stored in the smart visual service. We also develop a prototype smart edge camera that can locally ex- tract concepts in certain tasks before uploading visual data to online storage service (see Section 2.1). 2.2 Searchable symmetric encryption Song et al. [23] first proposed a solution to Searchable Symmetric Encryption in 2000. Although the first SSE scheme was not efficient, it provided a solid foundation for the problem. Many works were proposed [10, 6] to im- prove search time and security. However, leakage problems in SSE were not formally defined. Curtmola et al. [8] were the first to explicitly define the general acceptable leakage criteria for SSE problems, including search patterns and ac- cess patterns that are frequently used several years later. Although the previous schemes were optimal in search time, there was no way to update a database without re- encrypting the whole database. To remove this limitation, in 2012, dynamic SSE was proposed by Kamara et al. [13]. Their scheme can efficiently add or remove files with the trade-off by leaking some information when those queries Privacy Preserving Visual Log Service with. . . Informatica 44 (2020) 115–125 117 are executed. In particular, forward privacy and backward privacy are not fully satisfied. SSE problem is continuously studied and improved. Raphael Bost achieved forward privacy in 2016 [2], and also achieved backward privacy one year later [4]. In 2018, Sun et al. [24] proposed Puncturable Symmetric Encryp- tion to construct and improve backward secure. Unfortu- nately, all schemes mentioned above not only suffer from key-size overgrowing after many deleting queries, but also do not support range query property that we need. Other than proposing new SSE constructions, many ef- forts were made to attack the proposed security models. Some notable works are inference attacks on deterministic encryption (DTE) and order-preserving encryption (OPE) [19, 11], leakage-abuse attacks [5, 3, 11, 12] and File- Injection attacks [29, 12]. Before us, there are many works about range queries. However, they all are different from ours. Their solution is used for indexing in relational databases and return entities that have acquired attributes within some range, while in our scheme, we need to return all the files containing the searched keyword in a period. 3 Smart secure framework for visual data storage service In this section, we present our proposal for a smart secure framework for a visual data storage service. We are in- spired by the idea of edge computing to shift the concept extraction task toward the smart camera. There has been an ongoing interest on this shift, particularly from privacy- aware users due to recent breaches in data centers, where sensitive user data is processed and may be used for ma- licious purposes. If the process is on users’ premise, they will have more control over the data that is generated. 3.1 Smart edge camera with concept extraction Figure 1 illustrates the process for concept extraction from photos/clips in a smart edge camera before uploading vi- sual data with their associated metadata to the secure vi- sual service. Different modules for various concept types can be deployed in the smart edge camera, such as object detection, person recognition, action recognition, scene at- tribute, category classification, and image captioning. In our prototype, we utilize NVIDIA Jetson Nano em- bedded computers with dedicated 128 Maxwell CUDA cores to handle various machine learning tasks. Our smart edge camera prototype can be specialized for various spe- cific tasks with different models to be deployed and up- dated (see Figure 2). In our model repository, not only there are existing pre-trained models, such as ResNet-50, MobileNet-v2, SSD ResNet-18, SSD Mobilenet-V2, Tiny YOLO V3, but we also prepare our own custom models for other tasks, such as custom object detectors for contexts Visual Content Analysis Object Detection Person Recognition Scene Classification Scene Attribute Extraction Action Recognition Image Captioning Smart Edge Camera Secure Visual Service Photo/ Clip {Keyword} Associated Concepts ……… Figure 1: Concept extraction from photos/clips in a smart edge camera. originated from Vietnam or image captioning with concept augmentation [27]. Future custom models can also be created and further optimized with various techniques such as quantization, fu- sion, and scheduling available in NVIDIA TensorRT SDK, then deployed to the smart camera. Due to its cloud nature, the devices’ software can be remotely updated, and addi- tional machine learning models can be added in a secure manner. Model Manager Model Deployment Pretrained Model Repository Pretrained Model Retrieval Custom Model Uploader Smart Edge Camera Custom Model Figure 2: Model update for an edge camera. 3.2 Components in a smart secure visual system We propose a scenario in which a system collects, pro- cesses, and synchronizes the data from various cameras, including the proposed smart edge ones, to a visual data server that utilizes our proposed secure scheme for SSE. Figure 3 illustrates the three key components of the sys- tem: a storage and query processing server, camera nodes, and query nodes. Decrypt User data User data Encrypt Pre-shared key Remote Node Synchronize Retrieve User data User data Pre-shared key Decrypt User Query Node Storage Server Administrator User data Search Figure 3: Main components in smart secure visual system. 118 Informatica 44 (2020) 115–125 V .-A. Pham et al. In our system, the storage and query processing server supports multiple users, and the server owner can be dif- ferent from the data owners. The owners of the server can fully examine the stored data, but are expected not to un- derstand or to exploit useful information from stored data. Thus, to ensure this crucial property of our visual system, i.e. preserving data privacy for data owners, we define a new problem of Temporal Interval Query SSE (in Section 4) and propose an efficient solution for this problem (in Section 5). A user, after signing up, is provided a means to sub- mit and retrieve data over commonly utilized protocols, such as HTTP SSL, SMB, or SFTP. Querying is done over an API with a common contract protocol implemented in gRPC, a protocol buffer library that utilizes HTTP2 over an SSL Channel. With gRPC’s wide adoption status across numerous languages and libraries, the implementation is relatively easy and open for everyone. Connections to the server are secured with the server’s certificate by default. We assume this certificate is self-signed and pre-installed on every query node via personal trusted channels before- hand. A user usually plays both roles as a generator party at upload time from a camera node and a querying party at retrieve time from a query node, which can be his or her mobile device. Thanks to the loosely coupled architec- ture, our proposed system allows new users to dynamically join in without any interruptions on the server-side using a streamlined user interface. 4 Temporal interval query searchable symmetric encryption In this section, we first provide background knowledge that includes several cryptographic primitives and the dynamic SSE problem. Then we introduce the definition and secu- rity properties for TIQSSE. 4.1 Preliminaries For consistency in presentation, we denotes: – x $ f 0; 1g n as randomizingn bits then store the re- sult tox. – n as the number of added files. F n as the n-th file. EF n as the encrypted file corresponding toF n . –? as null or empty. as the security parame- ter. Security parameter means that unless specified explicitly, the keys used in SSE scheme is -bit in length, and the probability for an adversary to break the scheme is 2 . We use several cryptographic primitives from Dan Boneh and Victor Shoup [9] which includes: negligible function, pseudo random generator (PRG), pseudo ran- dom function (PRF), simulator, and symmetric encryp- tion. For the symmetric encryption, we denote the encryp- tion of plaintext m with secret key sk as SE:enc(sk;m), and the decryption of ciphertext c with secret key sk as SE:dec(sk;c). We also inherit the idea of trapdoor permutation from Bost et al. [2] and denote the function as . For- mally: One can compute ofp 1 with the secret keyK s : p 2 (K s ;p 1 ). Givenp 2 in ’s proper, one can derive the original p 1 with the public key: p 1 1 (K p ;p 2 ). Finally, for all p we have p = (K s ; 1 (K p ;p)) = 1 (K p ; (K s ;p)). 4.2 Dynamic symmetric searchable encryption In SSE, we view the database as an array of files F = (f 1 ;f 2 ;:::;f n ) where f i consists of multiple words (w 1 ;w 2 ;:::;w mi ). Later when the client request a search on keywordw, the client obfuscate or encryptw into trap- doorT and give it to server. The server when receivingT must return a list of result identifiersR = (id 1 ;id 2 ;:::;id r ) such that when returned to the client, for everyi we have w2 F idi . It is notable that the act of obfuscatingw into T is essential because it hides the original keyword from the server, in this paper we call this as trapdoor generation procedure. In other words, dynamic SSE consists of one algorithm Setup and two protocolsSearch andUpdate. – InSetup phase, the client creates some keys and key- pairs that will be used in the other 2 protocols. – TheSearch protocol consists of multiple interactions between client and server when the client request a search. For each client’s request, the server should receive the trapdoorT and return a list of files as we mentioned in the above paragraph. – TheUpdate protocol is comprised of 2 types of up- dates which is add a new file and delete an existed file. Depending on which update protocol, the en- crypted database on the untrusted server will be mod- ified based on the SSE scheme. Correctness. An SSE iscorrect if the probability that the search protocol returns the false results to client is neg- ligible. Security. The SSE scheme is said to be adaptively secure, if for any adversaryA who issues a polynomial number of queries q( ), there exist a polynomial-time sim- ulatorS such that: jP [SSEReal A (;q ) = 1] P [SSEIdeal A;S;L (;q ) = 1]j