Enhancing Security and Speed of RC4

Total Page:16

File Type:pdf, Size:1020Kb

Enhancing Security and Speed of RC4 International Journal of Computing and Network Technology ISSN 2210-1519 Int. J. Com. Net. Teach. 3, No. 2 (May 2015) Enhancing Security and Speed of RC4 Maytham M. Hammood1, 2, Kenji Yoshigoe1and Ali M. Sagheer3 1 Department of Computer Science, University of Arkansas at Little Rock, Little Rock, USA 2Department of Computer Science and Mathematics, University of Tikrit, Iraq 3Computer College, University of Anbar, Iraq Received: 10 Dec. 2014, Revised: 15 March, 2015, Accepted: 1 April 2015, Published: 1 (May) 2015 Abstract: Wireless communication security is a critical factor for secure communication among large scale of wireless networks. A limited resource constraint, such as power and memory size presents a significant challenge to implement existing cryptographic algorithms. One of the most important symmetric cryptographic algorithms is Rivest Cipher 4 (RC4) stream cipherthatis utilized in many real-time security applications. However, the RC4 cipher shows some weaknesses, including a correlation problem between the public known outputs of the internal state. In this paper, we propose RC4 stream cipher with a random initial state (RRC4) to solve the weak keys problem of the RC4 using a random initialization of internal state S. We also propose RC4 stream cipher with two state tables (RC4-2S) to solve the correlation problem between the public known outputs of the internal state using permutation between state1 (S1) and state 2 (S2) while requiring less time than RC4. Finally, we propose RC4 stream cipher with two state tables togenerate four keys (RC4-2S+) in each cycle which further enhances randomness overRC4-2S and RRC4. Keywords: Encryption, Stream Cipher, RC4, Random Number Generator attack can cause immediate loss of synchronization [3]. 1. INTRODUCTION Asynchronous stream ciphers depend on the previously Cryptographic algorithms that can provide fast generated ciphertext in order to continue generating new implementation, small size, low complexity, and high ones, yet it cannot regenerate the same sequence of security for resource-constrained devices such as ciphertext. On the other hand, synchronous stream wireless sensor devices are imperative. Conventional ciphers can regenerate a sequence of ciphertext because a cryptographic algorithms are sequences of processes or key sequence is independent of the plaintext. This case is rules, used to encrypt or decrypt messages in a referred to as self-synchronized because of the ability to cryptographic system to provide security services. re-synchronize after insertion or deletion of bits. Conventional cryptographic algorithms are very complex Although self-synchronization can be an important and consume a significant amount of power when used property, this type of the stream cipher has not received by resource-constrained devices for the provision of much attention [4]. secure communication [1]. These include symmetric and In the literature, there are many stream cipher asymmetric key algorithms, but asymmetric key algorithms presented to implement high-performance algorithms are inappropriate for resource-constrained software. Such algorithms include the following: A5/1 devices for several reasons, including the limited storage [5], ORYX [35], LEVIATHAN [36], IDEA [37], MUGI space and excessive energy usage [1, 2]. Therefore, [38], W7 [40], RC4, Helix [39], SNOW [32], SOBER security schemes should rely on symmetric key [34], and SEAL [33]. One-time pad, which is stronger cryptography, especially when systems have limited than all of these aforementioned algorithms, is hardware resources. unbreakable since it never uses the same key more than Stream ciphers can be classified as synchronous and once. Consequently, the sequence key is truly random asynchronous. In a synchronous stream cipher, a and not generated in a deterministic manner as is the case sequence of keys is generated independently from the with other algorithms. Thus, an attacker cannot deduce plaintext and ciphertext. The drawback of synchronous is any information about the key from ciphertext [6]. The that both the sender and the receiver have to be robustness of stream ciphers depends on Pseudo-Random synchronized for key usages. It can detect any deletion or Number Generator (PRNG) which has proved to be insertion of bits by an active attack directly, yet such an resistant to attacks if it passes the statistical tests. E-mail: [email protected], [email protected], [email protected] http://journals.uob.edu.bh 38 Maytham M. Hammood, et. al.: Enhancing Security and Speed of RC4 RC4 is a proprietary stream cipher that was designed weakness in the first two output bytes of the RC4 key in 1987 by Ron Rivest. RC4 is widely used in security stream generator. They argued that the number of outputs software based on the stream cipher, including one in the required for distinguishing the output of the RC4 random encryption of traffic to and from secure websites such as sequence with the presence of bias is 128, and they Transport Layer Security (TLS), Secure Socket Layer recommended the use of 256 to overcome this bias. (SSL), and Wired Equivalent Privacy (WEP) RC4A is considered to be robust against most of the implementations. RC4 is fast in comparison to other weaknesses of RC4, particularly its weakness of algorithms, and it has a simple design hardware distribution in the first two output bytes. However, after implementation [7]. In addition, RC4 is five times faster one year, Maximov [11] proposed distinguishing attack than Data Encryption Standard (DES) and fifteen times on both VMPC and RC4A, which can distinguish the faster than Triple-DES [4]. cipher output from a truly random number. Many stream ciphers use a de-facto RC4 standard for Yu and Zhang [12] presented RC4 state combined with meeting specific requirements, such as the limited the hash function without affecting the simplicity and storage size and power of the devices; however, there are efficiency. The RC4 state based on the hash function can many weaknesses found in stream ciphers caused by generate Message Authentication Code (MAC). The mathematical relationships between the key, ciphertext, enhancement includes the offset, forward, and backward and plaintext which attackers can use to assess the properties of RC4 states where the authors use offset to security of the cryptographic algorithms via ignore the first few bytes of the key and started cryptanalysis. Thus, the goal is to create a sequence of encrypting the data in determining the position which has keys that approaches true randomness [8]. led to an increase in the time of execution. Pardeep and The structures of stream ciphers are presented more Pateriya [13] proposed PardeepCipher-RC4 (PC-RC4) as than block ciphers. The security of the cryptographic an extension to the RC4 algorithm to improve algorithms can be assessed by cryptanalysis. Many randomness in KSA and PRGA, yet it increased the weaknesses found in stream ciphers are triggered by execution time. Kamble and Meshram found that RC4 mathematical relations between the key, ciphertext, and had a weakness to differential attack and showed how the plaintext. The primary aim is to produce a random key plain text can be retrieved. In addition, the authors asymptotic to the true random key [8]. Cryptanalysis recommended how to avoid this attack using different refers to theoretical knowledge and uses numerous sizes of key of greater than 32 bits [14]. statistical tools to find weaknesses in the ciphertext or Kadry and Smaili [15] presented Vigenère RC4 cryptosystems. (VRC4) which is a combination of the RC4 and the poly The rest of the paper is organized as follows. Section alphabetic cipher Vigenère. The plaintext is encrypted 2 reviewsrelated works. Section 3 presents the using the classic RC4 cipher followed by re-encrypting description of RC4, and Section 4 shows some by Vigenère, which results in increased time of weaknesses of RC4. We then present our proposed execution. Mironov [16] presented a new model of RC4 algorithms to enhance RC4 algorithm in section 5. and analyzed it by applying the theory of the random Section 6 describes the evaluation, and Section 7 presents permutation. Based on this study, he recommended the results of the analysis. Section 8 concludes the paper. discarding at least the first 512 bytes to avoid those weaknesses which have led to an increase in the 2. RELATED WORK execution time.Mousa and Hamad examined the analysis Many researchers have tried to enhance the security of the effect of different parameters of the RC4 algorithm of RC4 and create variant algorithms. However, this such as the execution time and the file size and enhancement slowed the implementation speed. On the concluded that the speed of encryption and decryption other hand, many researchers have attempted to improve time is affected by the length of the encryption key and algorithmic speed, but this caused a decrease in the the size of the data file [17].Yao et al. presented analysis randomness. Zoltak [8] proposed Variably Modified and enhancement of the security of the RC4 algorithm by Permutation Composition (VMPC) which was designed using public key encryption with RC4, which has led to to be efficient in software implementations and solved a an increase in the size of the system and the time of weakness found in the RC4 Key Scheduling Algorithm execution [18]. (KSA) that had been described by Fluhrer et al.[9].The Chefranov and Mazurova [19] presented an extension structure of Pseudo-Random Generation Algorithm of RC4 (RC4E) in which they combined RC4 with a (PRGA) in VMPC was more complex in comparison simple Heap’s algorithm to provide enumeration of all with the RC4 which makes it more resistant to attacks. potential permutations for periodic change of RC4 state. Paul and Preneel [10] presented RC4A as an However, their algorithm requires additional memory to enhancement over RC4 after exploring a new statistical keep one more permutation compared with RC4. RC4+ http://journals.uob.edu.bh Int.
Recommended publications
  • LNCS 9065, Pp
    Combined Cache Timing Attacks and Template Attacks on Stream Cipher MUGI Shaoyu Du1,4, , Zhenqi Li1, Bin Zhang1,2, and Dongdai Lin3 1 Trusted Computing and Information Assurance Laboratory, Institute of Software, Chinese Academy of Sciences, Beijing, China 2 State Key Laboratory of Computer Science, Institute of Software, Chinese Academy of Sciences, Beijing, China 3 State Key Laboratory of Information Security, Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China 4 University of Chinese Academy of Sciences, Beijing, China du [email protected] Abstract. The stream cipher MUGI was proposed by Hitachi, Ltd. in 2002 and it was specified as ISO/IEC 18033-4 for keystream genera- tion. Assuming that noise-free cache timing measurements are possible, we give the cryptanalysis of MUGI under the cache attack model. Our simulation results show that we can reduce the computation complexity of recovering all the 1216-bits internal state of MUGI to about O(276) when it is implemented in processors with 64-byte cache line. The at- tack reveals some new inherent weaknesses of MUGI’s structure. The weaknesses can also be used to conduct a noiseless template attack of O(260.51 ) computation complexity to restore the state of MUGI. And then combining these two attacks we can conduct a key-recovery attack on MUGI with about O(230) computation complexity. To the best of our knowledge, it is the first time that the analysis of cache timing attacks and template attacks are applied to full version of MUGI and that these two classes of attacks are combined to attack some cipher.
    [Show full text]
  • Breaking Crypto Without Keys: Analyzing Data in Web Applications Chris Eng
    Breaking Crypto Without Keys: Analyzing Data in Web Applications Chris Eng 1 Introduction – Chris Eng _ Director of Security Services, Veracode _ Former occupations . 2000-2006: Senior Consulting Services Technical Lead with Symantec Professional Services (@stake up until October 2004) . 1998-2000: US Department of Defense _ Primary areas of expertise . Web Application Penetration Testing . Network Penetration Testing . Product (COTS) Penetration Testing . Exploit Development (well, a long time ago...) _ Lead developer for @stake’s now-extinct WebProxy tool 2 Assumptions _ This talk is aimed primarily at penetration testers but should also be useful for developers to understand how your application might be vulnerable _ Assumes basic understanding of cryptographic terms but requires no understanding of the underlying math, etc. 3 Agenda 1 Problem Statement 2 Crypto Refresher 3 Analysis Techniques 4 Case Studies 5 Q & A 4 Problem Statement 5 Problem Statement _ What do you do when you encounter unknown data in web applications? . Cookies . Hidden fields . GET/POST parameters _ How can you tell if something is encrypted or trivially encoded? _ How much do I really have to know about cryptography in order to exploit implementation weaknesses? 6 Goals _ Understand some basic techniques for analyzing and breaking down unknown data _ Understand and recognize characteristics of bad crypto implementations _ Apply techniques to real-world penetration tests 7 Crypto Refresher 8 Types of Ciphers _ Block Cipher . Operates on fixed-length groups of bits, called blocks . Block sizes vary depending on the algorithm (most algorithms support several different block sizes) . Several different modes of operation for encrypting messages longer than the basic block size .
    [Show full text]
  • (SMC) MODULE of RC4 STREAM CIPHER ALGORITHM for Wi-Fi ENCRYPTION
    InternationalINTERNATIONAL Journal of Electronics and JOURNAL Communication OF Engineering ELECTRONICS & Technology (IJECET),AND ISSN 0976 – 6464(Print), ISSN 0976 – 6472(Online), Volume 6, Issue 1, January (2015), pp. 79-85 © IAEME COMMUNICATION ENGINEERING & TECHNOLOGY (IJECET) ISSN 0976 – 6464(Print) IJECET ISSN 0976 – 6472(Online) Volume 6, Issue 1, January (2015), pp. 79-85 © IAEME: http://www.iaeme.com/IJECET.asp © I A E M E Journal Impact Factor (2015): 7.9817 (Calculated by GISI) www.jifactor.com VHDL MODELING OF THE SRAM MODULE AND STATE MACHINE CONTROLLER (SMC) MODULE OF RC4 STREAM CIPHER ALGORITHM FOR Wi-Fi ENCRYPTION Dr.A.M. Bhavikatti 1 Mallikarjun.Mugali 2 1,2Dept of CSE, BKIT, Bhalki, Karnataka State, India ABSTRACT In this paper, VHDL modeling of the SRAM module and State Machine Controller (SMC) module of RC4 stream cipher algorithm for Wi-Fi encryption is proposed. Various individual modules of Wi-Fi security have been designed, verified functionally using VHDL-simulator. In cryptography RC4 is the most widely used software stream cipher and is used in popular protocols such as Transport Layer Security (TLS) (to protect Internet traffic) and WEP (to secure wireless networks). While remarkable for its simplicity and speed in software, RC4 has weaknesses that argue against its use in new systems. It is especially vulnerable when the beginning of the output key stream is not discarded, or when nonrandom or related keys are used; some ways of using RC4 can lead to very insecure cryptosystems such as WEP . Many stream ciphers are based on linear feedback shift registers (LFSRs), which, while efficient in hardware, are less so in software.
    [Show full text]
  • A Practical Attack on Broadcast RC4
    A Practical Attack on Broadcast RC4 Itsik Mantin and Adi Shamir Computer Science Department, The Weizmann Institute, Rehovot 76100, Israel. {itsik,shamir}@wisdom.weizmann.ac.il Abstract. RC4is the most widely deployed stream cipher in software applications. In this paper we describe a major statistical weakness in RC4, which makes it trivial to distinguish between short outputs of RC4 and random strings by analyzing their second bytes. This weakness can be used to mount a practical ciphertext-only attack on RC4in some broadcast applications, in which the same plaintext is sent to multiple recipients under different keys. 1 Introduction A large number of stream ciphers were proposed and implemented over the last twenty years. Most of these ciphers were based on various combinations of linear feedback shift registers, which were easy to implement in hardware, but relatively slow in software. In 1987Ron Rivest designed the RC4 stream cipher, which was based on a different and more software friendly paradigm. It was integrated into Microsoft Windows, Lotus Notes, Apple AOCE, Oracle Secure SQL, and many other applications, and has thus become the most widely used software- based stream cipher. In addition, it was chosen to be part of the Cellular Digital Packet Data specification. Its design was kept a trade secret until 1994, when someone anonymously posted its source code to the Cypherpunks mailing list. The correctness of this unofficial description was confirmed by comparing its outputs to those produced by licensed implementations. RC4 has a secret internal state which is a permutation of all the N =2n possible n bits words.
    [Show full text]
  • Most Popular ■ CORN STALK RUNNER at Flock Together This 2017 TROY TURKEY TROT
    COVERING FREE! UPSTATE NY NOVEMBER SINCE 2000 2018 Flock Together this Thanksgiving ■ 5K START AT 2013 TROY TURKEY TROT. JOIN THE CONTENTS 1 Running & Walking Most Popular ■ CORN STALK RUNNER AT Flock Together this 2017 TROY TURKEY TROT. Thanksgiving! 3 Alpine Skiing & Boarding Strutting Day! Ready for Ski Season! By Laura Clark 5 News Briefs 5 From the Publishers hat I enjoy most about Thanksgiving is that it is a teams are encouraged and die-hards relaxed, all-American holiday. And what is more are invited to try for the individual 50K option. 6-9 CALENDAR OF EVENTS WAmerican than our plucky, ungainly turkey? Granted, Proceeds benefit the Regional Food Bank of Northeastern New although Ben Franklin lost his bid to elevate our native species to November to January York, enabling them to ensure a bountiful Thanksgiving for every- national symbol status, the turkey gets the last cackle. For when one. (fleetfeetalbany.com) Things to Do was the last time you celebrated eagle day? On Thanksgiving Day, Thursday, November 22, get ready for 11 Hiking, Snowshoeing In a wishbone world, Thanksgiving gives the least offense. the most popular running day of the whole year. Sample one of Sure, it is a worry for turkeys but a trade-off if you consider all the these six races in our area. & Camping free publicity. While slightly distasteful for vegetarians, there are While most trots cater to the 5K crowd, perfect for strollers, West Stony Creek: Well-Suited all those yummy sides and desserts to consider. Best of all is the aspiring turklings and elders, the premiere 71st annual Troy emphasis on family members, from toms to hens to the littlest Turkey Trot is the only area race where it is still possible to double for Late Fall/Early Winter turklings (think ducklings).
    [Show full text]
  • SGX Secure Enclaves in Practice Security and Crypto Review
    SGX Secure Enclaves in Practice Security and Crypto Review JP Aumasson, Luis Merino This talk ● First SGX review from real hardware and SDK ● Revealing undocumented parts of SGX ● Tool and application releases Props Victor Costan (MIT) Shay Gueron (Intel) Simon Johnson (Intel) Samuel Neves (Uni Coimbra) Joanna Rutkowska (Invisible Things Lab) Arrigo Triulzi Dan Zimmerman (Intel) Kudelski Security for supporting this research Agenda .theory What's SGX, how secure is it? .practice Developing for SGX on Windows and Linux .theory Cryptography schemes and implementations .practice Our projects: reencryption, metadata extraction What's SGX, how secure is it? New instruction set in Skylake Intel CPUs since autumn 2015 SGX as a reverse sandbox Protects enclaves of code/data from ● Operating System, or hypervisor ● BIOS, firmware, drivers ● System Management Mode (SMM) ○ aka ring -2 ○ Software “between BIOS and OS” ● Intel Management Engine (ME) ○ aka ring -3 ○ “CPU in the CPU” ● By extension, any remote attack = reverse sandbox Simplified workflow 1. Write enclave program (no secrets) 2. Get it attested (signed, bound to a CPU) 3. Provision secrets, from a remote client 4. Run enclave program in the CPU 5. Get the result, and a proof that it's the result of the intended computation Example: make reverse engineer impossible 1. Enclave generates a key pair a. Seals the private key b. Shares the public key with the authenticated client 2. Client sends code encrypted with the enclave's public key 3. CPU decrypts the code and executes it A trusted
    [Show full text]
  • The Moral Character of Cryptographic Work⋆
    The Moral Character of Cryptographic Work? Phillip Rogaway Department of Computer Science University of California, Davis, USA [email protected] December 2015 (minor revisions March 2016) Abstract. Cryptography rearranges power: it configures who can do what, from what. This makes cryptography an inherently political tool, and it confers on the field an intrinsically moral dimension. The Snowden revelations motivate a reassessment of the political and moral positioning of cryptography. They lead one to ask if our inability to effectively address mass surveillance constitutes a failure of our field. I believe that it does. I call for a community-wide effort to develop more effective means to resist mass surveillance. I plead for a reinvention of our disciplinary culture to attend not only to puzzles and math, but, also, to the societal implications of our work. Keywords: cryptography · ethics · mass surveillance · privacy · Snowden · social responsibility Preamble. Most academic cryptographers seem to think that our field is a fun, deep, and politically neutral game|a set of puzzles involving communicating parties and notional adversaries. This vision of who we are animates a field whose work is intellectually impressive and rapidly produced, but also quite inbred and divorced from real-world concerns. Is this what cryptography should be like? Is it how we should expend the bulk of our intellectual capital? For me, these questions came to a head with the Snowden disclosures of 2013. If cryptography's most basic aim is to enable secure communications, how could it not be a colossal failure of our field when ordinary people lack even a modicum of communication privacy when interacting electronically? Yet I soon realized that most cryptographers didn't see it this way.
    [Show full text]
  • Ensuring Fast Implementations of Symmetric Ciphers on the Intel Pentium 4 and Beyond
    This may be the author’s version of a work that was submitted/accepted for publication in the following source: Henricksen, Matthew& Dawson, Edward (2006) Ensuring Fast Implementations of Symmetric Ciphers on the Intel Pentium 4 and Beyond. Lecture Notes in Computer Science, 4058, Article number: AISP52-63. This file was downloaded from: https://eprints.qut.edu.au/24788/ c Consult author(s) regarding copyright matters This work is covered by copyright. Unless the document is being made available under a Creative Commons Licence, you must assume that re-use is limited to personal use and that permission from the copyright owner must be obtained for all other uses. If the docu- ment is available under a Creative Commons License (or other specified license) then refer to the Licence for details of permitted re-use. It is a condition of access that users recog- nise and abide by the legal requirements associated with these rights. If you believe that this work infringes copyright please provide details by email to [email protected] Notice: Please note that this document may not be the Version of Record (i.e. published version) of the work. Author manuscript versions (as Sub- mitted for peer review or as Accepted for publication after peer review) can be identified by an absence of publisher branding and/or typeset appear- ance. If there is any doubt, please refer to the published source. https://doi.org/10.1007/11780656_5 Ensuring Fast Implementations of Symmetric Ciphers on the Intel Pentium 4 and Beyond Matt Henricksen and Ed Dawson Information Security Institute, Queensland University of Technology, GPO Box 2434, Brisbane, Queensland, 4001, Australia.
    [Show full text]
  • An Archeology of Cryptography: Rewriting Plaintext, Encryption, and Ciphertext
    An Archeology of Cryptography: Rewriting Plaintext, Encryption, and Ciphertext By Isaac Quinn DuPont A thesis submitted in conformity with the requirements for the degree of Doctor of Philosophy Faculty of Information University of Toronto © Copyright by Isaac Quinn DuPont 2017 ii An Archeology of Cryptography: Rewriting Plaintext, Encryption, and Ciphertext Isaac Quinn DuPont Doctor of Philosophy Faculty of Information University of Toronto 2017 Abstract Tis dissertation is an archeological study of cryptography. It questions the validity of thinking about cryptography in familiar, instrumentalist terms, and instead reveals the ways that cryptography can been understood as writing, media, and computation. In this dissertation, I ofer a critique of the prevailing views of cryptography by tracing a number of long overlooked themes in its history, including the development of artifcial languages, machine translation, media, code, notation, silence, and order. Using an archeological method, I detail historical conditions of possibility and the technical a priori of cryptography. Te conditions of possibility are explored in three parts, where I rhetorically rewrite the conventional terms of art, namely, plaintext, encryption, and ciphertext. I argue that plaintext has historically been understood as kind of inscription or form of writing, and has been associated with the development of artifcial languages, and used to analyze and investigate the natural world. I argue that the technical a priori of plaintext, encryption, and ciphertext is constitutive of the syntactic iii and semantic properties detailed in Nelson Goodman’s theory of notation, as described in his Languages of Art. I argue that encryption (and its reverse, decryption) are deterministic modes of transcription, which have historically been thought of as the medium between plaintext and ciphertext.
    [Show full text]
  • Solutions Manual
    SOLUTIONS MANUAL CRYPTOGRAPHY AND NETWORK SECURITY PRINCIPLES AND PRACTICE FOURTH EDITION WILLIAM STALLINGS Copyright 2006: William Stallings -2- © 2006 by William Stallings All rights reserved. No part of this document may be reproduced, in any form or by any means, or posted on the Internet, without permission in writing from the author. -3- NOTICE This manual contains solutions to all of the review questions and homework problems in Cryptography and Network Security, Fourth Edition. If you spot an error in a solution or in the wording of a problem, I would greatly appreciate it if you would forward the information via email to [email protected]. An errata sheet for this manual, if needed, is available at ftp://shell.shore.net/members/w/s/ws/S. W.S. -4- TABLE OF CONTENTS Chapter 1: Introduction..............................................................................................5 Chapter 2: Classical Encryption Techniques ............................................................7 Chapter 3: Block Ciphers and the Date Encryption Standard .............................. 13 Chapter 4: Finite Fields ............................................................................................ 21 Chapter 5: Advanced Encryption Standard ........................................................... 28 Chapter 6: More on Symmetric Ciphers ................................................................. 33 Chapter 7: Confidentiality Using Symmetric Encryption..................................... 38 Chapter 8: Introduction to Number Theory..........................................................
    [Show full text]
  • RC4 Encryption
    Ralph (Eddie) Rise Suk-Hyun Cho Devin Kaylor RC4 Encryption RC4 is an encryption algorithm that was created by Ronald Rivest of RSA Security. It is used in WEP and WPA, which are encryption protocols commonly used on wireless routers. The workings of RC4 used to be a secret, but its code was leaked onto the internet in 1994. RC4 was originally very widely used due to its simplicity and speed. Typically 16 byte keys are used for strong encryption, but shorter key lengths are also widely used due to export restrictions. Over time this code was shown to produce biased outputs towards certain sequences, mostly in first few bytes of the keystream generated. This led to a future version of the RC4 code that is more widely used today, called RC4-drop[n], in which the first n bytes of the keystream are dropped in order to get rid of this biased output. Some notable uses of RC4 are implemented in Microsoft Excel, Adobe's Acrobat 2.0 (1994), and BitTorrent clients. To begin the process of RC4 encryption, you need a key, which is often user-defined and between 40-bits and 256-bits. A 40-bit key represents a five character ASCII code that gets translated into its 40 character binary equivalent (for example, the ASCII key "pwd12" is equivalent to 0111000001110111011001000011000100110010 in binary). The next part of RC4 is the key-scheduling algorithm (KSA), listed below (from Wikipedia). for i from 0 to 255 S[i] := i endfor j := 0 for i from 0 to 255 j := (j + S[i] + key[i mod keylength]) mod 256 swap(S[i],S[j]) endfor KSA creates an array S that contains 256 entries with the digits 0 through 255, as in the table below.
    [Show full text]
  • Bias in the LEVIATHAN Stream Cipher
    Bias in the LEVIATHAN Stream Cipher Paul Crowley1? and Stefan Lucks2?? 1 cryptolabs Amsterdam [email protected] 2 University of Mannheim [email protected] Abstract. We show two methods of distinguishing the LEVIATHAN stream cipher from a random stream using 236 bytes of output and pro- portional effort; both arise from compression within the cipher. The first models the cipher as two random functions in sequence, and shows that the probability of a collision in 64-bit output blocks is doubled as a re- sult; the second shows artifacts where the same inputs are presented to the key-dependent S-boxes in the final stage of the cipher for two suc- cessive outputs. Both distinguishers are demonstrated with experiments on a reduced variant of the cipher. 1 Introduction LEVIATHAN [5] is a stream cipher proposed by David McGrew and Scott Fluhrer for the NESSIE project [6]. Like most stream ciphers, it maps a key onto a pseudorandom keystream that can be XORed with the plaintext to generate the ciphertext. But it is unusual in that the keystream need not be generated in strict order from byte 0 onwards; arbitrary ranges of the keystream may be generated efficiently without the cost of generating and discarding all prior val- ues. In other words, the keystream is “seekable”. This property allows data from any part of a large encrypted file to be retrieved efficiently, without decrypting the whole file prior to the desired point; it is also useful for applications such as IPsec [2]. Other stream ciphers with this property include block ciphers in CTR mode [3].
    [Show full text]