3. Encryption Flashcards
Use of encryption
Beyond protecting confidentiality, encryption can be used to certify documents with digital signatures, making it possible for an unaffiliated third party to determine the identity of the person or organization that signed the document and to verify that the document has not been modified since signing.
Encryption is also used for both identification and authentication in the digital world. For identification, encryption can establish identities that are linked to legal identities, such as the name of a person or corporation, or that are unrevealing pseudonyms. And unlike a name, Social Security number or other identifier, cryptographic identities can be mathematically authenticated by a relying party, greatly reducing the chance that the identity is being fraudulent asserted—for example, by a criminal engaged in identity theft. As a result, encryption has long been used by organizations to identify their websites and internet servers, and it is increasingly used by individuals to prove their identity to remote computers over the internet.
Homomorphic encryption
Homomorphic encryption has been developed that allows encrypted information to be manipulated without decrypting it first (data in use).
A related technology called secure multiparty computation allows two or more computers to participate in a computation and compute a mathematical result without otherwise revealing private information. For example, with multiparty computation, five people can get together and compute their average salary without revealing their individual salaries to anyone—not to each other, and not to a trusted third party.
Cryptographic system
A cryptographic system is the collection of cryptographic algorithms, protocols, software and other items that use cryptography to achieve information security goals.
Randomness/entropy
Merely encrypting with an algorithm and a key is not sufficient to ensure security. It is also necessary to use randomness, also called entropy, so that an attacker observing the output of an encryption system cannot determine if the same message is encrypted a second time. The need to obtain a sequence of numbers that is truly random is one of the defining characteristics of modern cryptography.
Public Key Algorithms
Public key algorithms, also called asymmetric algorithms, are designed so that the plaintext can be encrypted using only public information, but decrypting the ciphertext requires the use of private information. A variety of asymmetric algorithms have been proposed. Most are based on some kind of deep mathematical or algorithmic property. One of the most common algorithms is RSA, named after its inventors Rivest, Shamir and Adleman. However, many other public key systems have been created: Digital Signature Algorithm & Elliptic Curve Cryptography, TLS
Symmetric Algorithms
Secret key algorithms, also called symmetric algorithms, use the same key to encrypt and decrypt the plaintext. The most common symmetric algorithm in use today, the AES, is typically used with keys that are either 128 bits or 256 bits in size. Ciphers are based on two mathematical operations: substitution, which substitutes one pattern for another according to a code book; and transposition, which scrambles the bits within a set of bytes. DES and triple-DES are also a type of symmetric encryption.
Brute Force Attack
One way to forcibly decrypt an encrypted message without knowing the key is to try every possible key, because the correct key, when tried, will decrypt the message. Such attack is called a brute force attack or a key search attack, and it is infeasible with 128-bit AES.
The most basic form of cryptanalysis is the brute force attack, in which an attacker tries to decrypt a single message by systematically trying all possible keys. It is important to understand this kind of key search attack because there is fundamentally no way to protect against it—an attacker that gets an encrypted message can always try to decrypt it by trying all possible keys. In practice, more sophisticated approaches are used.
Cryptography
Cryptographic approaches typically provide stronger confidentiality assurances when compared to password-only approaches—but cryptography is more susceptible to catastrophic data loss. In practice cryptographic approaches offer less flexibility, because access control policies need to be implemented in the rather restrictive language of cryptography. For example, a password system can rather trivially be programmed with time-based access controls, so that even authorized individuals don’t have access to data when they are on vacation. It is currently not be possible to implement such a restriction solely with cryptography in a manner that cannot be readily subverted.
TLS
SSL (Secure Socket Layer) protocol was revised several times, renamed transport layer security (TLS) and adopted as an internet standard in 1999. Today TLS (sometimes called SSL/TLS) is one of the most widely used forms of encryption in the world. TLS protects virtually all of the information sent over the internet, from Google searches and Facebook status updates to stock purchases worth hundreds of millions of dollars and streaming video.
TLS is what’s known as a pluggable cryptographic protocol, meaning that the single protocol supports the use of multiple hash functions and ciphers. When a TLS client connects to a TLS server, the two negotiate the most secure version of each algorithm from the set of algorithms that each implement. This means that TLS can be configured so that it offers strong authentication and integrity, but poor confidentiality—a configuration that has been required by some governments in the past. Thus, simply using TLS is no guarantee of security—it depends on the specific algorithms that are in use.
There are many things that TLS encryption does not protect, such as information about the amount of the data exchanged, the location of the endpoints, or the very fact that data is being exchanged at all. Analyzing this kind of information is called traffic analysis, and it can be very easy to do. We explain this by saying that TLS provides neither anonymity nor stealth.
A primary vulnerability of TLS is that a TLS proxy can intercept a TLS connection, decrypt it and then open a new connection to the destination.
Anonymity
To achieve anonymity, it is necessary to hide one’s traffic within a crowd, something that is done by systems such as proxies and mix networks, also called onion routing networks. These systems work by combining traffic from multiple computers into a single channel that is sent between multiple computers and then separating out the traffic again. Simple mix networks might involve a single node where traffic is combined: that’s how most commercial mix networks work. The onion router (Tor) uses a more sophisticated system that relies on multiple layers of encryption and sends every users’ traffic to at least three different computers in sequence, so that not even the nodes of the mix network know with whom the users are communicating.
Data at rest encryption
Application level and device level encryption
Approaches to work with encrypted data
1) Secure enclaves like Intel SGX (microprocessor modifications - not too safe)
2) Homomorphic encryption
3) Multiparty computation
AES
Advanced Encryption Standard, AES is currently regarded as containing no significant algorithmic weaknesses. The only way to forcibly decrypt a message encrypted with AES is to try all possible keys, one by one, until the correct decryption key is found. Although some theoretical attacks on AES have been published, none of them can be performed in practice—at least, not yet.
AES is actually a family of algorithms. The basic version of AES uses a 128-bit key and is called (not surprisingly) AES-128. The algorithm can also be run with a 192-bit or 256-bit key, and is correspondingly named AES-192 and AES-256. The AES algorithm itself consists of an inner mathematical operation that is repeated. AES-128 repeats this function ten times and is therefore said to have ten “rounds.” AES-192 has 12 rounds and AES-256 has 14 rounds. Additional rounds make messages encrypted with AES harder to decrypt without knowing the key.
“AES-256 has a real cost: Those additional rounds mean that it takes more computer time (and thus more electricity) to encrypt a message with AES-256 than with AES-128. For many applications, such as encrypting commercial videos downloaded from streaming video services, the extra security may not be cost effective. Privacy professionals should not assume that because AES-128 is good, AES-256 must be better. For many applications, there is no need to encrypt data so well that it can’t be decrypted ten years hence.
There are other symmetric encryption algorithms, and many may be just as strong as AES.
Lightweight Encryption
There is increasing interest in so-called lightweight encryption algorithms that are designed to encrypt small amounts of data—just a few bytes—or that must run in low-power environments. Two such algorithms are SIMON and SPECK, both developed by NSA.
DES
Data Encryption Standard: Some organizations continue to use triple DES, for example, on the grounds that DES is more thoroughly understood than AES. The government of China has developed its own suite of cryptographic algorithms so that its networks will not be dependent upon algorithms developed elsewhere. One of these algorithms is SM4, which has been standardized in China for protecting wireless networks.
Cryptographic modes of operations
Cryptographic modes of operations are techniques for combining repeated invocations of block algorithms so that they can be used on more data (AES, DES & 3DES can be applied to small blocks of data).
Types: Electronic Codebook, Cipher block Chaining, Counter Mode.
One of the problems with the three modes discussed above is that there is no way to validate the authenticity of encrypted data: Any ciphertext can be decrypted with any key. There is no way, in principle, to look at decrypted information and determine if that information is correct or not.
Cryptanalysis
Cryptanalysis is the process of trying to decipher an encrypted message without knowing the key in advance.
Electronic codebook
Electronic codebook (ECB) is the simplest symmetric cryptographic mode of operation to implement, but it’s also the least secure. This mode uses the same key to encrypt each block of data. The problem with this mode is that blocks that have the same content will encrypt to yield the same output. In practice, this makes it possible for an attacker to learn a great deal of information about the plaintext merely by observing the repeated portions of ciphertext. For most applications, this mode should not be used.
Cipher block chaining
Cipher block chaining (CBC) is the symmetric cryptography mode of operation that overcomes the problem of ECB by encrypting each block as a function of the block’s plaintext and the previously block’s ciphertext. As a result of this chaining, the same block of plaintext will be encrypted differently each time. Because the first block of the message doesn’t have a previous block, it is encrypted by combining the plaintext and a randomly generated block of data called the initialization vector (IV). The IV does not need to be kept secret, but it does need to be different for every message that is encrypted. Because the IV is needed to decrypt the message, it is usually attached to the ciphertext. Disclosing the IV does not jeopardize the security of the ciphertext. This is used in AES.
Counter mode cryptographic mode
Counter mode symmetric cryptographic mode (CTR) is similar to CBC, except that the IV is replaced with a counter. This mode shares the advantage with CBC mode that long blocks of data that repeat are encrypted differently. CTR further has the advantage that it is possible to start decrypting at any point in the encrypted data, making this mode a popular choice for disk encryption algorithms. This is in contrast to the CBC mode, which must begin decrypting from the first block in the sequence. CTR further has the advantages that errors in the cipher text do not propagate, and CTR encryption and decryption can be parallelized. Despite these advantages, CTR is not widely used.