Implementation of Cryptographic Algorithms Via Multithreading N

Implementation of Cryptographic Algorithms Via Multithreading N

Bulgarian Chemical Communications, Volume 52, Issue A (pp. 220-224) 2020 DOI: 10.34049/bcc.52.A.218 Implementation of cryptographic algorithms via multithreading N. Sinyagina1, V. Todorov2, G. Kalpachka1* 1South-West University “Neofit Rilski”, 66 Ivan Mihailov Str., 2700 Blagoevgrad, Bulgaria 2Sofia University “St. Kliment Ohridski”, 15 Tsar Osvoboditel Blvd., 1504 Sofia, Bulgaria Received August 11, 2019; Accepted November 08, 2019 Speed of the encryption and decryption processes is one of the main factors when it comes to implementation of cryptographic algorithms. The use of multithreading can significantly decrease the time required for these processes. The article describes a research on multithreaded execution of the RSA algorithm and proposes a conceptual model for implementation, outlining the main points of its software design. The choice of resources, methods and tools for the application deployment has been made as well as an assessment of the used operating system and programming language. Keywords: Multithreading, Cryptographic Algorithms, Asymmetrical Encryption Algorithm RSA. INTRODUCTION Data encryption is a typical example for an algorithm, usually executed as a serial program. In today’s information age the cyber-attacks Serial programs are directly dependent on the become more and more frequent and dangerous. frequency of the used CPU core. Such algorithms The Internet (the biggest unsecured global system do not benefit from multiple cores or threads. for data transmission) carries large amounts of data The aim of this article is to research and analyze that should not be accessible by anyone. the pros and cons of RSA implementation on a Cryptography is a necessary element for most of multithread architecture. The main focus will lay on the current online applications. evaluating the speed when running the same task on Despite high level of security, the methods for a different number of threads. encryption and decryption of data are expected to also have minimum execution delay. Unfortunately, MAIN STATES OF THE MULTITHREAD security and speed are inversely proportional – ARCHITECTURE AND THE RSA faster algorithms have more vulnerabilities, while CRYPTOGRAPHIC ALGORITHM the secure ones need more computational resources. Multithread architecture – hardware allowing The main goal when selecting a cryptographic using multiple CPU cores or threads in parallel. algorithm is finding the optimal balance between Multithread (or parallel) programming is the execution time and security. method of coding, utilizing hardware running with Fortunately, the technologies are rapidly multiple cores and/or threads [2]. improving. The computer components are always Cryptographic algorithm – method for data being upgraded for faster handling of data and conversion using standardized encrypting and computational tasks. The cryptographic algorithms decrypting operations, aiming to protect the data also need to improve along with the technology. from unauthorized access. The RSA algorithm is an In the recent years the parallel programming has example for a cryptographic algorithm and more been established as the best approach for getting specifically an asymmetrical one. higher speed in data processing. Most of the current st In the middle of the first decade of the 21 CPUs use architecture with more than one century the multithreaded architecture started to operational thread [1]. The operating systems are rapidly appear in personal computers. also adapted to multicore technology. The main strength of the multithread Software development on a multicore hardware architecture is the multitasking. It allows the system requires additional effort. Existing serial algorithms processes and the user applications to be physically need to be adapted to parallel solutions. The separated. The different tasks can be run actually in breaking down of a process to its main components parallel. Additionally, different jobs can be and running them simultaneously is the main assigned with different priorities. A lot of the principle of modern programming. Unfortunately, multithread hardware also provides a separation of not all algorithms are adapted and optimized for the the cache memory between the different cores. multithread architecture. * To whom all correspondence should be sent. E-mail: [email protected] 2020 Bulgarian Academy of Sciences, Union of Chemists in Bulgaria 220 N. Sinyagina et al.: Implementation of cryptographic algorithms via multithreading With the increasing popularity of the mobile on the hardware as on the software optimizations technologies the problem with power consumption [5]. raises its priority. The multithread architecture has Published in 1977, the RSA algorithm remains better energy utilization. If a given core is not used, one of the most widely spread and secure it can be set to idle until it is needed again, which algorithms for data transfers over unsecured drastically reduces its power consumption. channels. On top of that, modern technology has almost The basic implementation of the RSA reached the physical limits of single core clock algorithms does not require complex software speed. The only way to get more computational design but executing it with a high security level power is to use additional processing units. requires significant computation power. Its The pros of a multithread architecture are many relatively slow run speed is the main reason why it and are undoubtedly more than enough to is not more widely spread [6]. overwhelm the single thread systems but the cons The main plus of the RSA algorithm is the fact should also be considered [3]. that it is asymmetric. By definition it does not Using multiple threads definitely expands the require exchange of private information between possibilities for software development but also the parties at any point during the data transfer. raises some complications. New issues appear that This is important because any sharing of private were previously not present on serial programs. information has a risk of directly violating the One of them is the access to shared memory. In security. On top of that, if the public key is big serial programming memory conflicts (a process enough in length, the cypher becomes virtually modifying another process’ memory during its impossible to crack. execution) are rare. In parallel programming it is METHOD OF IMPLEMENTING RSA ON common for two or more processes to share and MULTITHREAD ARCHITECTURE modify the same memory. If the threads are not properly synchronized problems can occur. To Proposal for speeding up the RSA process via avoid them, mutual exclusions and semaphores multicore architecture need to be implemented to ensure proper system The RSA algorithm is implemented in 4 steps operation. However, their management requires [7]: more complex software solutions, as well as 1. Key generation – the recipient of the additional resources for their implementation [4]. encrypted messages should generate a pair of keys: The order of executing tasks on the different public and private. The public key can be freely threads is also a big problem in multithread distributed while the private key should not be architectures. Often the processes depend on one shared. The public key is used for encryption while another, which requires timeouts and checks for the the private key is used for decryption. completion and integrity of the results of a given 2. Sharing of public keys – after generating job. the key pair, the public key should be delivered to The separation of the processes and the tracking the sender of the encrypted messages. The sharing of their execution require additional system can occur over unsecured channels because the resources. The use of two cores instead of one does public key by itself does not present any security not mean double performance. The complexity of risks. the job synchronization increases with the number 3. Encryption of the message – anyone having of threads used. There even are cases where the public key can generate encrypted messages dividing a process into multiple ones actually slows using the RSA procedure [8]. down its execution. When developing a 4. Decryption of the message – the encrypted multithreaded software there always are resource message can be decrypted only with the private losses because of the needed bandwidth for the key, which should only be available for the communication and management of the sub tasks. recipient. The multithread architectures fit the modern requirements for development of processor Method for multithreaded implementation of the technologies but on the other hand they put more RSA algorithm weight on the software developers. Additionally, to 1. Creating a number of threads – a number (n) optimize any existing serial algorithms, they need of threads is created at the begging of the task. The to be adapted for the new hardware architectures. number n is predefined and corresponds to the The task execution time does not depend as much number of threads to be used. They cannot exceed the number of threads the operating system can 221 N. Sinyagina et al.: Implementation of cryptographic algorithms via multithreading access. All threads should be able to work in based on measuring the executing speed of the parallel with each other. encryption and decryption processes using different 2. Splitting the data for encryption or hardware resources with the same input parameters. decryption into chunks – the input for encryption It is responsible for running

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    5 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us