Cryptography Flashcards

(38 cards)

1
Q

Stream Cipher

A

A stream cipher is a symmetric encryption method that encrypts data one bit at a time.

A stream cipher solves the problem of having excessively large keys associated with OTP by using a smaller, fixed-length seed key, such as one that is 2048 bits in length. The following describes the process of creating a seed key:

The seed key is run through a pseudorandom number generator, which outputs a new and unique encryption key the same size as the data being encrypted. This new key is called a keystream.
The keystream is XORed with the data to create the ciphertext.
The seed key can be used repeatedly throughout the encryption process.
While stream ciphers are less secure than the one-time pad, this method can be used in real-time. One of the most widely used stream ciphers was Rivest’s Cipher 4 (RC4). However, multiple vulnerabilities have been discovered in RC4, rendering it insecure. It is no longer used today.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Electronic Code Book (ECB)

A

ECB is the simplest mode of operation.
Each block of plaintext data is encrypted separately.
Blocks of data can be encrypted simultaneously, allowing for faster encryption.
The biggest disadvantage is that blocks with identical data will generate the same ciphertext.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Cipher Block Chaining (CBC)

A

CBC is similar to ECB, except this mode uses an initialization vector (IV).
The IV is a starting variable that is XORed with the plaintext of the current block to encrypt the data.
The IV for the starting block is a randomly generated value. Each subsequent IV is the ciphertext from the previous block.
CBC is more secure than ECB due to the IV, but it is slower because blocks cannot be encrypted simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Cipher Feedback mode (CFB)

A

CFB also uses an IV, but instead of using it on the plaintext, the IV is encrypted first. That output is then XORed with the plaintext to create the block of ciphertext.
This is the equivalent of using a one-time pad to encrypt the data.
The IV for the starting block is a randomly generated value. Each subsequent IV is the ciphertext from the previous block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Output Feedback mode (OFB)

A

This mode is identical to CFB except for the IV used after the first round.
The output of the IV encryption is used as the next block’s ciphertext.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Counter mode (CTR)

A

Instead of using an initialization vector, CTR uses a nonce combined with a counter that is encrypted.
A nonce is a random string used for all blocks during the encryption process.
The encrypted output of the nonce and counter is then XORed with the plaintext to create the ciphertext.
The counter increments for each block. This ensures that each block uses a different value so that even if blocks have the same data, the ciphertext will be different.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Galois Counter mode (GCM)

A

All other modes of operation are unauthenticated forms of encryption. The Galois Counter mode provides both encryption and authentication.
GCM works like Counter mode, except the ciphertext is combined with a special hash.
The output of the ciphertext and hash contains the encrypted data and a Message Authentication Code (MAC) that gives assurance that the message has not been tampered with.
Because GCM is extremely efficient and provides authentication, it is often used with network communications such as 802.11 and when sending encrypted data to a web server using TLS or SSH.
There are other encryption methods that also provide authentication, but GCM is the most widely used method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Homomorphic Encryption

A

An inherent risk with all encryption is that for the data to be worked on (computation on ciphertexts), it must first be decrypted. Homomorphic encryption addresses this concern by allowing data to be worked on without decrypting it first.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Partially homomorphic encryption (PHE)

A

PHE allows only select simple math functions (such as addition) to be performed. This means that only one math function can be performed an unlimited number of times on the encrypted values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Somewhat homomorphic encryption (SHE)

A

SHE allows more complex math (such as multiplication) to occur. However, it can only be performed a limited number of times.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Fully homomorphic encryption (FHE)

A

This method can handle both simple and advanced math functions (such as addition and multiplication) being performed an unlimited number of times on the encrypted values.
FHE is still in the developmental stage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Blockchain

A

Blockchain is a concept in which an expanding list of transactional records is secured using cryptography. Each record is referred to as a block and is run through a hash function. The hash value of the previous block in the chain is added to the hash calculation of the next block in the chain. This ensures that each successive block is cryptographically linked. Each block validates the hash of the previous block all the way through to the beginning of the chain, ensuring that each historical transaction has not been tampered with. In addition, each block typically includes a time stamp of one or more transactions as well as the data involved in the transactions themselves.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Open Public Ledger

A

The blockchain is recorded in an open public ledger . This ledger does not exist as an individual file on a single computer; rather, one of the most important characteristics of a blockchain is that it is decentralized. The ledger is distributed across a peer-to-peer (P2P) network in order to mitigate the risks associated with having a single point of failure or compromise. Blockchain users can, therefore, trust each other equally. Likewise, another defining quality of a blockchain is its openness—everyone has the same ability to view every transaction on a blockchain.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Dictionary Attack

A

A dictionary attack is a type of brute-force attack. The hacker uses a list of words and phrases to try to guess the decryption key.
Dictionary attacks work well if weak passwords are used.
Using longer and uncommon passphrases is the best way to secure data against these attacks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Collision attack

A

A collision attack tries to find two inputs that produce the same hash value. This type of attack is often used on digital signatures.
If a hacker wanted to get User2 to sign a document by making it seem like it came from User1, they would generate two documents that generate the same hash.
The hacker would send one document to User1 and get that signature.
The signature would be attached to the second document and sent to User2. Because the hashes are identical, User2 thinks the document is legitimate and has been signed by User1.
Generating longer hash outputs is the key to stopping these types of attacks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Birthday attack

A

This attack combines a collision attack and a brute-force attack. The name is taken from the birthday probability math problem.

The birthday probability math problem states that if you have 30 people in a room, the probability that someone has the same birthday as you is approximately 8%. However, the probability that any two people in the room have the same birthday is 70%. This is because we are not looking for an exact match (just any match), so the probability is higher. Digital signatures can be susceptible to birthday attacks.

Generating longer hash outputs is the key to stopping these attacks.

17
Q

Downgrade attack

A

A downgrade attack forces the system to use an older, less secure communication protocol.
SSL exploitation is a common implementation of this attack. A hacker can set up their computer to only use SSL so that when the request is sent to the server, the server downgrades from TLS to SSL to communicate. This then allows the hacker to launch SSL-based attacks on the server.
Downgrade attacks are often used as part of a man-in-the-middle (MITM) attack. The hacker can intercept an HTTPS packet and downgrade it to an HTTP packet. If the server is not configured properly, the server responds using HTTP. This allows the hacker to now see all communications.

To prevent downgrade attacks, servers must be set up not to support these older and less secure protocols. Proper server configuration is the key to stopping these types of attacks.

18
Q

Hybrid Cryptography

A

A hybrid cryptography system combines the strengths of hashing, symmetric encryption, and asymmetric encryption, depending on the needs of the project or service.

19
Q

Microsoft’s Encrypting File System, or EFS

A

Microsoft’s EFS uses the following steps to encrypt data:

A file is encrypted using a File Encryption Key (FEK).
The FEK is encrypted with the user’s public asymmetric key.
The file is sent to the intended recipient.
The user’s private key is used to decrypt the FEK.
The FEK is used to decrypt the file.
One of the biggest weaknesses of the EFS is that the user’s private key is essentially their user password. If the password is weak, the encryption will also be weak.

20
Q

Obfuscation

A

A technique that essentially hides or camouflages code or other information so that it is harder to read by unauthorized users.

21
Q

Data masking

A

A de-identification method where generic or placeholder labels are substituted for real data while preserving the structure or format of the original data.

Data masking can mean that all or part of the contents of a database field are redacted by substituting all character strings with “x,” for example.

22
Q

Tokenization

A

A de-identification method where a unique token is substituted for real data.

Tokenization means that all or part of the value of a database field is replaced with a randomly generated token.

23
Q

Encryption with Steganography

A

There has been an increased amount of research done on how to best combine encryption with steganography. The process essentially follows the steps below:

Encrypt plaintext with a private key to generate ciphertext.
The ciphertext is hidden inside a media file, such as an image, using steganography.
The recipient extracts the ciphertext and decrypts it using the matching public key.
Because the ciphertext is hidden in the image file, someone intercepting the message would have to know it is there before being able to decrypt it.

24
Q

Key Management

A

Key management refers to operational considerations for the various stages in a key’s lifecycle. A key’s lifecycle may involve the following stages:

Key Generation — creates an asymmetric key pair or symmetric secret key of the required strength using the chosen cipher.
Storage — prevents unauthorized access to a private or secret key and protects against loss or damage.
Revocation — prevents use of the key if it is compromised. If a key is revoked, any data that was encrypted using it should be re-encrypted using a new key.
Expiration and Renewal — gives the certificate a “shelf-life,” increasing security. Every certificate expires after a certain period. Certificates can be renewed with the same key pair or with a new key pair.

25
decentralized key management model
A decentralized key management model means that keys are generated and managed directly on the computer or user account that will use the certificate. This does not require any special setup, so it is easy to deploy. However, it makes the detection of key compromises more difficult.
26
key management system
In public key infrastructure (PKI), procedures and tools that centralizes generation and storage of cryptographic keys. Some organizations prefer to centralize key generation and storage using a tool such as a key management system . In one type of cryptographic key management system, a dedicated server or appliance is used to generate and store keys. When a device or app needs to perform a cryptographic operation, it uses the Key Management Interoperability Protocol (KMIP) to communicate with the server.
27
Cryptoprocessors
A cryptoprocessor performs operations such as decryption and signing on behalf of apps. This means that the key material never leaves the cryptoprocessor. Because it is dedicated to a single function, the cryptoprocessor hardware has a smaller attack surface than a general-purpose computer.
28
Trusted Platform Module
A TPM is a cryptoprocessor implemented as a module within the CPU on a computer or mobile device. TPMs are produced to different version specifications, with versions 1.2 and 2.0 in current use. Version 2.0 is not backward compatible with version 1.2. Beginning with Windows 10 version 1607, Microsoft required that TPM 2.0 be enabled by default on all new computers. A TPM is required to check the integrity of startup files and components in BitLocker implementations. The TPM generates a hash of the startup files to verify the integrity of those files. Additionally, the TPM creates a hash of system components. This hash acts as a validation check of the system to ensure that system components have not changed. The hash can also be used to uniquely identify the system. Windows Credential Guard requires the computer to have a TPM chip installed. A TPM provides protection for virtual-based security encryption keys that are stored in the firmware. This helps protect against attacks involving a physically present user with BIOS access. A TPM can generate truly random numbers, thus preventing entropy. TPM provides full support for asymmetric encryption; therefore, it can generate public and private keys. A TPM also provides encrypted storage for user passwords, encryption keys, and digital certificates. Windows 10 can pull stored keys directly from the TPM without loading them into the RAM, where they would be more vulnerable to an attack.
29
Hardware security module (HSM)
An HSM is cryptoprocessor hardware implemented in a removable or dedicated form factor, including rack-mounted appliances, plug-in PCIe adapter cards, and USB-connected security keys. It is also possible to provision an HSM as a virtual appliance. HSMs provide cryptographic functions such as: Generate and store encryption keys. Generate and validate digital signatures. Generate keys used in smart cards. HSMs traditionally come in the form of a plug-in card or an external security device that can be attached directly to the computer system. These devices offer some benefits over TPM chips. HSMs are more powerful and can perform more powerful cryptographic functions quicker. HSMs can perform multiple cryptographic functions simultaneously. HSMs can be attached to a network and handle cryptographic functions for multiple users across the network. Hardware Security Modules are also known as: Personal Computer Security Module (PCSM) Secure Application Module (SAM) Hardware cryptographic devices Cryptographic modules
30
Secure Enclave
CPU extensions that protect data stored in system memory so that an untrusted process cannot read it.
31
Hashing Algorithm
A function that converts an arbitrary-length string input to a fixed-length string output. A cryptographic hash function does this in a way that reduces the chance of collisions, where two different inputs produce the same output. A cryptographic hashing algorithm produces a fixed-length string of bits from an input plaintext that can be of any length. The output can be referred to as a hash or message digest. The function is designed so that it is impossible to recover the plaintext data from the digest (one-way) and that different inputs are unlikely to produce the same output (a collision). A hashing algorithm is used to prove integrity.
32
cryptographic primitive
A single hash function, symmetric cipher, or asymmetric cipher. A complete cryptographic system or product is likely to use multiple cryptographic primitives within a cipher suite.
33
digital signature
A message digest encrypted using the sender's private key that is appended to a message to authenticate the sender and prove message integrity. The sender (Alice) creates a digest of a message using a pre-agreed hash algorithm, such as SHA256, and then performs a signing operation on the digest using her chosen asymmetric cipher and private key. Alice attaches the digital signature to the message and sends both the signature and the message to Bob. Bob verifies the signature using Alice's public key, obtaining the original hash. Bob then calculates his own digest for the document (using the same algorithm as Alice) and compares it with Alice's hash.
34
PKCS#1
The Public Key Cryptography Standard #1 (PKCS#1) defines the use of RSA's algorithm
35
Digital Signature Algorithm (DSA) Elliptic Curve DSA (ECDSA)
The Digital Signature Algorithm (DSA) uses a cipher called ElGamal, but the Elliptic Curve DSA (ECDSA) is now more widely used. DSA and ECDSA were developed as part of the US government's Federal Information Processing Standards (FIPS).
36
Salted Hash
A security countermeasure that mitigates the impact of precomputed hash table attacks by adding a random value to (salting) each plaintext input. A salted hash is computed as follows: (salt + password) * SHA = hash The salt is not kept secret because any system verifying the hash must know the value of the salt. It simply means that an attacker cannot use precomputed tables of hashes. The hash values must be recompiled with the specific salt value for each password.
37
Key Stretching
A technique that strengthens potentially weak input for cryptographic key generation, such as passwords or passphrases created by people, against brute force attacks. Key stretching takes a key generated from a user password plus a random salt value and repeatedly converts it to a longer and more disordered key. This might not be difficult for the attacker to replicate, so it does not actually make the key stronger. It does slow the attack down because the attacker has to do extra processing for each possible key value.
38