Database and Security Flashcards

1
Q

How does a DBMS provide security for database users?

A

A DBMS provides security by assigning each database user an account with a unique username and password. These credentials are used to identify a user and control their access to the database.

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

What is the role of usernames and passwords in DBMS security?

A

Usernames and passwords are used as credentials to authenticate and verify the identity of a user. These credentials are essential for controlling access to the database and ensuring that only authorized users can interact with the data.

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

What actions does a DBMS verify when a user attempts to interact with the database?

A

When a user tries to interact with the database, the DBMS verifies the following actions:

Retrieve data
Modify data
Modify the database structure

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

How does the DBMS use passwords in the security process?

A

The DBMS verifies passwords during the authentication process. When a user attempts to access the database, the provided password is checked against the stored password associated with the user’s account. If the passwords match, the user is authenticated, and their permissions are checked.

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

Why is controlling access to information important in a DBMS?

A

Controlling access to information is crucial in a DBMS to ensure that only authorized users can view, modify, or alter the database. This helps in maintaining the confidentiality, integrity, and security of the data, preventing unauthorized access or tampering.

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

In SQL, what are the common privileges used to control access to tables and other database objects?

A

The common privileges used in SQL to control access to tables and other database objects include:

SELECT privilege
INSERT privilege
UPDATE privilege
DELETE privilege

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

Who has all privileges on all objects in a database, and how can these privileges be granted to others?

A

The owner (creator) of a database has all privileges on all objects in the database. The owner can grant these privileges to others.

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

What privileges does the owner (creator) of an object have, and how can these privileges be passed on to others?

A

The owner (creator) of an object has all privileges on that object. The owner can pass these privileges on to others.

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

How are privileges granted in SQL, and what are the components of the GRANT statement?

A

Privileges are granted in SQL using the GRANT statement. The components of the GRANT statement include:

<privileges>: A list of privileges such as SELECT, INSERT, UPDATE, DELETE, or ALL.
<object>: The name of a table or view.
<users>: A list of user names or PUBLIC.
[WITH GRANT OPTION]: An optional clause that means users can pass their granted privileges on to others.
</users></object></privileges>

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

What is the significance of the WITH GRANT OPTION in the GRANT statement?

A

The WITH GRANT OPTION in the GRANT statement means that the users receiving the privileges can pass those privileges on to others. It allows for cascading the delegation of privileges in the security model.

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

How can you remove a privilege that you have granted to another user in SQL?

A

To remove a privilege that you have granted, you use the REVOKE statement in SQL. The syntax is as follows:

REVOKE <privileges>
ON <object>
FROM <users>;</users></object></privileges>

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

What happens if a user has the same privilege from multiple users, and one user revokes the privilege?

A

If a user has the same privilege from multiple users, and one user revokes the privilege, the user will still retain the privilege from the other users. The revocation only affects the privileges granted by the specific user issuing the REVOKE statement.

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

In the context of privilege revocation, what happens to privileges that are dependent on the revoked one?

A

When a privilege is revoked, all privileges that are dependent on the revoked one are also revoked. This ensures consistency in the security model.

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

Provide an example scenario of granting and revoking privileges among users in SQL.

A

Example Scenario:

‘Admin’ grants ALL privileges to ‘King’ and SELECT privilege to ‘Princess’ with the grant option.
‘King’ grants ALL privileges to ‘Farmer’.
‘Princess’ grants SELECT privilege to ‘Farmer’.
If ‘Admin’ revokes privileges from ‘King’, both ‘King’ and ‘Farmer’ lose their privileges. ‘Princess’ retains her SELECT privilege.

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

What does the “WITH GRANT OPTION” mean in the context of granting privileges?

A

The “WITH GRANT OPTION” in the GRANT statement means that the users receiving the privileges can pass those privileges on to others. It allows for the delegation of privileges in the security model.

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

How do privileges work at the level of tables in a database?

A

Privileges in a database work at the level of tables, allowing control over access to entire tables. These privileges can include restrictions on operations such as SELECT, INSERT, UPDATE, and DELETE.

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

Can you restrict access by column using privileges in a database?

A

Yes, you can restrict access by column using privileges in a database. This means you can control which columns a user has permission to access or modify.

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

What limitation exists when using privileges alone in restricting access?

A

While privileges can restrict access by column, they cannot restrict access by row. This limitation is addressed by using views in conjunction with privileges.

19
Q

How do views, along with privileges, contribute to customized access in a database?

A

Views provide a way to create “derived” tables based on SELECT statements, and privileges can be granted or revoked on these views. This combination allows for customized access by presenting users with specific subsets of data through views.

20
Q

What is a view in the context of a database?

A

In the context of a database, a view is the result of a SELECT statement treated like a table. It provides a way to create a virtual table that represents a subset of data from one or more tables in the database.

21
Q

How are views and privileges used together to control access in a database?

A

Views and privileges are used together by creating views that contain the necessary information only, and then granting or revoking privileges on those views rather than directly on the underlying tables. This allows for a more fine-grained control of access.

22
Q

In the RSA cryptosystem, what is the primary goal when encrypting a message for secure communication?

A

The primary goal when encrypting a message in the RSA cryptosystem is to ensure that it is very difficult for a potential interceptor (hacker) to infer the original message from the encrypted ciphertext.

23
Q

What form is the message (m) in when using the RSA cryptosystem, and how is it regarded for encryption?

A

In the RSA cryptosystem, the message (m) is regarded in its binary form, meaning it is treated as a sequence of 0’s and 1’s. It is regarded as a (potentially very large) integer, allowing for encryption and decryption operations.

24
Q

Why is the preparation step in the RSA cryptosystem carried out only once?

A

The preparation step in the RSA cryptosystem involves generating two keys: a public key and a private key. These keys are used for encryption and decryption, respectively. Once generated, the keys can be used for secure communication indefinitely, and the preparation step need not be repeated for each message.

25
Q

What are the three main steps in the RSA cryptosystem, and what is the purpose of each step?

A

The three main steps in the RSA cryptosystem are:

Preparation: Alice prepares two keys - a public key and a private key. This step is carried out only once and the keys are used for all subsequent communications.
Encryption: Bob encrypts his message (m) into a ciphertext (C) using Alice’s public key. This ensures that the message is secure during transmission over a public network.
Decryption: Alice converts the received ciphertext (C) back to the original message (m) using her private key. This step allows only the intended recipient to retrieve the original message.

26
Q

What makes the RSA cryptosystem secure for communication over a public network?

A

The RSA cryptosystem is secure for communication over a public network because it is based on the mathematical difficulty of factoring the product of two large prime numbers. The encryption and decryption processes involve the use of public and private keys, and the security relies on the impracticality of factoring the large composite number used in the algorithm.

27
Q

In the RSA cryptosystem, what are the key steps in Alice’s preparation phase?

A

The key steps in Alice’s preparation phase in the RSA cryptosystem are as follows:

Choose Primes: Randomly choose two large prime numbers, p and q.
Compute n: Calculate n as the product of p and q (n = p * q).
Compute φ (Phi): Calculate φ (phi) as (p - 1)(q - 1).
Choose e: Select a number e from the range [1, φ - 1] that is co-prime to φ (i.e., the greatest common divisor of e and φ is 1).
Compute d: Calculate a number d from the range [1, φ - 1] such that (e * d) mod φ = 1.
Public and Private Keys: Announce the pair (e, n) as the public key to the world. Keep the pair (d, n) as the private key secret to herself.

28
Q

Why is it important for e to be co-prime to φ in the RSA cryptosystem?

A

It is important for e to be co-prime to φ in the RSA cryptosystem because the security of the system relies on the difficulty of factoring the product of two large prime numbers (n = p * q). The co-primality ensures that there is no common factor between e and φ, making it computationally challenging for an attacker to deduce the private key d.

29
Q

What is the significance of the pair (e, n) in the RSA cryptosystem, and why is it announced publicly?

A

The pair (e, n) is the public key in the RSA cryptosystem. It is announced publicly to allow others, such as Bob, to encrypt messages intended for Alice. The public key (e, n) is used for encryption, and it is not sensitive information. Anyone can use the public key to encrypt a message, but only Alice, who possesses the corresponding private key, can decrypt it.

30
Q

Why does Alice keep the pair (d, n) as the private key secret?

A

The pair (d, n) is the private key in the RSA cryptosystem. Keeping it secret is essential to maintain the security of the system. The private key is used for decryption, allowing only Alice to recover the original message from the encrypted ciphertext. Revealing the private key would compromise the confidentiality of the communication.

31
Q

What mathematical relationship should hold between e and d in the RSA cryptosystem?

A

In the RSA cryptosystem, the mathematical relationship between e and d is that (e * d) mod φ = 1. This relationship ensures the correctness of the encryption and decryption processes and is a fundamental property of the RSA algorithm.

32
Q

In the RSA cryptosystem, what is the formula for encrypting a message (m) into ciphertext (C)?

A

The formula for encrypting a message (m) into ciphertext (C) in the RSA cryptosystem is:
C≡m^e (mod n)

33
Q

What are the components involved in the encryption formula
C ≡ m^e (mod n)?

A

C: The ciphertext.

m: The original message.

e: The public exponent from Alice’s public key.

n: The product of the two large prime numbers from Alice’s public key.

34
Q

Why is the use of modular arithmetic (mod n) important in the encryption formula?

A

The use of modular arithmetic (mod n) is important in the encryption formula to ensure that the result remains within a certain range. It helps prevent arithmetic overflow and keeps the ciphertext within manageable bounds. Additionally, modular arithmetic supports the mathematical properties necessary for the security of the RSA cryptosystem.

35
Q

After Bob encrypts a message using Alice’s public key, what does he send to Alice?

A

After Bob encrypts a message using Alice’s public key, he sends the resulting ciphertext (C) to Alice. The ciphertext is the encrypted form of the original message, and only Alice, with her private key, can decrypt and recover the original message.

36
Q

In the RSA cryptosystem, what is the formula for decrypting ciphertext (C) to recover the original message (m)?

A

The formula for decrypting ciphertext (C) to recover the original message (m) in the RSA cryptosystem is:
m≡C^d (mod n)

37
Q

What are the components involved in the decryption formula

m≡C^d (mod n)?

A

m: The original message to be recovered.

C: The ciphertext received from the sender.

d: The private exponent from Alice’s private key.

n: The product of the two large prime numbers from Alice’s private key.

38
Q

Why is the use of modular arithmetic (mod n) important in the decryption formula?

A

Similar to encryption, the use of modular arithmetic (mod n) is important in the decryption formula to ensure that the result remains within a certain range. It helps prevent arithmetic overflow and keeps the recovered message within manageable bounds. Additionally, modular arithmetic supports the mathematical properties necessary for the security of the RSA cryptosystem.

39
Q

After decrypting a ciphertext using her private key, what does Alice recover?

A

After decrypting a ciphertext using her private key, Alice recovers the original message (m). The decrypted message is the result of applying the decryption formula
m≡C^d (mod n) to the received ciphertext.

40
Q

In the RSA cryptosystem, what is the primary weakness that an attacker exploits to break the system?

A

The primary weakness in the RSA cryptosystem that an attacker exploits is the difficulty of factoring the product of two large prime numbers (n = p * q). If an attacker can factorize n back into its prime factors (p and q), they can reveal the entire preparation carried out by Alice and obtain the private key components.

41
Q

What is the significance of factorizing n into p and q in breaking RSA?

A

Factorizing n into p and q is significant in breaking RSA because it reveals the prime factors used in the key generation process. Once the prime factors are known, an attacker can compute φ (phi) and, subsequently, compute the private key exponent (d) from the public key exponent (e) and φ. With the private key, the attacker can decrypt ciphertexts and recover the original messages.

42
Q

Why is obtaining φ crucial in breaking RSA?

A

Obtaining φ (phi) is crucial in breaking RSA because it is used in the computation of the private key exponent (d). The relationship between e, d, and φ is a fundamental property of the RSA algorithm. If an attacker can obtain φ, they can calculate the private key exponent and, consequently, decrypt ciphertexts using the private key.

43
Q

What does the attacker need to compute once they have factored n, obtained φ, and revealed the entire preparation carried out by Alice?

A

Once the attacker has factored n, obtained φ, and revealed the entire preparation carried out by Alice, the attacker needs to compute the private key exponent (d) from the public key exponent (e) and φ. With the computed private key, the attacker can then use it to decrypt ciphertexts (C) and recover the original messages (m).

44
Q

What is the main countermeasure to prevent RSA from being broken?

A

The main countermeasure to prevent RSA from being broken is to use sufficiently large prime numbers for key generation. As the security of RSA relies on the difficulty of factoring the product of two large primes, using larger prime numbers increases the computational effort required by an attacker to factorize n and break the system.