Encryption and Decryption of Data Replication Using Advanced Encryption Standard (Aes)
Total Page:16
File Type:pdf, Size:1020Kb
ENCRYPTION AND DECRYPTION OF DATA REPLICATION USING ADVANCED ENCRYPTION STANDARD (AES) FARAH ZURAIN BINTI MOHD FOIZI BACHELOR OF COMPUTER SCIENCE (COMPUTER NETWORK SECURITY)WITH HONOURS UNIVERSITI SULTAN ZAINAL ABIDIN 2018 ENCRYPTION AND DECRYPTION OF DATA REPLICATION USING ADVANCED ENCRYPTION STANDARD (AES) FARAH ZURAIN BINTI MOHD FOIZI Bachelor of Computer Science (Computer Network Security) with Honours Faculty of Informatics and Computing Universiti Sultan Zainal Abidin, Terengganu, Malaysia 2018 DECLARATION It is declared that the project titled Enryption and Decryption of Data Replication Using Replication using Advanced Encryption Standard (AES) algorithm is originally proposed by me. However, further research and exploration onto this project is granted and encourage for contribution upon this topic. __________________________ (Farah Zurain Binti Mohd Foizi) BTBL15041003 Date: ii CONFIRMATION This project entitle Encryption and Decryption of Data Replication using Advanced Encryption Standard (AES) was prepared and submitted by Farah Zurain binti Mohd Foizi, matric number BTBL15041003 has been satisfactory in terms of scope, quality and presentation as a partial fulfilment of the requirement for Bachelor of Computer Science (Computer Network Security) in University Sultan Zainal Abidin (UniSZA). Signature : ……………………… Supervisor : ……………………… Date : ……………………… iii DEDICATION In the name of Allah, the Most Gracious and the Most Merciful, Alhamdulilah thanks to Allah for giving me the opportunity to complete the Final Year Project proposal report entitles “Encryption and Decryption of Data Replication Using Advanced Encryption Standard (AES)”. I would like to thanks to Dr Zarina bt Mohamad as my supervisor who had guided me, give valuable information and give useful suggestion during compilation and preparation of this research. Also thanks to my family and friends at the instigation of the completion of this project. iv ABSTRACT Nowadays, most company that have transaction process want to ensure that there are no possible failure happened. For instance, if sudden damage happened occurring at primary database, the second one will take over the responsibility of previous work automatically. This process can happen if the company systems have data replication. Data replication is a process that copies and maintains data from a database in one computer or severs to a database in another so that all users share and store same level of the information. This is also increase data availability and enhances data access relevant to their task without interfering work of others. The problem is how to make sure that connection/valuable in data replication is secure. In view of this issue, this paper proposed a secure data replication using encryption algorithm. Encryption is the process of converting readable character into another version of transformation to prevent unauthorized access. So that valuable data information will more secured and this method show a data from a database will be encrypted first then replicate it to another server. The unauthorized user also cannot sniff into database server easily. Thus, this paper approach encryption of data replication using Advanced Encryption Standard (AES) encryption is a symmetric encryption algorithm which are can encrypt and decrypt data or text. AES was created to be efficient and support block- length of 128 bits and key lengths of 128, 192, and 256 bits. This is useful to ensure that sensitive data was secured. v ABSTRAK Di dalam era ini, kebanyakkan syarikat besar menjalankan proses transaksi untuk mencegah daripada berlakunya keberangkalian kegagalan sistem. Sebagai contoh, jika berlaku kegagalan secara tiba-tiba di pangkalan data utama, tidak perlu risau kerana pangkalan data yang ke dua akan mengambil alih memproses kerja secara automatik. Hal ini telah menyedarkan syarikat masa kini pelu menggunakan Replikasi Data sebagai langkah pencegahan. Replikasi data adalah proses yang menyalin dan mengekalkan data dari pangkalan data dalam satu komputer atau memutuskan kepada pangkalan data yang lain supaya semua pengguna berkongsi dan menyimpan tahap maklumat yang sama. Ini juga meningkatkan ketersediaan data dan meningkatkan akses data yang berkaitan dengan tugas mereka tanpa mengganggu kerja orang lain. Masalahnya adalah bagaimana untuk memastikan bahawa sambungan data yang bernilai dalam replikasi data selamat. Memandangkan isu ini, makalah ini mencadangkan replikasi data yang selamat menggunakan algoritma penyulitan. Penyulitan adalah proses menukarkan aksara yang boleh dibaca ke versi lain untuk mengubah cara yang tidak dibenarkan. Jadi maklumat data berharga akan lebih terjamin dan kaedah ini menunjukkan data dari pangkalan data akan disulitkan terlebih dahulu kemudian meniru ke pelayan lain. Pengguna yang tidak dibenarkan juga tidak dapat menghidu ke pelayan pangkalan data dengan mudah. Oleh itu, pendekatan penyulitan data ini menggunakan penyulitan data yang menggunakan enkripsi Advanced Encryption Standard (AES) adalah algoritma penyulitan simetri yang boleh menyulitkan dan menyahsulit data atau teks. AES dicipta untuk menjadi cekap dan menyokong blok lebar 128 bit dan panjang kunci 128, 192, dan 256 bit. Ini berguna untuk memastikan data sensitif terjamin. vi CONTENTS PAGE DECLARATION i CONFIRMATION ii DEDICATION iii ABSTRACT Iv ABSTRAK vi CONTENTS vii-viii LIST OF TABLES vii LIST OF FIGURES Ix LIST OF ABBREVIATIONS X CHAPTER 1 INTRODUCTION 1.1 Introduction 2-3 1.2 Problem statement 4 1.3 Objectives 5 1.4 Scopes 5 CHAPTER II LITERATURE REVIEW 2.1 Introduction 6 2.2 Data Replication 6 2.3 Comparison of Encryption Algorithm 2.3.1 AES with RC4 7 2.3.2 AES 7-8 2.3.3 AES with Dynamic Key Selection 8 2.3.4 AES for Data Replication in Cloud 8-9 2.3.5 Twofish 9 2.3.6 Blowfish 9 2.3.7 Hybrid Encryption 9 2.3.8 Blowfish 10 2.3.9 Hybrid 10 2.3.10 Blowfish 10 2.4 Summary 11 vii CHAPTER III METHODOLOGY 3.1 Introduction 12 3.2 System Design 3.2.1 Framework 13-15 3.2.2 Algorithm 16-18 3.3 AES framework 19-20 3.4 Conclusion 22 CHAPTER 1V IMPLEMENTATION 4.1 Introduction 23 4.2 VMWareworkstation 23 4.3 Server Installation 24 4.3.2 MySQL server 26 4.3.3 SSH 26 4.4 Network configuration 27-30 4.5 Database server 31 4.5.1 Introduction 31 4.5.2 Creating Database 31 4.6 MySQL Replication 33 4.6.1 Master configuration 33-34 4.6.2 Slave configuration 35-36 4.7 AES Encryption and Decryption 37-40 4.8 Scripting 41-48 CHAPTER V RESULT AND DISCUSSION 5.1 Introduction 49-50 5.2 Discussion 51-52 CHAPTER VI CONCLUSION AND FUTURE WORK 5.1 Conclusion 53 5.2 Future work 53-54 CHAPTERVII REFERENCES 55 - 56 viii LIST OF TABLES TABLE TITLE PAGE 3.2.2 Description of Table Encryption Algorithm 15-16 3.2.3 Description of Table Decryption Algorithm 16-17 ix LIST OF FIGURES FIGURE TITLE PAGE 2.3.3.1 Interface Dynamic Key Selection 6 3.2.1 Framework of Secure Data Replication 13 3.2.2 Encryption and Decryption Process 15 3.2.3 Encryption and Decryption Algorithm 19-20 3.3.1 Flow of AES-128 bits 21 4.2.1 VMWareworkstation 24 4.3.1.1 Folder 25 4.3.1.2 Language 25-26 4.4.1 Master 28 4.4.2 Network interfaces Slave1 28 4.4.3 Network interfaces Slave2 28 4.4.4 IP address Ubuntu-Master 29 4.4.5 IP address Ubuntu-Slave1 30 4.4.6 IP address Ubuntu-Slave2 30 4.5.2.1 Show Databases 31 4.5.2.2 Show Tables 31 4.6.1.1 Configuration of Master file 33 4.6.1.2 Server-id in Ubuntu master 33 4.6.1.3 Successfully transfer to Ubuntu-slave1 34 4.6.1.4 Successfully transfer to Ubuntu-slave1 34 4.6.2.1 Bind-address slave1 35 4.6.2.2 Bind-address slave1 35 4.6.2.3 Server-id slave 2 35 4.6.2.4 Server-id slave 2 36 4.7.1.1 Original sample6.sql 37 4.7.1.2 Export database 38 4.7.1.3 Decryption of file sample6.sql at slave 1 39 4.7.1.4 Decryption of file sample6.sql at slave 2 39 4.8.1 Main scripting 41 4.8.2 Start2.sh scripting file 42 4.8.3 Start3.sh scripting file 43 x 4.8.4 Program.exp connected to slave1 44 4.8.5 Program2.exp connected to slave2 44 4.8.6 Decryption at Slave1 46 4.8.7 Decryption at Slave2 46 4.8.8 Result 47 5.1.1 Encrypted sample6.sql 49 5.1.2 Decrypted sample6.sql.cpt 50 xi LIST OF ABBREVIATIONS / TERMS / SYMBOLS AES Advanced Enryption Standards RC4 Rivest Cipher 4 RSA Ron Rivest, Adi Shamir,Leonard Adleman FYP Final year project xii LIST OF APPENDICES APPENDIX TITLE PAGE A Graph Gantt Chart FYP I 57 B Graph Gantt Chart FYP II 58 xiii CHAPTER 1 INTRODUCTION 1.1 Background The great development of Internet and World Wide Web makes the number of people surf internet by accessing system development increase. There are 1.7 billion of people used internets since 2012. Despite the rapid growth of using internet, a large of data were shared and used by database system. If this continued happened the database performance will become slower than usual. World Wide Web is an information platform where documents and other web resources which are identified by Uniform Resource Locators (URLs) then linked by hypertext links and can be accessed through internet. Internet and World Wide Web are two different things which are usually used without much dissimilarity but linked each other. The Internet is a worldwide system which enables multiple computers to connect with each other while web is an application that makes use of the system. Without the Internet people cannot access to the Web.