Wireless Network Privacy ~ Advantages and disadvantages of RC4 Encryption

written by: Brian Rodrigues; article published: year 2006, month 08;



In: Categories » Electronics and communication » Wireless and mobile computing » Wireless Network Privacy ~ Advantages and disadvantages of RC4 Encryption

As previously mentioned, RC4 is an encryption algorithm used to scramble data so completely that it would take years to decipher using current technology. What makes RC4 so powerful is its speed and strength. To analyze RC4, we must first begin with some definitions.

Algorithm

An algorithm is an explicit set of instructions that have a defined starting and ending point. For example, the instructions you would follow to set up a VCR are considered an algorithm (although some might argue this). In reality, you perform algorithmic steps all the time. Everything from starting a car to baking a cake can be defined by an algorithm.

Cryptology (Encryption/Decryption)

Cryptology is the study of encryption and decryption algorithms. Encryption is simply the scrambling of a message or data through the use of an algorithm; the opposite of this is decryption.

Encryption is typically accomplished with the assistance of an external piece of data, which often comes in the form of a user-selected password or pass phrase. This not only makes the encryption stronger by enforcing a unique key, but it also keeps anyone who does not know the password from accessing the data.

There are two main types of encryption: symmetrical and asymmetrical. Each has its strengths and weaknesses and is best suited to specific applications.

Symmetrical Encryption

The symmetrical encryption and decryption processes are both accomplished using the same key. This is the most prevalent form of encryption. As an example, let's encrypt the word wireless.

  1. Take the word and separate each letter and place a number 1 between each letter.

    wireless -> w 1 i 1 r 1 e 1 l 1 e 1 s 1 s

  2. Convert the letters into their corresponding alphabetical numbers.

    w1i1r1e1l1e1s1s -> 23 1 9 1 18 1 5 1 12 1 5 1 19 1 19

  3. Add 2 to each separate value.

    23 1 9 1 18 1 5 1 12 1 5 1 19 1 19 -> 25 3 11 3 20 3 7 3 14 3 7 21 3 21

You have now performed an encryption algorithm on the word wireless; to decrypt the ciphertext, simply step through the previous algorithm in reverse order.

  1. 25 3 11 3 20 3 7 3 14 3 7 21 3 21 -> (- 2) -> 23 1 9 1 18 1 5 1 12 1 5 1 19 1 19

  2. 23 1 9 1 18 1 5 1 12 1 5 1 19 1 19 -> (convert to alpha value) -> w1i1r1e1l1e1s1s

  3. w 1 i 1 r 1 e 1 l 1 e 1 s 1 s -> (remove 1s) -> wireless

This algorithm is a good example of how computers have revolutionized data encryption. By hand, this type of processing would require hours for even the simplest and shortest of messages. However, give a computer this task, and it will take seconds to decrypt a page's worth of data.

As mentioned previously, symmetrical encryption uses pass phrases or key words to assist it in the encryption of a message. Using the previous example, we will now encrypt the word wireless using the word wep.

  1. Convert each letter in the message into its alphanumerical value.

    wireless -> 23 9 18 5 12 5 19 19

  2. Convert each letter in the pass phrase into its alphanumerical value.

    wep -> 23 5 16

  3. Merge the words together starting from the left, repeating the password as necessary.

Thus, you now have an example of symmetric encryption. To decrypt it, you would need to know (or deduce) that the key was wep. Although our example used a short word, imagine the output from a page-long key. The results would be a long string of numbers that have nothing to do with the original value, and would remain worthless without the password wep.

Symmetric encryption is much faster than asymmetric encryption. However, the difficulty with symmetric encryption is that its security depends upon keeping its password secret.

Asymmetrical Encryption

The other type of encryption is known as asymmetrical encryption. This encryption is much more complex, but it has the potential to be more secure. A growing number of applications are incorporating this type of security. Email applications, VPNs, PKI, and even Application Service Providers use asymmetrical encryption.

Asymmetrical encryption requires the use of two keys, one public and one private. Each key requires the use of the other to decipher a message. In other words, imagine that your boss wants to send a secure message to you, and to be fairly confident that only you can open it. She could seal the message in a box using a padlock for which only you have the key. Thus, without your private key, not even your boss can reopen the message after it is secured.

Note that asymmetric encryption requires everyone to have access to a copy of your public "lock," also known as a public key. Typically, this information is available from a central server or a Web site and can be retrieved with minimal effort. However, this one extra step increases the level of complexity just enough to limit the universal adoption of asymmetric encryption.

Disadvantages of Encryption

There are multiple benefits with encryption. For example, it can be used to authenticate users, authorize access to resources, ensure data confidentiality, and guarantee data integrity. It can also be used to provide nonrepudiation for transactions.

However, there are also several potential drawbacks with encryption. These drawbacks include lost passwords, a false sense of security, and the processing overhead of using encryption. This section will briefly address these issues as they apply to wireless networking.

Lost Password

One problem with encryption is what to do in the event of a lost password. In this case, the only option is to find a method of cracking the password. However, depending on the method of encryption, it could be many years before you extract any data. In addition, some countries, including the United States, consider the very act of cracking a password illegal—even if the data belongs to you. Just ask security researcher Dmitry Sklyarov, a programmer for the Russian company Elcomsoft. At the behest of Adobe Systems, the FBI controversially arrested Sklyarov after he gave an academic presentation on password recovery.

Using Encryption Does Not Guarantee Security

The second issue is one of the biggest threats to wireless users. Many people consider their networks to be secure based solely on the fact that they are using WEP. This assumption is flawed, as the password is usually left blank or as the default. In addition, WEP does not protect against most traditional hacker attacks. Finally, WEP itself is fundamentally flawed. I encourage you to use WEP, but never use it as your only line of defense.

Password/shared-secret-based keys are only as good as the human that creates them. If passwords are easily guessed or appear in a dictionary, then it is far easier to guess/lookup the password/key than to brute-force the entire keyspace. This applies to all password based authentication/crypto systems.

Additionally, if a crypto system has algorithmic flaws or implementation flaws, the crypto can be circumvented. WEP is an example of a good cipher (RC4) implemented poorly. RC4 can be rendered ineffective due to the implementation flaws in WEP.

Encryption Overhead

The last issue also applies to wireless networking—the overhead or CPU time that it takes to encrypt and decrypt network data. This overhead can have a serious impact on the productivity of a network application, and can have detrimental results in time-critical situations.

Any encryption adds overhead to the processing requirements of a networking system. Encryption delays the transmission process and can also adversely affect network device processors' ability to deal with other critical/needed functions.

Ciphers

When discussing symmetric encryption, there are two main methods by which a chunk of data can be encrypted. It is important to understand the differences and the benefits of how they work in order to understand how RC4 encrypts data.

Block

A block cipher (such as DES or 3DES) takes a large chunk of data and encrypts it with the key. This process is repeated over and over again until the whole message is completely encrypted. Typically there is a size variable that controls how big the chunk of data can be. Regardless of the size, the entire key is used to encrypt the chunk of data.

For example, suppose you want to send your boss an email using a block cipher. In this case, you would enter one password, and the entire message would be encrypted at one time. The following equation illustrates the simplicity of this type of encryption, as well as its weakness.

Cipher Function (data, pass phrase) = Output 

Note that the entire pass phrase is used each time in its original form to encrypt the data. With continuous use, a block cipher is functionally weak. If even two blocks are encrypted with the same cipher, the pass phrase could be extracted from the ciphertext.

In other words, if an attacker can determine the original data of just one message, he can compare the ciphertext with the plaintext and calculate the difference. This difference would then be the code to crack any future encrypted messages. In addition, the two messages can be analyzed and compared. Depending on the encryption method, the two messages can be merged, which would cancel out the encryption, and essentially provide a hacker all the information he needs to view the data.

Stream Cipher

A stream cipher also uses a pass phrase. However, it encrypts data on a much smaller scale. Whereas a block cipher might encrypt a whole page of text at one time, a stream cipher can encrypt the bits that make up one letter of a page of text. To illustrate, the letter A is equivalent to the decimal value of 65, which can be converted to one byte, which in turn is comprised of eight bits. A stream cipher can encrypt that one bit before sending it out, and repeat the encryption seven more times for just one letter. This can result in thousands of encrypted values for a complete email or message.

A streaming cipher is capable of encrypting on a detailed level because it uses a state condition, in addition to the pass phrase and data. This means the data is encrypted differently for each chunk that passes through the encryption program. To perform a stream cipher, two streams are generated, one that feeds into the other. The first stream is called the key stream, which combines a state value, data value, and pass phrase value to generate a randomly changing stream of data. The key stream in turn is used to produce the output cipher by combining the new state value (from the key stream), data value, and key value. Mathematically, this is accomplished using two functions, as compared to the one function of a block cipher. This can be depicted as shown in the following section.

Self-Synchronizing Stream Cipher

The following are the two functions of the self-synchronizing stream cipher:

State Time+1 = State Function(State Time, Data Time, Password Time)  
Output Time = Cipher Function(State Time, Data Time, Password Time) 

As illustrated, the output is now dependent on three variables, two of which will be changing (the password is constant). The first function is known as the key stream generator, and the second is the cipher function.

The strength of this type of encryption is found in the fact that there are now two variables that change. Therefore, even if there is a predictable value in the data, the state will be randomly different, which significantly decreases the chances of an attacker being able to extract relevant data from the cipher.

There are a couple variations of stream ciphers that we need to define before we discuss weaknesses with the RC4 cipher implementation in WEP. These are known as synchronous stream ciphers and self-synchronizing stream ciphers. The difference between the two is found in whether the key stream relies on the data to produce the stream. The previous example illustrates how a self-synchronizing stream ciphers, as it relies on the data to produce the key stream. In contrast, the following example illustrates how a synchronous stream cipher creates the output. In this type of cipher, the first two functions combined are considered the key stream generator.

- Stream-2: Synchronous Stream Cipher   
State Time+1 = State Function(State Time, Password Time)   
Stream Value Time = Keystream Function(State Time, Password Time)   
Output Time = Cipher Function(Stream Value Time, Data Time) 

Although the synchronous cipher might seem more complicated, it is actually weaker than the self-synchronizing cipher. Notice from the last function of this type of cipher that only one "unknown" value is needed to reverse the encryption. On the other hand, the self-synchronizing encryption uses three variables.

The previous functions represent a process through which the data is combined. This process can be comprised of anything ranging from complex mathematical calculations to a simple addition of the two values. In our case, for RC4 the last function is an XOR binary addition process. The following will explain the XOR function, as it is used to produce the final RC4 ciphertext.

XOR

XOR is a simple logical operation. In our case, it serves as a rudimentary encryption scheme that combines one segment of data with another to produce a scrambled output. XOR is one of the most popular methods for encrypting data because of its speed and the fact that it works at the bit level.

To understand XOR, you must understand logic structures. See whether you can determine how the final bit is calculated

Sample XOR Comparison

Byte 1:

1

0

0

1

0

0

1

0

XOR Byte:

0

0

0

1

0

1

1

1

Output Byte:

1

0

0

0

0

1

0

1

From this example, you should be able to determine a pattern. By comparing the bits from Byte 1 with the corresponding bits from the XOR byte, you can quickly deduce the algorithm. When there are similar bit characters (for example, 0 - 0, 1 - 1) the resulting bit is a 0, and when there are different bit characters (for example, 0 - 1, 1 -0) the resulting bit is a 1.

XOR Comparison Table

Original bit

XOR bit

Resulting bit

1

1

0

0

0

0

1

0

1

0

1

1

Although this type of encryption is rapid and operates at the bit level, it is problematic. To illustrate, let's examine the XOR calculation of a series of two bytes. The first will XOR the binary value of letter A, and the second will XOR the value of NULL (that is, zero), each using the XOR byte of 1111111

XOR of the Letter A Using XOR Key of 11111111

A:

1

0

0

0

0

0

0

1

XOR Byte:

1

1

1

1

1

1

1

1

Output Byte:

0

1

1

1

1

1

1

0

XOR of NULL Using XOR Key of 11111111

NULL:

0

0

0

0

0

0

0

0

XOR Byte:

1

1

1

1

1

1

1

1

Output Byte:

1

1

1

1

1

1

1

1

The letter A is transformed into a completely different value, which happens to be equivalent to the tilde (~) in ACSII. However, the resulting value is the same as the XOR key! In other words, if an attacker can determine that a chunk of data is NULL, he can quickly determine the XOR key used to encrypt that particular piece of code.

Although this is a security issue, in a proper implementation of RC4, the state value should randomly change, which then changes the XOR key. Therefore, any transposing of the XOR value would occur randomly, and would be almost impossible to predict. For example, if the key at Time 1 was 10101010, and the data was 01010101, the resulting value would be 11111111. This value would be the same if at Time 2 the key was 11111111 and the data was 00000000.

XOR Key Change

Data T1:

0

1

0

1

0

1

0

1

Data T2:

0

0

0

0

0

0

0

0

XOR Key T1:

1

0

1

0

1

0

1

0

XOR Key T2:

1

1

1

1

1

1

1

1

Output T1:

1

1

1

1

1

1

1

1

Output T2:

1

1

1

1

1

1

1

1

As you can see from the table, an attacker would have no way of knowing if the resulting value was a result of a NULL character or the result of a valid piece of data. However, this is irrelevant if the attacker can determine which packets of data did contain NULL characters.

legal disclaimer

1) Our website is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringements, please read the Terms of service and contact us to investigate the problem.
2) The E-articles directory team is not responsible for inaccuracies, falsehoods, or any other types of misinformation this tutorial may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. Please read the Terms of service

Useful tools and features

Translate this article to...    Send this article to you or to a friend

Link to this article from your page   
If you like this article (tutorial), please link to it from your web page using the information above. Linking to this page, this is the only way to help us improve our service, the same time providing your visitors with a way to improve their online experience.

related articles

1. Wireless Attacks ~ War Driving
When a surveillance attack is either impossible or too difficult, war driving is an effective alternative. In many situations, war driving follows and adds information to a prior surveillance attack. Conversely, the information obtained from random war driving often leads to a surveillance attack on a discovered location. The term war driving is borrowed from the 1980s phone hacking tactic known as war dialing. War dialing involves dialing all the phone numbers in a given sequence to search for modems. In fact, this method of ...

2. How To Get Photo Quality Prints
There are a variety of ways to get photo-quality prints from your digital images. You can make them yourself with a printer at home, or have a photo finisher do the work for you. Many camera stores offer photo finishing from digital images. Simply take in your memory card, order the prints, and pick them up the next day. This service is now available in most drugstore chains, too—instead of dropping off a roll of film while running your errands, you leave them your memory card instead. You can also order prints throu...

3. Wireless Privacy Protocols ~ WEP detailed
The Wired Equivalent Privacy protocol is incorporated as part of the IEEE 802.11b protocol. Actually, the standard only calls for 40-bit WEP, but almost all vendors offer up to 128-bit WEP. To secure data, WEP uses the RC4 algorithm to encrypt the packets of information as they are sent out from the access point or wireless network card. This is the same algorithm used in many other Internet applications that require security, such as Secure Sockets Layer (SSL). SSL is the most common protocol used by online stores to e...

4. Wireless Attacks ~ Rogue Access Points
Rogue access points are those connected to a network without planning or permission from the network administrator. For example, we know one administrator in Dallas who just did his first wireless security scan (war driving) on his eight-building office campus. To his surprise, he found over thirty access points. Worse, only four of them had authorization to be connected to the network. Needless to say, heads rolled. Rogue access points are becoming a major headache in the security industry. With the price of low-end ac...

5. Wireless Network Protocols ~ Advantages and Disadvantages of Bluetooth
There are various wireless communication protocols. These technologies range in scope from long distance WLANs to one-meter IrDA devices. Each of these technologies has its niche, as well as its attendant strengths and weaknesses. For example, WLANs enable the transmission of data up to several hundred feet, but often require manual configuration changes that are difficult to implement. On the other hand, IrDA permits a seamless connection between devices without the need for extra configuration. However, their usability is de...

6. Wireless Network Protocols ~ Understanding HomeRF and IrDA
About the same time WECA approved the 802.11 standard, several other types of wireless technologies were being introduced. Although a few have made a rather impressive niche in the Personal Area Network (PAN) market, the only other WLAN technology that came close to competing with 802.11 was HomeRF. Using the Shared Wireless Access Protocol (SWAP), HomeRF merges the 802.11 FHSS standard with the six voice channels based on Digital Enhanced Cordless Telecommunications (DECT). In other words, the home network included both ...

7. WLAN Broadcasting ~ MiniStumbler ~ a wireless network scanner
MiniStumbler is a very user-friendly wireless network scanner that listens for beacon signals coming from open and broadcasting WLANs. In addition, this program will provide a plethora of information that makes it very useful for both hackers and the security professionals. As you will see, MiniStumbler might be small, but it packs a load of power in its functionality. Installing MiniStumbler MiniStumbler is a basic one-file program that simply needs to be downloaded, unzipped, and placed in the My Documents sha...

8. How To Present a Digital Slideshow
Slideshows are an age-old photographic tradition. Digital cameras make it easier than ever to present your images to many people at once. Most digicams have a "video out" capability that lets you connect your camera directly to a television for playback on a large screen. If your camera has this functionality, it most likely has a slideshow mode that allows you to choose images that are stored on the memory card and present them on the television in timed intervals. All you have to do is turn on the stereo for some ba...

9. Concerns for Mobile Enterprises
Although it is one thing for organizations to keep up with the latest industry trends, making it happen in everyday life is a totally different story. The following are some of the key concerns of enterprises that are contemplating a mobile e-commerce strategy: Security: Wireless networks are very easy to break into and difficult to monitor. Your enterprise assets must be protected. Management: Effective management of the components that make up a mobile enterprise, all the way from servers to the ...