Cryptographics Flashcards
True / False
One of the ways of confirming that a software application comes from a trusted source is the verification of its digital signature. A digitally signed software proves the identity of the developer and guarantees that the application code has not been tampered with since it was signed. The authenticity and integrity of the application’s code can be verified by comparing results of a cryptographic hash function (original hash published by the application developer vs. hash obtained from a downloaded app).
True.
The statement accurately describes the role of digital signatures in confirming the authenticity and integrity of software applications. A digitally signed software application provides assurance that it comes from a trusted source and that its code has not been tampered with since it was signed. This is achieved by using cryptographic techniques to generate a unique digital signature for the software, which is then verified using a public key infrastructure (PKI).
Additionally, comparing the cryptographic hash of the downloaded application with the original hash published by the developer helps ensure that the application has not been altered during transmission or after download, further confirming its authenticity and integrity.
Digital signatures provide: (Select 3 answers)
Integrity
Authentication
Confidentiality
Authorization
Non-repudiation
Accounting
Digital signatures provide:
Integrity: Digital signatures ensure that the data or content has not been altered or tampered with since it was signed. Any modifications to the signed data would invalidate the signature.
Authentication: Digital signatures verify the identity of the signer, confirming that the signature was generated by the entity with the corresponding private key. This helps establish trust in the authenticity of the signer.
Non-repudiation: Digital signatures provide non-repudiation, meaning that the signer cannot deny their involvement or the authenticity of the signed document or message. Once signed, the signature serves as evidence of the signer’s intent and cannot be repudiated.
True / False
In cryptography, the number of bits in a key used by a cryptographic algorithm is referred to as a key size or key length. The key length determines the maximum number of combinations required to break the encryption algorithm, therefore typically a longer key means stronger cryptographic security.
True.
In cryptography, the number of bits in a key used by a cryptographic algorithm is indeed referred to as the key size or key length.
A longer key typically means stronger cryptographic security because it increases the number of possible combinations required to break the encryption algorithm through brute force or other cryptographic attacks. This increased complexity makes it exponentially more difficult and time-consuming for attackers to decipher encrypted data without the corresponding key.
Key stretching
Key stretching is a technique used in cryptography to enhance the security of cryptographic keys, especially passwords, by making them more resistant to brute force and dictionary attacks.
The concept behind key stretching involves applying a cryptographic function, such as a hash function or a key derivation function (KDF), multiple times to the original key or password. Each iteration of the function generates a new, derived key, which is then fed back into the function for further processing. This process is repeated a predetermined number of times, effectively “stretching” the original key into a longer and more complex key.
The goal of key stretching is to significantly increase the computational cost of deriving the original key from its hashed or derived form, thereby making it more difficult for attackers to guess or crack the password through exhaustive search methods. By increasing the time and resources required to generate each derived key, key stretching helps mitigate the risk of successful brute force attacks and strengthens the overall security of cryptographic systems.
Bcrypt
Bcrypt is a key stretching algorithm commonly used for securely hashing passwords in cryptographic applications. It employs a computationally intensive process that repeatedly applies the Blowfish encryption algorithm to a password, making it resistant to brute-force attacks. Bcrypt allows for adjustable cost parameters, known as the “work factor,” which determine the number of iterations performed during hashing. This work factor can be increased over time to adapt to advancements in hardware capabilities and maintain the effectiveness of the algorithm against evolving security threats.
DSA
DSA, or Digital Signature Algorithm, is a widely used cryptographic algorithm for generating and verifying digital signatures.
It was developed by the National Institute of Standards and Technology (NIST) as part of the Digital Signature Standard (DSS). DSA relies on modular arithmetic and discrete logarithms for its security.
The algorithm involves generating a pair of asymmetric keys: a private key for signing and a corresponding public key for signature verification.
DSA signatures provide authenticity, integrity, and non-repudiation, meaning that they confirm the identity of the signer, ensure that the signed data has not been altered, and prevent the signer from denying their involvement.
ROT13
ROT13, short for “rotate by 13 places,” is a simple letter substitution cipher that replaces each letter in a message with the letter 13 positions ahead or behind it in the alphabet. It is a symmetric encryption algorithm, meaning that the same algorithm is used for both encryption and decryption.
For example, applying ROT13 to the English alphabet:
A becomes N
B becomes O
C becomes P
ROT13 is often used for simple obfuscation or to hide text in plain sight, as it is a very weak encryption method that offers no real security. It is also sometimes used humorously for spoilers or to hide answers to puzzles.
Twofish
Twofish is a symmetric key block cipher algorithm designed for encryption and decryption of data. Although Twofish was not selected as the AES standard, it remains a respected and widely studied encryption algorithm.
Twofish operates on blocks of data, typically 128 bits in size, and uses a key of variable length, up to a maximum of 256 bits. It employs a Feistel network structure with a complex key schedule and multiple rounds of substitution and permutation operations. Twofish is known for its strong security and resistance to various cryptographic attacks.
One of the notable features of Twofish is its flexibility in key size and block size, allowing it to adapt to different security requirements and performance constraints. It is used in various applications, including file encryption, disk encryption, and network communication protocols, where data confidentiality is crucial. Despite its strengths, Twofish is not as widely deployed as some other encryption algorithms like AES, but it remains an important part of the cryptographic landscape.
PBKDF2
PBKDF2, or Password-Based Key Derivation Function 2, is a cryptographic algorithm used to derive cryptographic keys from passwords or passphrases. It employs a pseudorandom function, typically a cryptographic hash function like SHA-1 or SHA-256, along with a salt value to generate the key. PBKDF2 applies the hash function iteratively a configurable number of times, known as the “work factor,” which increases the computational cost of deriving the key. This makes it more resistant to brute-force and dictionary attacks, as attackers must expend significant computational resources to guess or crack the original password.
One of the main advantages of PBKDF2 is its flexibility and widespread support across various platforms and programming languages. It is commonly used in security-sensitive applications, such as password hashing, disk encryption, and secure communication protocols, to protect sensitive data and credentials from unauthorized access. However, PBKDF2 does have limitations, such as vulnerability to parallelization on hardware with specialized cryptographic accelerators. Additionally, the choice of hash function and the number of iterations used in PBKDF2 implementations can impact its security, and best practices continue to evolve to address emerging threats and vulnerabilities.
Which of the following answers refers to a type of additional input that increases password complexity and provides better protection against brute-force, dictionary, and rainbow table attacks?
Seed
IV
Salt
Shim
Salt is a random value that is added to passwords before hashing to prevent attackers from using precomputed tables (rainbow tables) to crack passwords. Salting increases password complexity and enhances security by ensuring that identical passwords hash to different values.
Seed: A starting point for generating pseudorandom numbers in cryptographic algorithms. It is not directly related to password complexity or protection against brute-force attacks.
IV (Initialization Vector): A random value used in cryptographic algorithms, particularly block ciphers in modes like CBC (Cipher Block Chaining), to ensure that identical plaintext blocks encrypt to different ciphertext blocks. While IVs are important for encryption, they are not specifically used to increase password complexity.
Shim: In the context of software development, a shim is a small piece of code that facilitates compatibility between different software components. It is not related to password complexity or protection against brute-force attacks.
Elliptic Curve Cryptography (ECC)
lliptic Curve Cryptography (ECC) is a public-key cryptographic algorithm based on the mathematical properties of elliptic curves over finite fields. It provides a way to securely encrypt and authenticate data, as well as generate digital signatures, using smaller key sizes compared to other public-key algorithms like RSA.
ECC relies on the difficulty of solving the Elliptic Curve Discrete Logarithm Problem (ECDLP), which involves finding the discrete logarithm of a point on an elliptic curve. This mathematical problem is believed to be computationally hard, making ECC resistant to attacks by brute force or mathematical algorithms.
One of the key advantages of ECC is its efficiency in terms of key size and computational resources. ECC keys are typically much shorter than RSA keys for equivalent security levels, making ECC suitable for environments with constrained resources such as mobile devices or Internet of Things (IoT) devices. Additionally, ECC provides strong security properties, including forward secrecy and resistance to quantum attacks, making it a popular choice for securing modern cryptographic protocols and systems.
ECC is primarily associated with asymmetric encryption, which involves using pairs of public and private keys generated from elliptic curve parameters.
Asymmetric vs symmetric encryption
Symmetric encryption: In symmetric encryption, the same key is used for both encryption and decryption of data. This means that the sender and receiver must share a secret key in advance. Symmetric encryption algorithms are typically fast and efficient, making them well-suited for encrypting large volumes of data. However, the challenge lies in securely sharing the secret key between the communicating parties, especially over insecure channels.
Asymmetric encryption: In asymmetric encryption, also known as public-key encryption, two separate keys are used: a public key for encryption and a private key for decryption. The public key can be freely distributed, while the private key is kept secret. Asymmetric encryption provides a solution to the key distribution problem in symmetric encryption, as the public key can be shared openly. However, asymmetric encryption algorithms are generally slower and less efficient than symmetric algorithms, making them better suited for encrypting small amounts of data or for key exchange purposes.
In summary, symmetric encryption is typically faster and more efficient for bulk data encryption, while asymmetric encryption provides a solution for secure key distribution and offers other cryptographic functionalities like digital signatures and key exchange. Often, a combination of both symmetric and asymmetric encryption techniques is used in cryptographic systems to leverage their respective advantages.
ECB
ECB stands for Electronic Codebook Mode, which is a basic mode of operation for block ciphers in cryptography. In ECB mode, each block of plaintext is encrypted independently using the same encryption key, resulting in a one-to-one mapping between plaintext blocks and ciphertext blocks.
While ECB mode is simple and easy to implement, it has several significant drawbacks. One of the main issues with ECB mode is that identical plaintext blocks will always encrypt to the same ciphertext blocks, regardless of their position in the message. This makes ECB mode vulnerable to certain cryptographic attacks, such as pattern recognition and replay attacks, and it does not provide confidentiality for patterns in the plaintext data.
Due to these vulnerabilities, ECB mode is generally not recommended for secure communication or encryption purposes, especially when encrypting large amounts of data. Instead, more secure modes of operation like CBC (Cipher Block Chaining) or GCM (Galois/Counter Mode) are typically preferred for block cipher encryption.
PFS
PFS stands for Perfect Forward Secrecy, a property of cryptographic systems that ensures that the compromise of long-term secret keys does not compromise the confidentiality of past communications.
In systems with PFS, even if an attacker were to gain access to the long-term secret keys used to establish communication, they would not be able to decrypt past encrypted communications.
PFS is achieved by using ephemeral keys, which are short-lived and randomly generated for each session or communication. These ephemeral keys are used to negotiate session keys for encryption and decryption, and they are not derived from or dependent on the long-term secret keys. As a result, even if the long-term secret keys are compromised, past communications remain confidential because they were encrypted using different session keys.
PFS is considered a critical security feature in modern cryptographic protocols, particularly in secure communication protocols like TLS (Transport Layer Security) used for securing web traffic. It provides an additional layer of protection against sophisticated attacks and ensures that the confidentiality of past communications is preserved, even in the event of key compromise.
EFS
EFS typically refers to Encrypting File System, a feature built into the Microsoft Windows operating system that provides filesystem-level encryption for protecting sensitive data stored on disk. With EFS, individual files or directories can be encrypted using symmetric encryption algorithms, and access to the encrypted data is controlled using public-key cryptography.
When a file or directory is encrypted using EFS, a unique file encryption key (FEK) is generated, and this FEK is then encrypted using the public key of the user who encrypted the file. The encrypted FEK is stored alongside the encrypted file on disk. To decrypt the file, the user’s private key is used to decrypt the FEK, which can then be used to decrypt the file itself.
EFS provides a convenient way to encrypt sensitive files and folders on Windows systems without the need for additional software. It allows for seamless integration with existing file permissions and access controls, ensuring that only authorized users can decrypt and access encrypted data. However, it’s important to note that EFS does not provide protection against attacks that bypass the Windows authentication mechanisms or gain access to the user’s private key. Therefore, it should be used in conjunction with other security measures to provide comprehensive data protection.
PFX
PFX stands for Personal Information Exchange. It is a file format used to store cryptographic objects such as private keys, public keys, and certificates, typically protected by a password. PFX files are commonly used for securely transferring and storing private keys and certificates, especially in scenarios where they need to be moved between systems or shared with other parties.
PFX files are commonly used in environments where secure key management and certificate handling are essential, such as web servers, email servers, and secure network communication protocols like SSL/TLS. They provide a convenient way to bundle cryptographic assets into a single file for easy distribution and deployment while ensuring their confidentiality and integrity through encryption and password protection.