0% found this document useful (0 votes)
180 views18 pages

Unit 2 (RC 5)

RC4 is a stream cipher developed in 1987 by Ron Rivest. It is fast and simple to implement in both software and hardware. RC5 is a block cipher also developed by Ron Rivest in 1994 as a candidate for the AES competition. It allows variable block sizes, number of rounds, and key sizes. The algorithm works by dividing the plaintext block into two parts, adding subkeys in an initial operation, and then performing rounds of XOR, shifting, and addition with subkeys.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
180 views18 pages

Unit 2 (RC 5)

RC4 is a stream cipher developed in 1987 by Ron Rivest. It is fast and simple to implement in both software and hardware. RC5 is a block cipher also developed by Ron Rivest in 1994 as a candidate for the AES competition. It allows variable block sizes, number of rounds, and key sizes. The algorithm works by dividing the plaintext block into two parts, adding subkeys in an initial operation, and then performing rounds of XOR, shifting, and addition with subkeys.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

RC4

 RC4 was designed by Ron Rivest of RSA Security in 1987. The official name for this
algorithm is “Rivest Cipher 4”.
 RC4 is a stream cipher.
 RC4 was initially kept secret.
 RC4 has become part of some widely used encryption techniques and standards, including
WEP and WPA for wireless cards and TLS. What has made its wide deployment possible is
its speed and simplicity of design. Implementations in both software and hardware are
possible. RC4 does not consume many resources.
RC5
 RC5 is a symmetric-key block-encryption algorithm developed by Ron Rivest in 1994. It is
part of the RC series of encryption algorithms, which includes RC2, RC4, and RC6, all
developed by Ron Rivest.
 The main features of RC5 are that it is quite fast as it uses only the primitive computer
operations (such as addition, XOR, shift, etc).
 It was designed as a candidate for the Advanced Encryption Standard (AES) competition,
which aimed to select a new encryption standard to replace the aging Data Encryption
Standard (DES). Ultimately, the Rijndael algorithm was selected as AES, but RC-5 remains
a notable encryption algorithm.
 It allows for a variable number of rounds, and a variable bit-size key to add to the
flexibility.
 RC5 requires less memory for execution, and is therefore, suitable not only for desktop
computers, but also for smart cards and other devices that have a small memory capacity.
 It has been incorporated into the RSA Data Security Incorporation’s products such as
BSAFE, JSAFE and S/MAIL.
How RC5 Works
 In RC5, the word size (i.e. input plain-text block size), number of rounds and number of 8-
bit bytes (octets) of the key, all can be of variable length.
RC-5
 The output resulting from RC5 is the cipher text, which has the same size as the
input plain text.
 Since RC5 allows for variable values in the three parameters, as specified, a
particular instance of the RC5 algorithm is denoted as:
 RC5-w/r/b, where w = word size in bits, r = number of rounds, b = number of 8-bit
bytes in the key.
 Thus, if we have RC5-32/16/16, it means that we are using RC5 with a block size of
64 bits (remember that RC5 uses 2-word blocks), 16 rounds of encryption, and 16
bytes (i.e. 128 bits) in the key.
 Rivest has suggested RC5-32/12/16 as the minimum safety version.
Components of RC-5
2. Principles of Operation
 There is one initial operation consisting of two steps , then a number of rounds.
 The number of rounds (r) can vary from 0 to 255.
 For simplicity, we shall assume that we are working on an input plain block with size 64
bits. The same principles operation will apply to other block sizes, in general.
 In the first two steps of the one-time initial operation, the input plain text is divided into
two 32-bit blocks A and B.
 The first two sub-keys S[0] and S[1] are added to A and B, respectively. This produces C
and D respectively, and marks the end of the one-time operation.
 Then, the rounds begin. In each round, there are following operations:
● Bitwise XOR ● Left circular-shift ● Addition with the next sub-key, for both C and
D.
 This is the addition operation first, and then the result of the addition mod
performed.
3. One-time Initial Operation

 This consists of two simple steps:


 first, the input plain text is divided into two equal-sized blocks, A and B.
 Then the first subkey, i.e. S[0] is added to A, and the second sub-key, i.e. S[1] is added to
B.
 These operations are mod 2^32, as we have noted, and produce C and D, respectively
4. Details of One Round
 Step 1: XOR C and D Step-2Circular-left shift E

Step 3: Add E and Next Sub key


Step 4: XOR D and F Step 5: Circular-left Shift G

Step 6: Add G and Next Sub-key


Step 7: Miscellaneous Tasks
5. Subkey Creation
 This is a two-step process.
1. In the first step, the subkeys (denoted by S[0], S[1], …) are generated.
2. The original key is called L. In the second step, the subkeys (S[0], S[1], …) are mixed with
the corresponding sub portions of the original key (i.e. L[0], L[1], …).
1. Subkey Generation
Step 1: Sub-key Generation
 In this step, two constants P and Q are used. The array of subkeys to be generated is called
as S. The first subkey S[0] is initialized with the value of P.
 Each next subkey (i.e. S[1], S[2], …) is calculated on the basis of the previous sub-key and
the constant value Q, using the addition mod 2^32 operations.
 The process is done 2 (r + 1) – 1 times, where r is the number of rounds, as before. Thus, if
we have 12 rounds, this process will be done 2 (12 + 1) – 1 times, i.e. 2 (13) – 1 times, i.e.
25 times. Thus, we will generate subkeys S[0], S[1], … S[25].
Step 2: Subkey Mixing

 In the subkey mixing stage, the subkeys S[0], S[1], … are mixed with the sub-portions of the
original key, i.e. L[0], L[1], … L[c]. Note that c is the last sub-key position in the original key.
 Key Expansion :
 RC5 performs a complex set of operations on the secret key to produce a total of t
subkeys. Two subkeys are used in each round, and two subkeys are used on an additional
operation that is not part of any round, so t = 2r + 2.
 Each subkey is one Word (w bits) in length.
 The subkeys are stored in a t-word array labeled S[0], S[1], ….,‘ S[t-1]. Using the
parameters r and w as inputs, this array is initialized to a particular fixed pseudorandom bit
pattern.
 Then the b-byte key, K[0…. b - 1], is converted into a c-word array L[0…. c -1]. On a little
endian machine, this is accomplished by zeroing out the array L and copying the string K
directly into the memory positions represented by L.
 If b is not an integer multiple of w, then a portion of L at the right end remains zero.
Finally, a mixing operation is performed that applies the contents of L to the initialized
value of S to produce a final value for the array S.
 The initialize operation makes use of two word-length constants defined as follows:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy