IAO201 C
IAO201 C
1:
We have Alice and Bob have been shown on the figure:
Alice has the Public key (PA), the Secret key of Alice (SA), and the Public key of Bob (PB).
Bob has the Public key (PB), the Secret key of Bob (SB), and the Public key of Alice (PA).
(P… means both you and others have this key, and S… means only you have the key)
To achieve secure communication between Alice and Bob and ensure that no external entity on the
Internet can read or observe their messages, Alice would use Bob's public key (PB) and here is why:
Alice wants to send a message to Bob securely, so she will use Bob's public key (PB) to encrypt the
message. Only Bob's secret key (SB) can decrypt messages encrypted with his public key (PB).
Alice takes her message and encrypts it by using Bob's public key (PB) to create the ciphertext.
Bob, being the recipient, receives the ciphertext. He then uses his secret key (SB) to decrypt the message
encrypted by Alice.
Since only Bob possesses the secret key (SB) corresponding to his public key (PB), only he can decrypt
the message.
Here is a step-by-step example process:
- Alice encrypts the message {m} using Bob's public key (PB) to create ciphertext (C).
- Alice sends the ciphertext (C) to Bob.
- Bob, being the recipient, decrypts the ciphertext (C) using his secret key (SB) to retrieve the
original message {m}.
- Now, the message {m} has been securely transmitted from Alice to Bob without any external
entity being able to read or observe the contents of the message.
Question 1.2:
We have Alice and Bob have been shown on the figure:
Alice has the Public key (PA), the Secret key of Alice (SA), and the Public key of Bob (PB).
Bob has the Public key (PB), the Secret key of Bob (SB), and the Public key of Alice (PA).
(P… means both you and others have this key, and S… means only you have the key)
To achieve both authentication and secrecy while using Diffie-Hellman Key Exchange to send a message
to Bob, Alice should use both her secret key (SA) and Bob's public key (PB) in conjunction with a digital
signature and symmetric encryption.
Here is how Alice can achieve both authentication and secrecy in the message exchange:
Diffie-Hellman Key Exchange: Alice and Bob have to perform the Diffie-Hellman Key Exchange
protocol to establish a shared secret key known only to them. This shared secret key will be used for
symmetric encryption, ensuring message secrecy between Alice and Bob.
Authentication with Digital Signature: To authenticate her identity and ensure the integrity of the
message, Alice will sign the message {m} using her secret key (SA) to create a digital signature (S). This
signature proves that the message originates from Alice and has not been altered in transit.
Encrypting the Message: After creating the digital signature, Alice encrypts both the original message
{m} and the digital signature (S) using Bob's public key (PB) to create a ciphertext (C).
Sending the Ciphertext: Alice sends the ciphertext (C) to Bob.
Decryption and Verification by Bob: Bob receives the ciphertext (C) and decrypts it using his secret key
(SB) to retrieve the original message {m} and the digital signature (S). After decrypting, Bob verifies the
authenticity of the message using Alice's public key (PA) to verify the digital signature (S).
Question 2.1:
- The operation of Schema 1:
+ First, a secret key K and a seed value S are generated and shared between the sender and receiver.
+ The sender computes the hash value of the plaintext message M using a hash function H, i.e., H(M).
+ The sender then encrypts the hash value using a symmetric encryption scheme with the secret key K
and seed value S, i.e., E(K,S)(H(M)).
+ The sender appends the encrypted hash value to the plaintext message to form the authenticated
message, i.e., M || E(K,S)(H(M)).
+ The authenticated message is sent to the receiver.
+ Upon receiving the authenticated message, the receiver separates the plaintext message and the
encrypted hash value.
+ The receiver decrypts the encrypted hash value using the same secret key K and seed value S used by
the sender, i.e., D(K,S)(E(K,S)(H(M))) = H(M).
+ The receiver computes the hash value of the plaintext message M using the same hash function H, i.e.,
H(M).
+ The receiver compares the computed hash value with the decrypted hash value. If the two values
match, then the message is authenticated; otherwise, it is not.
- The advantages:
+ Provides both integrity and authenticity of the message.
+ The secret key is shared between the sender and receiver, making it more secure than a hash-only
scheme.
+ The use of encryption makes it more difficult for an attacker to manipulate the message without being
detected.
- The disadvantages:
+ The use of encryption adds computational overhead, making it slower than a hash-only scheme.
+ The key and seed values must be securely distributed and managed to prevent an attacker from
compromising the system.
- The advantages:
+ Provides strong message authentication as the hash value is encrypted with a secret key, which ensures
that only authorized parties can verify the integrity of the message.
+ The use of a hash function provides a way to verify that the message has not been tampered with
during transmission.
- The disadvantages:
+ Requires the use of a secret key, which must be securely shared between the sender and receiver.
+ This schema does not provide confidentiality because the plaintext message is sent in the clear along
with the ciphertext hash value.
Question 2.2:
Schema:
User registration: Users register with the system by providing their username, password, and
email address. The username and password are stored in the database as hashed values. The email
address is used to send the user a confirmation message and to reset their password if they forget
it.
Login: Users login to the system by providing their username and password. The username is
checked against the database to see if it exists. If it does, the password is hashed and compared to
the hashed password in the database. If the passwords match, the user is logged in.
Data confidentiality: Data confidentiality is achieved by encrypting all data before it is stored in
the database. The encryption key is a symmetric key that is shared between the client and the
server. The key is generated randomly and stored in the database.
Data integrity: Data integrity is achieved by using a hash function to calculate a hash value for
each piece of data. The hash value is stored along with the data. When the data is retrieved, the
hash value is recalculated and compared to the stored hash value. If the hash values match, the
data has not been tampered with.
Operation:
The schema works as follows:
1. When a user registers with the system, their username, password, and email address are stored in
the database. The password is hashed before it is stored.
2. When a user logs in to the system, their username and password are checked against the database.
If the passwords match, the user is logged in.
3. Before any data is stored in the database, it is encrypted using the symmetric key. The key is
shared between the client and the server.
4. When data is retrieved from the database, it is decrypted using the symmetric key.
5. A hash function is used to calculate a hash value for each piece of data. The hash value is stored
along with the data.
6. When the data is retrieved, the hash value is recalculated and compared to the stored hash value.
If the hash values match, the data has not been tampered with.
Advantages:
The advantages of this schema include:
Strong authentication: Users are authenticated using a combination of username, password, and
email address. This makes it more difficult for unauthorized users to gain access to the system.
Strong confidentiality: All data is encrypted before it is stored in the database. This ensures that
the data is not accessible to unauthorized users.
Strong integrity: A hash function is used to calculate a hash value for each piece of data. This
ensures that the data has not been tampered with since it was stored.
Disadvantages:
The disadvantages of this schema include:
The schema is more complex than some other schemas. This could make it more difficult to
implement and maintain.
The schema requires the use of a symmetric key. This key must be kept secure in order to prevent
unauthorized users from accessing the data.
Overall, this schema provides strong authentication, confidentiality, and integrity for data stored in the
system. However, the schema is more complex than some other schemas and requires the use of a
symmetric key.