A Secure Model Based on Symmetric Encryption for REST API in Data Integration
A Secure Model Based on Symmetric Encryption for REST API in Data Integration
Abstract— Data integration is currently demanding by [13-14]. However, solution above is still considerable
organizations to extract the data from different data sources. A inefficient in term of response time. A few websites such as
unified view of data structure is needs to allow the organization Google, Facebook and Twitter are currently used REST API
to access this data sources. REST API one of the solutions can approach because of easy and fast data transmission [13].
be used to allow application send or share the data to other
applications via the network. However, the data transmission Meanwhile, another issue in how to secure data
via network will be exposed to unauthorized users or hacker to transmission among applications. A symmetric encryption is
access or modified the data. A symmetric encryption can be used one of the solutions to encrypt the data into ciphertext before
as a secure model for data transmission via the network. Three transmitting to another applications [20]. A few algorithms
processes are involved in this secure model. There are encrypt can be used in symmetric encryption such as Blowfish, DES,
plaintext to ciphertext using combination of keys, decrypt the 3DES, RC4 and Blowfish [21-22]. 3DES is the most powerful
ciphertext to plaintext using combination of keys, and dump encryption because of using 3 different keys as a secret
data in plaintext. In this paper, two applications have been compared to others [2].
developed for data exchanges or data transmission purposes.
SAP system send the data in JSON format by encrypted into In this research, we proposed REST API using JSON
ciphertext using unique key and three different keys to FEMS format for data transmission among application. Meanwhile,
system. FEMS system will be decrypted ciphertext by using modification of 3DES encryption will be used to encrypt data
same unique key and three different key to produce plaintext in in JSON format into ciphertext to another application.
JSON format. The data in JSON format will be exploded. Then,
the data will be dumped into database FEMS. Based on the Section II will be explained the definition REST API.
implementation, REST API and symmetric encryption have Section III will be explained about symmetric encryption. A
been successfully used for data transmission between SAP and proposed data transmission using REST API and secure data
FEMS and encrypt the data in JSON to ciphertext using transmission using symmetric encryption will explain
modification 3DES encryption. described in Section IV. Meanwhile, implementation and
result will be explained in Section V. Lastly, a conclusion will
Keywords— Data integration, JSON, REST API, Symmetric be discussed in Section VI.
encryption
II. REST API
I. INTRODUCTION
Thomas Fielding was introduced the REST architecture
The purpose of data integration is to provide a unified based on the principles that support the World Wide Web in
view of the data extraction or combination from different data the year 2000 [15]. REST is based on Uniform Resource
sources applications [1-3]. Two issues in data integration have Identifiers (URI) to detect a message transfer detect via
been identified which are different database schema and security Hypertext Transfer Protocol (HTTP) [16-18].
issue in data transmission among applications [1-2].
One of the REST components is an API (Application
A few models have been applied in data integration to Programming Interface). The purpose of API is to provide
provide a unified view such as Resource Description easy and fast client-server communications for Web
Framework [5], Extensible Markup Language (XML) [7][8], Applications over the HTTP protocol. REST are design with
Relational Database Model [4], Object Exchange Model [6], three main principles: addressability, uniform interface, and
Native XML [9], XML- Enables [10], Hybrid XML [11] and statelessness [18]. Endpoints for each URL will be verified
JavaScript Object Notation (JSON) [12]. JSON model is by REST for data extraction purposes [19]. The common
proved fast and efficient for data exchange compared to functions in API such as CRUD (Create, Read, Update,
others [12]. Delete) which are correspond to the mostpopular functions
A suitable approach is needs to allow data transmission [18] INSERT, SELECT, UPDATE, and DELETE in SQL.
among applications which are using different platforms [13]. Ajax query can be used in REST server to execute a
Application Programming Interface (API) such as common response by produce a data in JSON (JavaScript
Representational State Transfer (REST), A Simple Object Object Notation) format. In REST, JSON and XML format is
Access Protocol (SOAP) or Remote Procedure Call (RPC) usually used for data exchange among applications.
can be as a gateway for data transmission among applications
Authorized licensed use limited to: Universitas Indonesia. Downloaded on September 15,2024 at 15:08:22 UTC from IEEE Xplore. Restrictions apply.
979-8-3503-4210-9/23/$31.00 ©2023 IEEE 402
2023 27th International Computer Science and Engineering Conference (ICSEC)
III. SECURE SOCKET LAYER (SSL) B. Triple or Data Encryption Standard (3DES)
Secure Socket Layer (SSL) is a protocol in the field of It is an enhanced form of double DES algorithm. The
cryptography for data security purposes [28]. A symmetric main reason of 3DES is to replace DES because of not strong
chipper is used to ensure the confidentiality of information, enough to prevent a meet-in-the-middle attack [2].
data verification codes for the integrity of messages. Data First option is to use three different keys for the
exchange is protected through encryption and authentication. encryption algorithm to generate cipher text on plaintext
The advantage of this protocol is the use of its embedded message t.
security features to secure insecure application layer protocols
such HTTP and HTTPS [29]. Cryptographic algorithms are C(t) = Ek1 (Dk2 (Ek3 (t)))
applied to plain text that is supposed to pass through an
insecure communication channel such as the Internet and where C(t) is the cipher text of plaintext message t, Ek1 is the
ensures that are kept confidential throughout the transmission
encryption method using key k1, Dk2 is the decryption
channel.
method using key k2 and Ek3 is the encryption method using
IV. SYMMETRIC ENCRYPTION key k3.
Symmetric encryptions are using secret key for
Another option is to use two different keys for the encryption
encryption and decryption data [20]. In this approach, sender
and receiver are share same key for encryption and algorithm. This reduces the memory requirement of keys in
decryption data. In this approach also, input data are divided TDES.
into two parts. C(t) = Ek1 (Dk2 (Ek3 (t)))
First is block cipher-based systems, which is the data is TDES as the strongest encryption algorithm which gives its
being processed or encrypted on a fixed-length group of bits application in banking industry. However, the disadvantage
called a block. The second is stream cipher-based systems of this algorithm is that it is too time consuming [25].
which is data is being processed on a stream of bits. Fig. 1
illustrates the process of symmetric encryption. C. Advance Encryption Standard (AES)
A variable key length of 128, 192 and 256 bits has been
used in AES [26]. AES will perform 9 processing rounds if
both the block length and key length are 128 bits. However,
AES performs 11 processing rounds if the block and key are
of 192 bits and 13 processing rounds if the block and key are
of length 256-bits.
Authorized licensed use limited to: Universitas Indonesia. Downloaded on September 15,2024 at 15:08:22 UTC from IEEE Xplore. Restrictions apply.
403
2023 27th International Computer Science and Engineering Conference (ICSEC)
V. A SECURE MODEL FOR REST API applications will be explained. Fig. 6 show how SAP system
This section will be explained about hybrid secure model send the data to FEMS system. In this figure, SAP will send
a data in JSON format, and convert it into ciphertext using
based on 3DES and blowfish algorithm for data transmission
modification of 3DES encryption to FEMS system. After
in REST API. In this model, three secret keys will be
FEMS received the data in ciphertext, FEMS will use unique
generated randomly to encryption plaintext to ciphertext. key and 3 different keys to decrypt ciphertext to plaintext in
Then, the ciphertext will be decrypted by using same secret JSON format.
keys. The purpose of this model is to avoid any data altering
by unauthorized users/hackers in the networks during data
transmission.
A. Encryption process
In this process, plaintext will be encrypted using combination
of unique key, key 1, key 2 and key 3. Fig. 7 shows the sample
Fig. 2: A secure data transmission model via SSL of plaintext in JSON format.
A. Generate Random - Secret Key {
"PurchaseOrder": [
Input: n & char {
Steps: "EBELN": 4400019951,
Assign n = 5; "LIFNR": 100006334,
Assign char = “0123456789ABCDEFGHIJPQRSTUVWXYZ”; "LIFNR_NAME": "ASTRA SIMFONI SDN BHD",
for ($i=0; $i<3; $i++) { // loop 3 times to produce unique keys "BEDAT": 20220223,
for ($i=0; $i<$n; $i++) { "UNSEZ": "Test2302-1",
$index = rand (0, strlen($char) - 1) "WAERS": "RM",
$key .= $char[$index]; "Items": [
} {
} "EBELP": "00010",
UK = $index.$key; "MATNR": 95000093,
Output: Unique Key (UK) "MAKTX": "9 KG ABC DRY POWDER",
"MENGE": "10.000 ",
Fig. 3: Random key algorithm "MEINS": "UN",
"WERKS": 6600,
B. Encryption Plaintext to Ciphertext "WERKS_NAME": "FGV Security Services Sdn. B",
"NETPR": "790.00 "
Input: Plaintext (P), Unique Key (UK), k1, K2, K3 }, {
Steps: "EBELP": "00020",
A → Encryption of P using K1 + UK. "MATNR": 95000120,
B → Decryption of A using K2 "MAKTX": "4 KG ABC DRY POWDER",
C → Encryption of B using K3 "MENGE": "5.000 ",
Output: Ciphertext (C) "MEINS": "UN",
"WERKS": 6600,
Fig. 4: Encryption algorithm "WERKS_NAME":
"FGV Security Services Sdn. B", "NETPR": "350.00 "
C. Decryption Ciphertext to Plaintext },
Fig. 7: Plaintext in JSON format
Input: Ciphertext (C)
Steps: Let unique key equal to 34333AFHG and key 1 equal to
B → Decryption of C using K3 45Ths. The first process is encrypting plaintext by using
A → Encryption of B using K2 unique key and key 1. After that, produce the result as below:
P → Encryption of A using K1 + UK
-
Output: Plaintext (P)
A = sfdsfdssd3324322sssaaaa…...
Fig. 5: Decryption algorithm
Let key 2 equal to 3dsGGH, then the second process is to
VI. IMPLEMENTATION AND RESULT decrypt A by using key 2. After that, the result as below: -
In section, the implementation of secure data
transmission using REST API to allow data sharing among B = dsdsasdsadsd932432432432432432aaere……
Authorized licensed use limited to: Universitas Indonesia. Downloaded on September 15,2024 at 15:08:22 UTC from IEEE Xplore. Restrictions apply.
404
2023 27th International Computer Science and Engineering Conference (ICSEC)
C = 4543aasasa93asdsda4s432432ABvTr……
B. Decryption process
In this process, ciphertext will be decrypted using
combination of unique key, key 1, key 2 and key 3.
Let key 3 equal to 54aFgt, then the first process is to decrypt
C by using key 3. After that, the result as below: -
B = dsdsasdsadsd932432432432432432aaere……
Authorized licensed use limited to: Universitas Indonesia. Downloaded on September 15,2024 at 15:08:22 UTC from IEEE Xplore. Restrictions apply.
405
2023 27th International Computer Science and Engineering Conference (ICSEC)
[8] D. Suciu, “Semistructured data and XML,” Book: Information [20] M. N. Alenezi, H. N. Alabdulrazzaq, Q. Mohammad, “Symmetric
Organization and Databases: Foundations of Data Organizations, pp. Encryption Algorithms: Review and Evaluation study,” International
9 – 30, 2001. Journal of Communication Networks and Information Security
[9] L. Papaleo, “Intoduction to XML and its applications,” Research in (IJCNIS), 12(2), pp. 256 – 272, 2020.
Semantic Web Technologies, pp. 1 – 32, 2013. [21] M. U. Bokhari, Q. M. Shallal, “A Review on Symmetric Key
[10] S. Balamurugan, A. Ayyasamy, “Performance evaluation of native Encryption Techniques in Cryptography,” International Journal of
XML database and XML enable database,” International Journal of Computer Applications, 147(10), pp. 43 – 48, 2016.
Advanced Research in Computer Science and Software Engineering. vol. [22] S. Chandra, S. Bhattacharyya, S. Paira, S. S. Alam, “A Study and
7, no. 5, 2017. Analysis on Symmetric Cryptography,” International Conference on
[11] A. M. Saba, E. Shahab, H. Abdolrahimpour, M. Hakimi, A. Moazzam, Science, Engineering and Management Research (ICSEMR 2014),
“A comparative analysis of XML documents, XML enabled databases 2014.
and native XML databases,” Computer Science: Databases, 2017. [23] M. Agrawal, P. Mishra, P, “A comparative survey on symmetric key
[12] G. M. P. Lazetic, “Native XML Databases vs. Relational Databases in encryption techniques,” International Journal on Computer Science
Dealing with XML Documents,” Kragujevac J. Math. vol. 30, pp. 181 and Engineering (IJCSE), 4(5), pp. 877 – 881, 2012.
– 199, 2007. [24] D. Salama, A. Minaam, H. M. Abdual-Kader, M. M Hadhoud,
[13] Z. M. Liru, O. Tadashi, H. Mamoru, “Keyword search over hybrid “Evaluating the Effects of Symmetric Cryptography Algorithms on
XML-Relational Databases,” SICE Annual Conference, Aug 20 – 22, Power Consumption for Different Data Types,” International Journal
2008. of Network Security, pp. 78-87, 2010.
[14] S. C. Haw, C. S. Lee, “Efficient Preprocesses for Fast Storage and [25] O. P. Verma, R. Agarwal, D. Dafouti, S. Tyagi, “Peformance Analysis
Query Retrieval in Native XML Database,” IETE Technical Review, Of Data Encryption Algorithms,” IEEE Delhi Technological
26(1), pp. 28 – 40, 2014. University India, 2011.
[15] M. Maleshkova, C. Pedrinaci, J. Domingue, “Investigating Web APIs [26] A. M. Abdullah, “Advanced Encryption Standard (AES) Algorithm to
on the World Wide Web,” Eighth IEEE Euro- pean Conference on Web Encrypt and Decrypt Data,” Cryptography and Network Security,
Services, pp. 107–114, 2010. 2017.
[16] R. T. Fielding, “Architectural Styles and the Design of Network-Based [27] V. Parihar, M. A. Kulshrestha, “Blowfish Algorithm: A Detailed
Software Architecture,” Univ. of California, Irvine, 2000. Study,” International Journal For Technological Research In
Engineering, 3(9), pp. 2253 – 2255, 2016.
[17] F. Bulthoff, M. Maleshkova, M, “RESTful or RESTless – Current State
of Today’s Top Web APIs in The Semantic Web,” ESWC 2014 [28] O. Purchina, A. Poluyan, D. Fugariv, “Improving the security level of
Statelite Events, pp. 64 – 74, 2014. the information system using the SSL protocol,” Web of conferences,
371, 03067, 2023, doi: 10.1051/e3sconf/202337103067
[18] R. Battle, E. Benson, “Bridging the semantic Web and Web 2.0 with
Representational State Transfer (REST),” Web Semant. Sci. Serv. [29] R. Dastres, M. Soori, “Secrue socket layer in the network and web
Agents World Wide Web, 6(1), pp. 61 – 69, 2008. security,” International journal of computer science and information
engineeringm, 14(10), pp. 330 – 333, 2020.
[19] B. Costa, P. F. Pires, F. C. Delicato, P. Merson, “Evaluating a
Representational State Transfer (REST) Architecture: What is the
Impact of REST in My Architecture?,” IEEE/IFIP Confer- ence on
Software Architecture, pp. 105–114, 2014.
Authorized licensed use limited to: Universitas Indonesia. Downloaded on September 15,2024 at 15:08:22 UTC from IEEE Xplore. Restrictions apply.
406