Chapter 4.1: The Art of Protecting Secrets _ Cryptography

The principles of cryptology explain how modern day protocols and algorithms secure communications. Cryptology is the science of making and breaking secret codes. The development and use of codes is cryptography. Studying and breaking codes is cryptanalysis. Society has used cryptography for centuries to protect secret documents. For example, Julius Caesar used a simple alphabetic cipher to encrypt messages to his generals in the field. His generals would have knowledge of the cipher key required to decrypt the messages. Today, modern day cryptographic methods ensure secure communications.

Access control is, as its name suggests, a way of controlling access to a building, a room, a system, a database, a file, and information. Organizations employ a variety of access control techniques to protect confidentiality. This chapter will examine the four steps in the access control process: 1) identification, 2) authentication, 3) authorization, and 4) accountability. In addition, the chapter describes the different access control models and access control types.

The chapter concludes by discussing the various ways users mask data. Data obfuscation and steganography are two techniques used to accomplish data masking.

What is Cryptography?

Cryptology is the science of making and breaking secret codes. Cryptography is a way to store and transmit data so only the intended recipient can read or process it. Modern cryptography uses computationally secure algorithms to make sure that cyber criminals cannot easily compromise protected information.

Data confidentiality ensures privacy so that only the intended receiver can read the message. Parties achieve this through encryption. Encryption is the process of scrambling data so that an unauthorized party cannot easily read it.

When enabling encryption, readable data is plaintext, or cleartext, while the encrypted version is encrypted text or ciphertext. Encryption converts the plaintext readable message to ciphertext, which is the unreadable, disguised message. Decryption reverses the process. Encryption also requires a key, which plays a critical role in encrypting and decrypting a message. The person possessing the key can decrypt the ciphertext to plaintext.

Historically, parties have used various encryption algorithms and methods. An algorithm is the process or formula used to solve a problem. Julius Caesar is said to have secured messages by putting two sets of the alphabet, side-by-side, and then shifting one of them by a specific number of places. The number of places in the shift serves as the key. He converted plaintext into ciphertext using this key, and only his generals, who also had the key, knew how to decipher the messages. This method is the Caesar cipher. The figure shows a secret message using the Caesar cipher.

The History of Cryptography

The history of cryptography started in diplomatic circles thousands of years ago. Messengers from a king’s court took encrypted messages to other courts. Occasionally, other courts not involved in the communication, attempted to steal messages sent to a kingdom they considered an adversary. Not long after, military commanders started using encryption to secure messages.

Over the centuries, various cipher methods, physical devices, and aids encrypted and decrypted text:

Scytale


Caesar Cipher



Vigenère Cipher 


Enigma Machine


All cipher methods use a key to encrypt or decrypt a message. The key is an important component in the encryption algorithm. An encryption algorithm is only as good as the key used. The more complexity involved, the more secure the algorithm. Key management is an important piece in the process.

Creating Ciphertext

Each encryption method uses a specific algorithm, called a cipher, to encrypt and decrypt messages. A cipher is a series of well-defined steps used to encrypt and decrypt messages. There are several methods of creating ciphertext:

Transposition – letters are rearranged


Substitution – letters are replaced


One-time pad – plaintext combined with a secret key creates a new character, which then combines with the plaintext to produce ciphertext


Old encryption algorithms, such as the Caesar cipher or the Enigma machine, depended on the secrecy of the algorithm to achieve confidentiality. With modern technology, where reverse engineering is often simple, parties use public-domain algorithms. With most modern algorithms, successful decryption requires knowledge of the appropriate cryptographic keys. This means that the security of encryption lies in the secrecy of the keys, not the algorithm.

Some modern encryption algorithms still use transposition as part of the algorithm.

Key management is the most difficult part of designing a cryptosystem. Many cryptosystems have failed because of mistakes in their key management, and all modern cryptographic algorithms require key management procedures. In practice, most attacks on cryptographic systems involve attacking the key management system, rather than the cryptographic algorithm itself.

Activity – Exploring the Vigenère Cipher


Two Types of Encryption

Cryptographic encryption can provide confidentiality by incorporating various tools and protocols.

There are two approaches to ensuring the security of data when using encryption. The first is to protect the algorithm. If the security of an encryption system depends on the secrecy of the algorithm itself, the most important aspect is to guard the algorithm at all costs. Every time someone finds out the details of the algorithm, every party involved would need to change the algorithm. That approach does not sound very secure or manageable. The second approach is to protect the keys. With modern cryptography, the algorithms are public. The cryptographic keys ensure the secrecy of the data. Cryptographic keys are passwords that are part of the input into an encryption algorithm together along with the data requiring encryption.

There are two classes of encryption algorithms:

Symmetric algorithms - These algorithms use the same pre-shared key, sometimes called a secret key pair, to encrypt and decrypt data. Both the sender and receiver know the pre-shared key before any encrypted communication begins. As shown in Figure 1, symmetric algorithms use the same key to encrypt and decrypt the plaintext. Encryption algorithms that use a common key are simpler and need less computational power.


Asymmetric algorithms - Asymmetrical encryption algorithms use one key to encrypt data and a different key to decrypt data. One key is public and the other is private. In a public-key encryption system, any person can encrypt a message using the public key of the receiver, and the receiver is the only one that can decrypt it using his private key. Parties exchange secure messages without needing a pre-shared key, as shown in Figure 2. Asymmetric algorithms are more complex. These algorithms are resource intensive and slower to execute.


The Symmetrical Encryption Process

Symmetric algorithms use the same pre-shared key to encrypt and decrypt data, a method also known as private-key encryption.

For example, Alice and Bob live in different locations and want to exchange secret messages with one another through the mail system. Alice wants to send a secret message to Bob.

Private-key encryption uses a symmetric algorithm. As illustrated by the keys in the figure, Alice and Bob have identical keys to a single padlock. The key exchange happened prior to sending any secret messages. Alice writes a secret message and puts it in a small box that she locks using the padlock. She mails the box to Bob. The message is safe inside the box as the box makes its way through the post office system. When Bob receives the box, he uses his key to unlock the padlock and retrieve the message. Bob can use the same box and padlock to send a secret reply back to Alice.


If Bob wants to talk to Carol, he needs a new pre-shared key for that communication to keep it secret from Alice. The more people Bob wants to communicate with securely, the more keys he will need to manage.

Types of Cryptography

The most common types of cryptography are block ciphers and stream ciphers. Each method differs in the way that it groups bits of data to encrypt it.

Block Ciphers

Block ciphers transform a fixed-length block of plaintext into a common block of ciphertext of 64 or 128 bits. Block size is the amount of data encrypted at any one time. To decrypt this ciphertext, apply the reverse transformation to the ciphertext block, using the same secret key.

Block ciphers usually result in output data that is larger than the input data, because the ciphertext must be a multiple of the block size. For example, Data Encryption Standard (DES) is a symmetric algorithm that encrypts blocks in 64-bit chunks using a 56-bit key. To accomplish this, the block algorithm takes data one chunk at a time, for example, 8 bytes per chunk, until the entire block is full. If there is less input data than one full block, the algorithm adds artificial data, or blanks, until it uses the full 64 bits, as shown in Figure 1 for the 64 bits on the left.

Stream Ciphers

Unlike block ciphers, stream ciphers encrypt plaintext one byte or one bit at a time, as shown in Figure 2. Think of stream ciphers as a block cipher with a block size of one bit. With a stream cipher, the transformation of these smaller plaintext units varies, depending on when they are encountered during the encryption process. Stream ciphers can be much faster than block ciphers, and generally do not increase the message size, because they can encrypt an arbitrary number of bits.

A5 is a stream cipher that provides voice privacy and encrypts cell phone communications. It is also possible to use DES in stream cipher mode.


Complex cryptographic systems can combine block and stream in the same process.

Symmetric Encryption Algorithms

Numerous encryption systems use symmetric encryption. Some of the common encryption standards that use symmetric encryption include the following:

3DES (Triple DES): Digital Encryption Standard (DES) is a symmetric block cipher with 64-bit block size that uses a 56-bit key. It takes a 64-bit block of plaintext as input and outputs a 64-bit block of ciphertext. It always operates on blocks of equal size and it uses both permutations and substitutions in the algorithm. A permutation is a way of arranging all elements of a set.

Triple DES encrypts data three times and uses a different key for at least one of the three passes, giving it a cumulative key size of 112-168 bits. 3DES is resistant to attack, but it is much slower than DES.

The 3DES encryption cycle is as follows:

  1. Data encrypted by first DES
  2. Data decrypted by second DES
  3. Data re-encrypted by third DES

The reverse process decrypts the ciphertext.

IDEA: The International Data Encryption Algorithm (IDEA) uses 64-bit blocks and 128-bit keys. IDEA performs eight rounds of transformations on each of the 16 blocks that results from dividing each 64-bit block. IDEA was the replacement for DES, and now PGP (Pretty Good Privacy) uses it. PGP is a program that provides privacy and authentication for data communication. GNU Privacy Guard (GPG) is a licensed, free version of PGP.

AES: The Advanced Encryption Standard (AES) has a fixed block size of 128-bits with a key size of 128, 192, or 256 bits. The National Institute of Standards and Technology (NIST) approved the AES algorithm in December 2001. The U.S. government uses AES to protect classified information.

AES is a strong algorithm that uses longer key lengths. AES is faster than DES and 3DES, so it provides both a solution for software applications as well as hardware use in firewalls and routers.

Other block ciphers include Skipjack (developed by the NSA), Blowfish, and Twofish.

Activity - Using Symmetrical Encryption


The Asymmetrical Encryption Process

Asymmetric encryption, also called public-key encryption, uses one key for encryption that is different from the key used for decryption. A criminal cannot calculate the decryption key based on knowledge of the encryption key, and vice versa, in any reasonable amount of time.

If Alice and Bob exchange a secret message using public-key encryption, they use an asymmetric algorithm. This time Bob and Alice do not exchange keys prior to sending secret messages. Instead, Bob and Alice each have a separate padlock with separate corresponding keys. For Alice to send a secret message to Bob, she must first contact him and ask him to send his open padlock to her. Bob sends the padlock but keeps his key. When Alice receives the padlock, she writes her secret message and puts it in a small box. She also puts her open padlock in the box but keeps her key. She then locks the box with Bob’s padlock. When Alice locks the box, she is no longer able to get inside because she does not have a key to that padlock. She mails the box to Bob and, as the box travels through the mail system, no one is able to open it. When Bob receives the box, he can use his key to unlock the box and retrieve the message from Alice. To send a secure reply, Bob puts his secret message in the box, along with his open padlock, and locks the box using Alice’s padlock. Bob mails the secured box back to Alice.

For example, in Figure 1, Alice requests and obtains Bob’s public key. In Figure 2, Alice uses Bob’s public key to encrypt a message using an agreed-upon algorithm. Alice sends the encrypted message to Bob, and Bob then uses his private key to decrypt the message, as shown in Figure 3.




Asymmetric Encryption Algorithms

Asymmetric algorithms use formulas that anyone can look up. The pair of unrelated keys is what makes these algorithms secure. The asymmetric algorithms include:

RSA (Rivest-Shamir-Adleman) - uses the product of two very large prime numbers with an equal length of between 100 and 200 digits. Browsers use RSA to establish a secure connection.

Diffie-Hellman - provides an electronic exchange method to share the secret key. Secure protocols, such as Secure Sockets Layer (SSL), Transport Layer Security (TLS), Secure Shell (SSH), and Internet Protocol Security (IPsec), use Diffie-Hellman.

ElGamal - uses the U.S. government standard for digital signatures. This algorithm is free for use because no one holds the patent.

Elliptic Curve Cryptography (ECC) - uses elliptic curves as part of the algorithm. In the U.S., the National Security Agency uses ECC for digital signature generation and key exchange.

Key Management

Key management includes the generation, exchange, storage, use, and replacement of keys used in an encryption algorithm.

Key management is the most difficult part of designing a cryptosystem. Many cryptosystems have failed because of mistakes in their key management procedures. In practice, most attacks on cryptographic systems target the key management level, rather than the cryptographic algorithm itself.

As shown in the figure, there are several essential characteristics of key management to consider.

Two terms used to describe keys are:
  • Key length - Also called the key size, this is the measure in bits.
  • Keyspace - This is the number of possibilities that a specific key length can generate.
As key length increase, the keyspace increases exponentially. The keyspace of an algorithm is the set of all possible key values. Longer keys are more secure; however, they are also more resource intensive. Almost every algorithm has some weak keys in its keyspace that enable a criminal to break the encryption via a shortcut.

Comparing Encryption Types

It is important to understand the differences between symmetric and asymmetric encryption methods. Symmetric encryption systems are more efficient and can handle more data. However, key management with symmetric encryption systems is more problematic and harder to manage. Asymmetric cryptography is more efficient at protecting the confidentiality of small amounts of data, and its size and speed make it more secure for tasks such as electronic key exchange which is a small amount of data rather than encrypting large blocks of data.

Maintaining confidentiality is important for both data at rest and data in motion. In both cases, symmetric encryption is favored because of its speed and the simplicity of the algorithm. Some asymmetric algorithms can significantly increase the size of the object encrypted. Therefore, in the case of data in motion, use public key cryptography to exchange the secret key, and then symmetric cryptography to ensure the confidentiality of the data sent.

Applications

There are many applications for both symmetric and asymmetric algorithms.

A one-time password-generating token is a hardware device that uses cryptography to generate a one-time password. A one-time password is an automatically generated numeric or alphanumeric string of characters that authenticates a user for one transaction of one session only. The number changes every 30 seconds or so. The session password appears on a display and the user enters the password.

The electronic payment industry uses 3DES. Operating systems use DES to protect user files and system data with passwords. Most encrypting file systems, such as NTFS, use AES.

Four protocols use asymmetric key algorithms:
  1. Internet Key Exchange (IKE), which is a fundamental component of IPsec Virtual Private Networks (VPNs).
  2. Secure Socket Layer (SSL), which is a means of implementing cryptography into a web browser.
  3. Secure Shell (SSH), which is a protocol that provides a secure remote access connection to network devices.
  4. Pretty Good Privacy (PGP), which is a computer program that provides cryptographic privacy and authentication to increase the security of email communications.
A VPN is a private network that uses a public network, usually the Internet, to create a secure communication channel. A VPN connects two endpoints such as two remote offices over the Internet to form the connection.

VPNs use IPsec. IPsec is a suite of protocols developed to achieve secure services over networks. IPsec services allow for authentication, integrity, access control, and confidentiality. With IPsec, remote sites can exchange encrypted and verified information.

Data in use is a growing concern to many organizations. When in use, data no longer has any protection because the user needs to open and change the data. System memory holds data in use and it can contain sensitive data such as the encryption key. If criminals compromise data in use, they will have access to data at rest and data in motion.

Activity - Compare Symmetrical Versus Asymmetrical Encryption



Ref : [1]