Microcontroller Application in Cryptography Techniques

نویسندگان

  • Ali E. Taki
  • Noha A. Hikal
چکیده

The main task of paper studied new ciphering and deciphering techniques reported previously. Computer programs are designed in C language to perform theses algorithms and to assess their performance. Out of these algorithms, it is found that the BLOWFISH is the more sophisticated one. Therefore, a development for this algorithm is introduced to enhance its operation. This has been carried out by using the Microcontroller in the decrypting operation to support fast and more accurate operation. From the results of simulation, it is found that the expansion and permutation operations require most of the computing time. Therefore, software was designed and implemented to execute the expansion and permutation operations. A series of experiments was connected using the new developed algorithm as applied to different types of data (e.g. text, graphics and geographic maps). In all paper experiment, the encrypted and decrypted files were exactly the same. KeywordsBLOWFISH; AVR Microcontroller; cryptography; Encryption; Decryption. I. BLOWFISH ALGORITHM The Blowfish algorithm uses a key [1], which can be up to 448 bits in length, to calculate sub-keys, which are used in the actual encryption and decryption. The sub keys used in Blowfish are the P-array and S-boxes. The P-array consists of 18 32-bit values while the 4 Sboxes consist of 256 32-bit values. The original values of the P-array and the 4 S-boxes are initialized with the hexadecimal fraction of pi. The P-array is initialized first and then followed by the S-boxes. The hexadecimal fraction of pi was selected because it produced a random number for the initialization. Another type of initialization could be used but the initialization values must be random. According to Schneier, patterns in the initialization values can result in a weaker cipher. After initialization, the values of the P-array and Sboxes are modified using the key. The key [2], which can consist up to 448-bits, is segmented into 32-bit values. If the key is less than 448-bits, the key is repeated. For a 448-bit key, there would be 14 32-bit values, which mean the key-array (K) has 4 32-bit values less than the P-array. The key is then used to initialize the P-array. An exclusive-or operation is performed between each of the 18 32bit P-array values and a 32-bit value of the key. P1 is XOR-ed with the first 32-bits of the key (K1) and then P2 is XOR-ed with the next 32bits of the key (K2). This process is continued until P15 because the key-array has only 14 32-bits. According to Stallings, an exclusive-or operation would be conducted with P15 and the first 32-bit key value (K1), which is incorrect. The key value is actually the next value of the key repetition, which would essentially be K15. After the P-array has been initialized with the key, the P-array and S-boxes values are then modified using the encryption routine of Blowfish. First, two 32-bits values consisting of zeros is encrypted. Other initial values could be selected but these values must be fixed to prevent an attacker from generating the same cipher text with two different keys. The ciphertext [3] from the encryption of the zero values is used to replace the P-array values P1 and P2. The cipher text is also used as the input for the next encryption round. The cipher text from this round then replaces P3 and P4 and the encryption routine is executed again with the cipher text as input. This process [4] is continued until all 18 values in the P-array and all 256 values for each of the 4 Sboxes is replaced with cipher text. A total of 521 encryptions are preformed to obtain all the P-array and S-box values. Now that the P-array and S-box values have been established, plaintext can now be encrypted. For encryption [5], the 64-bit plaintext is separated into a left and right half each consisting of 32-bits. The encryption routine consists of a 16 round Feistel network. In the first round, an exclusive-or operation is performed between the left 32-bits (LE-0) and the 32-bit P1 of the P-array. This value becomes the next 32-bit right value (RE-1) and this value is also inserted into the F function. The encryption routine for Blowfish uses a 16 round Feistel network, a swap operation and two exclusive-or operations. Each round consists of exclusive-or operations and the F function. The F function [6] takes the 32-bit input and separates it into 4 bytes (8-bits each). These four values are then used for table lookup in their respective S-Boxes. A 32-bit input is parsed into 4 8-bit values that are used for the table lookup into the 4 S-boxes. The 32bit values of the S-boxes are then added, exclusive-or-ed and then added again. Unlike DES [7] which uses more bits to map to S-boxes, Blowfish only uses four 8-bit values for mapping to the S-box values. A less complex mapping was used because the S-boxes are generated from the key values and are not static like DES. The Canadian Journal on Electrical and Electronics Engineering Vol. 1, No. 4, June 2010 69 32-bit values of the S-boxes are then manipulated according to the following formula: 32-bit Output = ((((S[1][a] + S[2][b]) mod 2^32 ) S[3][c]) + S[4][d]) mod 2^32 (1) The 32-bit value of S-box 1 is added to the 32-bit value of S-box 2. The modulus of this result by 2^32 is taken as the input for the exclusive-or operation to performed with the 32-bit value of S-box 3. The result of the exclusive-or operation is then added to the 32bit value from S-box 4 and the modulus 2^32 is then performed. A bitwise exclusive-or operation is performed on the final 32-bit output from the F function and the right half of the data (RE-0). The result of this operation becomes the left half 32-bit input for the next round (LE-1). The results of round 1 can be explained by the following equations: LE-1 = F(LE-0 P1) RE-0 (2) RE-1 = LE-0 P1 (3) Round 2 is then performed with inputs LE-1 and RE1. This process is repeated for a total of 16 rounds. The general equations to describe the rounds are as follows: LEi = F(LEi-1 Pi) REi-1 where 1 i 16 (4) REi = LEi-1 Pi where 1 i 16 (5) After completing the 16 rounds, (LE-16) and (RE-16) values are swapped. An exclusive-or operation is then performed between the swapped (LE-16) and P18 and also with the swapped RE-16 and P17 to obtain (LE-17) and (RE17), respectively. The 32-bit values of (LE-17) and (RE-16) are combined to obtain the 64-bit cipher text. The decryption process for Blowfish [8] is almost identical to the encryption process except the P-array values are reversed. For decryption, the bitwise exclusive or operation is performed between the first left 32-bit value (LE-0) of the cipher text and P18. In the encryption, this process would have been performed with P1. The decryption process is repeated for the 16 rounds. (LE-16) and (RE-16) are then swapped and a bitwise exclusive-or operation is performed with P1 and (LE-16) and also with P2 and RE‘-16 to obtain (LE-17) and (RE-17), respectively. (LE17) and (RE-17) are then combined to obtain the original plaintext. The decryption routine for Blowfish is identical to the encryption routine except the P-array key values are applied in the reverse order. II. AVR MICROCONTROLLER Microcontroller is microcomputer [9] that contains most of its peripherals and required memory inside a single integrated circuit along with the CPU (microcomputer on a chip microcontroller have been in use for more than three decades. Intel 8051 was one of the first microcontrollers in the market Other companies manufacture microcontrollers such as National, Motorola,Philips,Zilog , Hitachi, Microchip and Atmel. Atmel has become a world leader in the development of FLASH memory technology. FLASH technology [10] is a nonvolatile. Yet reprogrammable memory often used in products such as digital cameras and portable audio devices. This memory technology really pushed Atmel ahead in the microcontroller industry by providing in system programmable solution. The next great step in this high tech revolution was the Implementation of high level language compilers that are targeted specifically for use with new microcontrollers. The code generation and optimization of the Compilers is quite impressive. The C language lends itself can be considered the Best choice since it creates pools intellectual property that can be drawn from Again and again. This lowers the development costs on an ongoing basis by shortening the development Cycle with each subsequent design. Why AVR: a. World's Best Flash MCU! b. High CPU Performance (One Instruction Per Clock Cycle). c. High System Integration. d. Small Code Size. e. Onboard Hardware Multiplier. f. 16 Bit Performance at 8 Bit Data bus. g. Operates on 5 volt DC. h. Can be programmed in seconds with single power supply via simple 4 pin connector i. Many upgrade Options (AVR , MEGA AVR , LCD AVR , TINY AVR ,USB AVR , RF AVR , SECURE AVR ) j. AVR core use it in FPGA and FPGA works as microprocessor. III. BLOWFISH CRYPTOGRAPHY IMPLEMENTATION BY USING MICROCONTROLLER The Blowfish algorithm uses a key, which can be up to 448 bits in length, to calculate sub-keys, which are used in the actual encryption and decryption. The sub keys used in Blowfish are the P-array and S-boxes. The P-array consists of 18 32-bit values while the 4 S-boxes consist of 4 * 256 32-bit values. The original values of the P-array and the 4 S-boxes are initialized with the Hexadecimal fraction of pi. The P-array is initialized first and then followed by the S-boxes. The hexadecimal fraction of pi was selected because it produced a random number for the initialization. Another type of initialization could be used but the initialization 5 values must be random.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Simple and Efficient Way to Combine Microcontrollers with RSA Cryptography

Microcontroller can be easily adopted in various applications with a variety of peripherals due to its merits of small size, simple architecture and etc. However, the limited computing power restricts its application in cryptography. In this paper, we try to integrate microcontroller with different peripheral devices to support more powerful cryptography computation in a simple and efficient wa...

متن کامل

Adaptable Security in Wireless Sensor Networks by Using Reconfigurable ECC Hardware Coprocessors

Specific features of Wireless Sensor Networks (WSNs) like the open accessibility to nodes, or the easy observability of radio communications, lead to severe security challenges. The application of traditional security schemes on sensor nodes is limited due to the restricted computation capability, low-power availability, and the inherent low data rate. In order to avoid dependencies on a compro...

متن کامل

Using the Elliptic Curve Digital Signature Algorithm (ECDSA) with the MAXQ1103's Modular Arithmetic Accelerator (MAA) - AN4016

This application note describes the use and implementation of elliptic curve digital signature algorithm (ECDSA) on the MAXQ1103 microcontroller's modular arithmetic accelerator (MAA) module. Performance figures are given for a standard 160-bit curve specified in Standards for Efficient Cryptography published by Certicom®.

متن کامل

Energy-Architecture Tuning for ECC-Based RFID Tags

The implementation of Elliptic Curve Cryptography (ECC) on small microcontrollers is challenging. Past research has therefore emphasized performance optimization: pick a target architecture, and minimize the cycle count and footprint of the ECC software. This paper addresses a different aspect of resource-constrained ECC implementation: given the application profile, identify the most suitable ...

متن کامل

Cryptography in Ultra-Low Power Microcontroller MSP430

This article describes an implementation for the method from Texas Instruments for a random number generator in the ultra-low power microcontroller MSP430x5xx Families and the analysis of this generator in the concrete microcontroller MSP430f5438A. The generator may be used to generate numbers for cryptography security methods (for example in the cryptosystem Diffie-Hellman). A short theoretica...

متن کامل

Efficient Implementation of Elliptic Curve Cryptography for Wireless Sensor Networks

One of the huge problems for security in sensor networks is the lack of resources. Typical sensor nodes such as the quite popular MICA and MICA2 Motes from UC Berkeley [1] are based on a microcontroller architecture with only a few KBytes of memory and severe limited computing ability. Strong publickey cryptography is therefore commonly seen as infeasible on such devices. In contrast to this pr...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2010