Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 46 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
46
Dung lượng
1,14 MB
Nội dung
1 VIETNAM GENERAL CONFEDERATION OF LABOR TON DUC THANG UNIVERSITY FACULTY OF INFORMATION TECHNOLOGY THE MIDTERM OF PROBABILITIES AND STATISTICS RESEARCH ON ENCRYPTION AND DECRYPTION Instructors: MR.NGUYỄN QUỐC BÌNH Student: MAI BẢO THẠCH – 520H0490 Class: 20H50304 Course: HO CHI MINH CITY, 2021 0 24 VIETNAM GENERAL CONFEDERATION OF LABOR TON DUC THANG UNIVERSITY FACULTY OF INFORMATION TECHNOLOGY THE MIDTERM OF PROBABILITIES AND STATISTICS RESEARCH ON ENCRYPTION AND DECRYPTION Instructor: MR.NGUYỄN QUỐC BÌNH Student: MAI BẢO THẠCH – 520H0490 Class: 20H50304 Course: HO CHI MINH CITY, 2021 0 24 THANKFUL WORD After working for a half semester with the enthusiastic help and support of Mr Nguyễn Quốc Bình, I was able to complete the report in the most complete and effective way His teaching has given our students a lot of knowledge as well as full skills in the specialized subject Although couple of months is quite short, but that time has also helped me to easily approach the major step by step with a solid foundation, especially with the encouragement and help from seasoned lecturers I sincerely thank 0 REPORT COMPLETED AT TON DUC THANG UNIVERSITY I hereby declare that this is my own report and is under the guidance of Mr Nguyễn Quốc B The research contents and results in this topic are honest and have not been published in any form before The data in the tables for analysis, comments and evaluation are collected by the author himself from different sources, clearly stated in the reference section In addition, the project also uses a number of comments, assessments as well as data of other authors, other agencies and organizations, with citations and source annotations If I find any fraud I take full responsibility for the content of my report Ton Duc Thang University is not related to copyright and copyright violations caused by me during the implementation process (if any) Ho Chi Minh city, 09 April, 2022 Author (sign and write full name) Mai Bảo Thạch 0 TEACHER’S CONFIRMATION AND ASSESSMENT SECTION Confirmation section of the instructors _ _ _ _ _ _ _ Ho Chi Minh city, day month year (sign and write full name) The evaluation part of the lecturer marks the report _ _ _ _ _ _ _ Ho Chi Minh city, day month year (sign and write full name) 0 SUMMARY The assignment is built for the purpose of testing python9s knowledge about self-study algorithms, but also for consolidating knowledge after studying at school The content of the assignment revolves around reviewing the basic knowledge of the logic algorithms as well as some theories about encryption and decryption of this subject Regarding the research method, the assignment is based on the learned knowledge, lecture slides, and textbooks given by the lecturer during the learning process The result obtained after this assignment is the knowledge that can be consolidated in the most general way as well as in place of the assignment of the 1st term during the period of extremely stressful epidemic developments 0 TABLE OF CONTENTS THANKFUL WORD REPORT COMPLETED AT TON DUC THANG UNIVERSITY TEACHER’S CONFIRMATION AND ASSESSMENT SECTION SUMMARY TABLE OF CONTENTS LIST OF ABBREVIATION LIST OF DIAGRAMS, CHARTS AND TABLES 10 CHAPTER 1: INTRODUCTION 12 1.1 Encryption: 12 1.2 Decryption: 13 1.3 Symmetric: .14 1.4 Asymmetric Cryptosystem: 15 CHAPTER 2: MONOALPHABETICAL SUBSTITUTION CIPHER 18 2.1 Definiton of substitution cipher: 18 2.2 State the problem: .18 2.3 Idea of solution and algorithm: 19 2.4 Example and evaluation with analysis: 19 CHAPTER 3: FREQUENCY ANALYSIS 22 3.1 Definition of Frequency Analysis: 22 3.2 State the problem: .23 3.3 Idea of solution and algorithm: 23 3.4 Example and evaluation: 23 0 CHAPTER 4: EXPERIMENTS ON PYTHON 26 4.1 Experiments on Encryption: .26 4.2 Experiment on Decryption: .38 REFERENCES 45 APPENDIX 46 0 LIST OF ABBREVIATION AES: Advanced Encryption Standard 0 10 LIST OF DIAGRAMS, CHARTS AND TABLES Picture Asymmetric 17 Picture Encryption 17 Picture Symmetric 17 Picture Example of cipher keys 19 Picture Monoalphabetic Substitution Cipher Illustration 21 Picture Frequency table .22 Picture Values for Encryption 26 Picture Source code of Encryption algorithm 27 Picture Validation of letters 28 Picture 10 Algorithm 29 Picture 11 Importing testcases 30 Picture 12 Generated cipher keys 30 Picture 13 Testcase 30 Picture 14 Testcase 31 Picture 15 Generated cipher keys 31 Picture 16 Testcase 33 Picture 17 Generated cipher keys 33 Picture 18 Testcase 35 Picture 19 Generated cipher keys 36 Picture 20 Frequency table in Python Error! Bookmark not defined Picture 21 Import from input values file 38 Picture 22 Source code for Decryption algorithm 39 Picture 23 Code of checking existing 40 Picture 24 Code of alpha-beta sorting .41 Picture 25 Code of replacing letter with frequency table 42 0 of cipher alphabet when you want to encode a new script 2.3 Idea of solution and algorithm: My idea is to solve and replace the letter in their lowercase format so it will be easier to solve when uppercase appear making it compatible for all letter in plaintext Picture Example of cipher keys About the cipher alphabet, it will be generate randomly when encoding a new script (default, we will have 26 factorial of position in cipher alphabet) In above table, we see that each default alphabet is fixed with a letter in the alphabet and just will be replaced by it as long as in the same script we use not the new one The idea is using list to contain default alphabet and then fixed the alphabet with cipher alphabet to maintain each letter fixed with the key letter in cipher As the result, after replace respectively each letter with key using loop 2.4 Example and evaluation with analysis: Given the string script of Ielts reading passage below and encode it with random cipher alphabet: