A Computational Package for Working with Elliptic Curve Groups by Sulman Liaquat a Thesis Submitted in Partial Fulfillment for the Degree of Master of Philosphy
Total Page:16
File Type:pdf, Size:1020Kb
CAPITAL UNIVERSITY OF SCIENCE AND TECHNOLOGY, ISLAMABAD A Computational Package for Working with Elliptic Curve Groups by Sulman Liaquat A thesis submitted in partial fulfillment for the degree of Master of Philosphy in the Faculty of Computing Department of Mathematics 2020 i Copyright c 2020 by Sulman Liaquat All rights reserved. No part of this thesis may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, by any information storage and retrieval system without the prior written permission of the author. ii To my Mother, late Father, Brothers, Sisters and Someone very special for their support and love. CERTIFICATE OF APPROVAL A Computational Package for Working with Elliptic Curve Groups by Sulman Liaquat (MMT161012) THESIS EXAMINING COMMITTEE S. No. Examiner Name Organization (a) External Examiner Dr. Waqas Mehmood QAU, Islamabad (b) Internal Examiner Dr. Qamar MEhmood CUST, Islamabad (c) Supervisor Dr. Rashid Ali CUST, Islamabad Dr. Rashid Ali Thesis Supervisor June, 2020 Dr. Muhammad Sagheer Dr. Muhammad Abdul Qadir Head Dean Dept. of Mathematics Faculty of Computing June, 2020 June, 2020 iv Author's Declaration I, Sulman Liaquat hereby state that my M. Phil thesis titled \A Computa- tional Package for Working with Elliptic Curve Groups" is my own work and has not been submitted previously by me for taking any degree from Capital University of Science and Technology, Islamabad or anywhere else in the coun- try/abroad. At any time if my statement is found to be incorrect even after my graduation, the University has the right to withdraw my M. Phil Degree. (Sulman Liaquat) Registration No: MMT161012 v Plagiarism Undertaking I solemnly declare that research work presented in this thesis titled \A Com- putational Package for Working with Elliptic Curve Groups" is solely my research work with no significant contribution from any other person. Small contribution/help wherever taken has been duly acknowledged and that complete thesis has been written by me. I understand the zero tolerance policy of the HEC and Capital University of Science and Technology towards plagiarism. Therefore, I as an author of the above titled thesis declare that no portion of my thesis has been plagiarized and any material used as reference is properly referred/cited. I undertake that if I am found guilty of any formal plagiarism in the above titled thesis even after award of M. Phil Degree, the University reserves the right to withdraw/revoke my M. Phil degree and that HEC and the University have the right to publish my name on the HEC/University website on which names of students are placed who submitted plagiarized work. (Sulman Liaquat) Registration No: MMT161012 vi Acknowledgements All praise to Almighty Allah, the most Benevolent and Merciful, the Creator of Universe and man, who gave me the vision and courage to accomplish this work successfully. A research project at any level is very difficult to be accomplished alone. The contributions of many people have made it possible for me to complete this work. I would like to extend my appreciation especially to the following. First and foremost I extend my sincerest gratitude to my thesis supervisor Dr. Rashid Ali who has supported me throughout my thesis work in every possible way. He presented the things in simplest way. His efforts and encouragement is really appreciable. He gave me self-belief, and confidence and provided me his support and guidance all way along. Under the supervision of him I never felt anything difficult in my thesis. Dr. Rashid Ali provided me the friendly and comfortable environment to work in, without his guidance and support I would never be able to put this topic together. I am also thankful to all the faculty of CUST in particular the faculty of Mathe- matics department. Their ability to simplify the most difficult things helped me to understand the things that I would never be able to understand. The research oriented environment provided to students by Mian Amer Mehmood, Chancellor at CUST, Prof. Dr. Muhammad Mansoor Ahmed, Vice Chan- cellor at CUST and Dr. Muhammad Sagheer, Head of Department of Math- ematics made the research work easier and more pleasant. It is their positive attitude that enables such excellent research work from staff and students. My friends, class mates and fellow research workers Tahir Bhai, Syed Burhan , M.Usman Farooqi , Mujtaba Azim, Sohail Abid, Bilal Ahmed and Sultan Mehmood also helped me a lot and guided me whenever I needed it. Last but not least, I would like to pay high regards to my parents and all family members for their sincere encouragement and inspiration throughout my research work and lifting me uphill this phase of life. I owe everything to them. (Sulman Liaquat) Registration No: MMT161012 vii Abstract In modern world, security of confidential information has become one of the fun- damental requirement. Elliptic curve turn out to be an important tool for secure communication in cryptography it provides the same level of security with smaller key as compare to RSA. For working with the elliptic curves over the finite fields of very large orders we need a mathematical tool like Matlab, ApCoCoA, Mathemat- ica etc. Matlab and Mathematica are not freely available softwares. In this thesis we have developed a package in ApCoCoA, which is a freely available mathemat- ical software for computation in Algebra, that helps us to perform some complex computations in an easy and efficient way. We used CoCoL programming language of ApCoCoA to make a computational package for working with the elliptic curve groups. This package is made to perform different operations on elliptic curve that are necessary to run schemes based on ECC. Also, use of ApCoCoA is secure as compared to other online available softwares as it needs not to be connected with a third party like desmos, over a public network. Using online available softwares can compromise the security because one must share the EC points over internet to perform different calculations. As the security of many schemes are based on EC points, therefore, if a hacker, pretending to be the third party, can take EC points from the user, can weaken the security. Our package works off line and hence it is better for security perspective. Once the message is encrypted it can be sent to the receiver over a public network without compromising the security because it can only be understandable to a authorized receiver as it is in encrypted form. We also efficiently executed using the package made in ApCoCoA. Contents Author's Declarationv Plagiarism Undertaking vi Acknowledgements vii Abstract viii List of Figures xi List of Tables xii Abbreviations xiii Symbols xiv 1 Introduction1 1.1 Background...............................2 1.2 Role of Elliptic Curve..........................2 1.3 Tools for Elliptic Curve.........................3 1.4 Summary................................3 1.5 Distribution of Thesis..........................4 2 Preliminaries5 2.1 Mathematical Background.......................5 2.2 Cryptographic Background....................... 11 2.2.1 Applications/Objectives of Cryptography........... 15 2.2.2 Symmetric Key Cryptography................. 17 2.2.3 Asymmetric Key Cryptography................ 18 2.3 Cryptanalysis.............................. 19 2.4 Popular Asymmteric Techniques.................... 21 2.4.1 RSA............................... 21 2.4.2 Discrete Logarithm Problem.................. 24 2.5 Cryptography and Elliptic Curves................... 25 2.6 Summary................................ 26 viii ix 3 Elliptic Curve Cryptography 27 3.1 Elliptic Curve Cryptography...................... 28 3.1.1 Elliptic Curves Over R ..................... 29 3.1.1.1 Mathemtical Formulas for Point Addition on El- liptic Curve...................... 32 3.1.2 Elliptic Curve over Finite Fields................ 36 3.1.3 Elliptic Curve Discrete Logarithm Problem (ECDLP).... 39 3.1.4 Elliptic Curve Diffie-Hellman Key Exchange Protocol............................. 40 3.2 Summary................................ 40 4 The Package Elliptic Curve 42 4.1 Mathematical Functionality...................... 43 4.2 How to use ApCoCoA?......................... 44 4.2.1 Requirements.......................... 45 4.2.2 Installation........................... 45 4.2.3 How to Save and Run a Programe in ApCoCoA....... 47 4.3 Computations on Elliptic Curve Groups............... 48 4.3.1 Modulo Inverse......................... 48 4.3.2 EC Addition........................... 50 4.3.3 Order of the Point of Elliptic Curve.............. 52 4.3.4 Adding a Point to itself Multiple Times............ 53 4.4 CoCoA Command References..................... 55 4.4.1 Inverse.............................. 55 4.4.2 Point addition.......................... 56 4.4.3 Adding Point to itself N Number of Time........... 57 4.4.4 Point Order........................... 57 4.5 Implementation of ECDH Key Exchange Protocol using ApCoCoA Package................................. 58 4.5.1 Key Agreemenet Algorithm Example............. 58 4.6 Message Encryption/Dycryption using the Scheme of Omar Reyad. 59 4.6.1 Toy Example.......................... 60 5 Conclusion 63 Bibliography 65 Appendix 69 List of Figures 2.1 Trapdoor Funtion[12].......................... 11 2.2 Cryptology............................... 12 2.3 Block Diagram............................. 13 2.4 Cryptographic protocols [16]...................... 17 2.5 Symmetric key protocol [17].....................