Cryptography
Practice Quiz
Questions:
1. What is the difference between symmetric and asymmetric encryption?
2. What is the purpose of a hash function in cryptography?
3. How does the RSA algorithm work for secure communication?
4. What is the difference between a cipher and a code?
5. What is the difference between confidentiality and integrity in cryptography?
6. What is a digital signature, and how is it used in secure communication?
7. What is the difference between a digital certificate and a digital signature?
8. What is a man-in-the-middle attack, and how can it be prevented?
9. What is a zero-knowledge proof, and which cryptographic scheme is used?
10. What is the difference between a stream cipher and a block cipher?
11. What is the purpose of a key exchange algorithm in cryptography?
12. How does the Diffie-Hellman key exchange algorithm work?
13. What is the purpose of the Advanced Encryption Standard (AES) algorithm?
14. What is a Public Key Infrastructure (PKI), and why is it critical?
15. What is the difference between private and public keys?
16. What is the purpose of a digital envelope in cryptography?
17. How does the Elliptic Curve Digital Signature Algorithm (ECDSA) work?
,18. What is the difference between a digital signature and a message authentication code
(MAC)?
19. How can a digital signature be verified?
20. What is the difference between a one-time pad and a stream cipher?
Answer:
1. The main difference between symmetric and asymmetric encryption is using a single secret
key versus a pair of public and private keys in asymmetric encryption. In symmetric encryption,
the same key is used for encryption and decryption. In contrast, in asymmetric encryption, a
public key is used for encryption, and a private key is used for decryption.
Symmetric encryption and asymmetric encryption are two different methods of encrypting
data. The main difference between the two is using a single secret key in symmetric encryption
versus a pair of public and private keys in asymmetric encryption.
In symmetric encryption, the same key is used for encryption and decryption. This means that
the message’s sender and receiver must share the same secret key to encrypt and decrypt the
message. This can be a problem if the key is intercepted or lost, as anyone who has the key will
be able to read the news. Additionally, if the key is compromised, it must be changed for all
users, making it a hassle.
On the other hand, asymmetric encryption uses a pair of keys, a public key, and a private key.
The public key encrypts the message, while the private key decrypts it. The public key can be
freely distributed to anyone, while the private key is kept secret. This means that a message can
be encrypted by anyone with the public key but can only be decrypted by the person with the
corresponding private key. This makes it much more secure than symmetric encryption, as the
private key does not need to be shared and can be kept safe.
In summary, symmetric encryption uses a single key for encryption and decryption. In contrast,
asymmetric encryption uses a pair of keys, a public key for encryption, and a private key for
, decryption. Asymmetric encryption is considered more secure than symmetric encryption
because the private key does not need to be shared and can be kept safe.
2. A hash function in cryptography is a one-way mathematical function that takes an input (or
'message') and returns a fixed-size string of characters, referred to as the 'hash value.’ The
purpose of a hash function is to ensure the integrity of data by providing a unique value for any
given input. This outstanding value can be used to verify that the data has not been tampered
with, as any changes to the original information will result in a different hash value.
A hash function is a mathematical function commonly used in cryptography to ensure data
integrity. It is a one-way function, which means that it takes an input (or "message") and
returns a fixed-size string of characters, also known as a "hash value.” The primary purpose of a
hash function is to provide a unique value for any given input so that any changes to the
original information will result in a different hash value.
One of the critical properties of a hash function is that it is deterministic, which means that it
will always return the same hash value for the same input. This allows for easy detection of any
changes to the input data. If the information is altered, the resulting hash value will be
different.
A hash function is considered a “strong” function if it is deterministic and crash resistant.
Another essential property of a hash function is that it should be computationally infeasible to
find two inputs that produce the same hash value, also known as a collision. This is known as
the "collision resistance" property.
Hash functions are widely used in cryptography to ensure the integrity of data. For example,
when a file is downloaded, the recipient can use the hash value provided by the sender to verify
that the file has not been tampered with during transmission. In addition, digital signature
algorithms often use hash functions to sign digital documents so that the recipient can verify
that the record has not been tampered with after it was signed.
In summary, a hash function is a one-way mathematical function that takes an input or message
and returns a fixed-size string of characters, referred to as the hash value. The purpose of a