1. Home
  2. Explore
  3. Computer Science
  4. Securing Stored Passwords

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Securing Stored Passwords

  • 79Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Password Hashing

Why is storing users’ passwords in plaintext dangerous if a server database is compromised?

79 questions

  1. 1

    Why is storing users’ passwords in plaintext dangerous if a server database is compromised?

    Model answer

    An attacker who obtains the database can read the passwords directly and may use them in credential-stuffing attacks against other services.

    Explanation

    Plaintext storage gives an attacker the actual credentials rather than requiring them to recover passwords from protected values.

  2. 2

    What does hashing do to a password, and what should a service store instead of the password?

    Model answer

    Hashing applies a function to a password to produce a hash value. A service should store the hash rather than the plaintext password.

    Explanation

    The hash is the output of processing the password through a hash function.

  3. 3

    Why is a hash function that outputs only the first letter’s position in the alphabet a poor password-hashing method?

    Model answer

    It is too simple and leaks information about the password; different passwords beginning with the same letter also produce the same result.

    Explanation

    For example, passwords such as “apple” and “avocado” would both produce the value for A.

  4. 4

    How does a server use hashing when a user creates an account?

    Model answer

    The server hashes the submitted password, stores the username and resulting hash, and discards the plaintext password.

    Explanation

    The password is processed before being saved so the database does not need to retain it in readable form.

  5. 5

    How does a server check a password during a later login if it has stored only a hash?

    Model answer

    It hashes the submitted password using the same process and compares the new hash with the stored hash. Matching values authenticate the user.

    Explanation

    The server compares hash values rather than comparing the submitted password with a stored plaintext password.

  6. 6

    How does password hashing change the work an attacker must do after stealing a password database?

    Model answer

    The attacker must guess candidate passwords, hash them, and compare the results with the stolen hashes instead of reading the passwords directly.

    Explanation

    Hashing raises the attacker’s cost but does not make the system completely secure.

  7. 7

    How can a dictionary attack be used against stolen password hashes?

    Model answer

    An attacker hashes likely words or passwords from a dictionary and compares each result with the stolen hashes.

    Explanation

    A matching hash can reveal that the corresponding dictionary entry was used as a password.

  8. 8

    How does a brute-force attack attempt to recover a password from its hash?

    Model answer

    It tries possible passwords systematically, hashes each candidate, and checks whether the result matches a stolen hash.

    Explanation

    Candidates can include sequences of numbers, letters, or other characters.

  9. 9

    What is a rainbow table, and how does it help an attacker?

    Model answer

    A rainbow table is a precomputed collection of candidate passwords and their hashes. An attacker can compare stolen hashes against the table instead of computing every candidate hash during the attack.

    Explanation

    Precomputing hashes can speed up password guessing, although storing a very large table can require substantial resources.

  10. 10

    What can an attacker infer when two users have identical password hashes in a database?

    Model answer

    The attacker can infer that the users may have chosen the same password, even without knowing what that password is.

    Explanation

    The same input to a deterministic hash function produces the same output.

  11. 11

    What is a salt in password hashing, and why is it used?

    Model answer

    A salt is an additional value used with a password as input to a hash function. Different salts make identical passwords produce different hashes, reducing information leaks and hindering precomputed attacks.

    Explanation

    Salting makes it harder to recognize matching passwords by comparing stored hash values.

  12. 12

    Does a salt need to be secret, and where can a system store it?

    Model answer

    A salt does not need to be secret. It can be stored as part of the stored hash value.

    Explanation

    The server needs the salt again during login, so it can retrieve it from the stored value.

  13. 13

    How does a server use a stored salt when authenticating a user?

    Model answer

    It retrieves the user’s salt, hashes the submitted password with that salt, and compares the result with the stored hash.

    Explanation

    Using the same password and salt recreates the value the server stored during registration.

  14. 14

    Why can two users still have identical password hashes even when salts are used?

    Model answer

    If the users happen to receive the same salt and choose the same password, their hashes may still match. Salting reduces the likelihood of this situation but does not eliminate it.

    Explanation

    A limited supply of possible salt values can lead to reuse, especially across many users.

  15. 15

    Why should a service use established libraries and standards for password hashing rather than inventing its own method?

    Model answer

    Established methods have been designed, tested, and analyzed by specialists; a home-built system may contain overlooked weaknesses or errors.

    Explanation

    Security systems can have many corner cases that are difficult to identify without extensive expertise and testing.

  16. 16

    Why is a cryptographic hash function called one-way, and what does its fixed-length output mean?

    Model answer

    It is designed to produce a hash from an input without providing a reliable way to recover that input. It can accept inputs of varying lengths while producing outputs of a fixed length.

    Explanation

    The output is a compact representation of the input, not a reversible encoding of it.

  17. 17

    Why can two different inputs produce the same cryptographic hash value?

    Model answer

    The possible inputs are far more numerous than the values in the finite hash-output range, so multiple inputs must map to the same output.

    Explanation

    This is a consequence of mapping a very large input space into a finite set of possible hash values.

  18. 18

    What is a collision in hashing, and what possible authentication consequence can it have?

    Model answer

    A collision occurs when different inputs produce the same hash. In principle, a different input with the same hash as a user’s password could also be accepted by a system that checks only the hash.

    Explanation

    The risk of finding such an alternative input is treated as very small for suitably large, modern hash values.

  19. 19

    Why does hashing a password not guarantee that the password cannot be discovered?

    Model answer

    An attacker can still guess likely passwords or try candidates by brute force, hashing each one and comparing the result with the stolen hash.

    Explanation

    Hashing makes recovery more work, but weak or guessable passwords may still be found.

  20. 20

    What is the difference between hashing and encryption in terms of reversibility?

    Model answer

    Hashing is generally one-way, while encryption is designed to be reversible using the appropriate key.

    Explanation

    Encryption preserves information so an authorized recipient can recover the original message; hashing does not.

  21. 21

    How can hash functions help check the integrity of a message sent over a network?

    Model answer

    A hash can provide a fixed-length representation of the message that can be compared to detect whether the message changed.

    Explanation

    The content describes hash functions as useful for checking message authenticity and integrity as well as for password storage.

  22. 22

    What information can a hash-format identifier in a stored password value provide?

    Model answer

    It can indicate which hash function was used to generate the stored value.

    Explanation

    Systems can use that identifier to select the appropriate function when checking a password.

  23. 23

    What does NIST recommend for storing memorized secrets to resist offline guessing attacks?

    Model answer

    NIST recommends salting and hashing them with a suitable one-way key-derivation function designed to make each password-guessing trial expensive.

    Explanation

    Increasing the cost of each trial can make an offline guessing attack difficult or prohibitive.

  24. 24

    What are codes in cryptography, and how do encoding and decoding work with a codebook?

    Model answer

    A code maps code words to the meanings or messages they represent. Encoding replaces a plaintext message with code text, and decoding uses the codebook to recover the plaintext.

    Explanation

    A codebook allows the sender and recipient to interpret code words that would otherwise be unclear.

  25. 25

    What are two disadvantages of using a physical codebook to protect messages?

    Model answer

    Using it can be cumbersome and time-consuming, and if the book is stolen, an attacker may decode past or future messages.

    Explanation

    The sender and recipient must keep and consult their copies of the book securely.

  26. 26

    How do ciphers differ from codes?

    Model answer

    Ciphers use an algorithmic process, often operating on individual letters or bits, rather than relying on mappings between whole code words and meanings.

    Explanation

    A cipher can apply a repeatable transformation to each part of a message.

  27. 27

    What is the relationship between plaintext, ciphertext, encryption, and decryption?

    Model answer

    Encryption or enciphering transforms plaintext into ciphertext. Decryption or deciphering reverses the process to recover the plaintext.

    Explanation

    The terms describe the forward and reverse operations of a cipher.

  28. 28

    What role does a key play in using a cipher?

    Model answer

    A key configures the cipher so that its operation is specific to a particular use; authorized parties use the required key or keys to encrypt and decrypt.

    Explanation

    The algorithm can be public while the key provides the secret customization.

  29. 29

    How does a rotational cipher such as the Caesar cipher transform letters?

    Model answer

    It shifts each letter a specified number of places in the alphabet, wrapping around from Z to A when necessary.

    Explanation

    For example, a shift of one maps A to B and B to C.

  30. 30

    Why is a Caesar cipher with a small key easy to break?

    Model answer

    There are very few possible shifts, so an attacker can try them all and identify the readable plaintext.

    Explanation

    The key can be found with a simple brute-force search, even by hand for a short message.

  31. 31

    Why does ROT13 obscure text without providing strong security?

    Model answer

    ROT13 shifts letters by 13 places, but it is a simple reversible transformation that anyone can undo.

    Explanation

    It has been used to obscure spoilers, not to protect information from a determined attacker.

  32. 32

    Why does a rotational cipher using a shift of 26 leave English text unchanged?

    Model answer

    The English alphabet has 26 letters, so shifting each letter by 26 positions returns it to its original position.

    Explanation

    The ciphertext is identical to the plaintext, so the shift provides no concealment.

  33. 33

    What is the difference between symmetric-key and asymmetric-key encryption?

    Model answer

    Symmetric-key encryption uses the same key for encryption and decryption, whereas asymmetric-key encryption uses a public key and a corresponding private key.

    Explanation

    The two approaches address different key-management problems.

  34. 34

    Why does symmetric encryption create a key-distribution problem for people who have never communicated before?

    Model answer

    The parties need to share a secret key, but sending that key securely is difficult if they do not already have a secure way to communicate.

    Explanation

    This is the “chicken and egg” problem of establishing a shared secret.

  35. 35

    How do AES and triple DES fit into the categories of encryption described in the content?

    Model answer

    AES and triple DES are examples of commonly used secret-key, or symmetric-key, encryption algorithms.

    Explanation

    Both sender and recipient need to use the same key.

  36. 36

    What keys does public-key cryptography give each participant, and how should each key be handled?

    Model answer

    Each participant has a public key that can be shared and a private key that must be kept secret.

    Explanation

    The two keys have a mathematical relationship that supports the cryptographic operations.

  37. 37

    How can someone send a confidential message to a recipient using public-key encryption?

    Model answer

    The sender encrypts the message with the recipient’s public key, and the recipient decrypts it with the corresponding private key.

    Explanation

    The private key corresponding to that public key is required to recover the message.

  38. 38

    How does public-key encryption help solve the shared-secret problem of symmetric encryption?

    Model answer

    It lets a sender use the recipient’s public key to encrypt a message without first sharing a secret key with the recipient.

    Explanation

    The recipient’s private key, which is not shared, decrypts the message.

  39. 39

    What is the basic mathematical idea behind RSA key generation?

    Model answer

    A computer chooses two large prime numbers, multiplies them to produce a value commonly called n, and uses that value in the rest of the algorithm.

    Explanation

    RSA relies in part on the difficulty of determining the original prime factors from their product.

  40. 40

    What is a prime number, and why are large primes important to the RSA process described?

    Model answer

    A prime number is divisible only by itself and one. RSA uses large primes because recovering the original primes from their product is difficult.

    Explanation

    The product is used in the mathematics that supports RSA’s public- and private-key operations.

  41. 41

    At a high level, how does RSA encrypt and decrypt a message?

    Model answer

    The message is transformed using the public exponent and a modulus to produce ciphertext; the recipient uses the private exponent and the same modulus to recover the message.

    Explanation

    The operations involve modular arithmetic, including calculating remainders.

  42. 42

    What does modular arithmetic contribute to the RSA operations described?

    Model answer

    It uses remainders after division by a modulus as part of the transformations that encrypt and decrypt messages.

    Explanation

    The encryption and decryption calculations each involve exponentiation and taking a remainder.

  43. 43

    What is the purpose of the Diffie–Hellman key-exchange process?

    Model answer

    It allows two parties to calculate the same shared secret over a public channel without sending the complete secret itself.

    Explanation

    The parties can then use that shared value with a symmetric encryption algorithm.

  44. 44

    What values do the two parties agree on at the start of the Diffie–Hellman process, and what does each keep private?

    Model answer

    They agree on a generator and a large prime, while each party privately chooses its own secret number.

    Explanation

    The public values are used in calculations together with each party’s private value.

  45. 45

    How do the parties in Diffie–Hellman arrive at the same shared secret?

    Model answer

    They exchange values calculated from the agreed public parameters and their private numbers, then use the received value with their own private number to calculate the shared secret.

    Explanation

    The mathematics makes the two resulting values equal even though the shared secret itself is not transmitted.

  46. 46

    Why should organizations generally use publicly reviewed cryptographic algorithms rather than inventing their own?

    Model answer

    Established algorithms have been tested and analyzed by specialists, while a new, unreviewed system may contain weaknesses its creators have missed.

    Explanation

    Cryptographic systems involve complex mathematics and many possible corner cases.

  47. 47

    Why is keeping a cryptographic algorithm secret generally not considered a substitute for using a strong key?

    Model answer

    Security is intended to depend on protecting the key, not hiding the algorithm. Publicly reviewed algorithms can be used securely when configured with appropriate keys.

    Explanation

    The algorithm can be public knowledge while the key remains private.

  48. 48

    How is a digital signature created from a document?

    Model answer

    The signer hashes the document and uses their private key with that hash in a digital-signature algorithm to produce a signature.

    Explanation

    Hashing reduces a document of any length to a fixed-length value that can be signed.

  49. 49

    How can a recipient verify a digital signature?

    Model answer

    The recipient hashes the received document, uses the signer’s public key to verify the signature and recover the signed hash, and checks that the hashes match.

    Explanation

    A match supports the claim that the document was signed with the private key corresponding to the public key.

  50. 50

    What does a valid digital signature establish, and what does it not establish by itself?

    Model answer

    It can establish that the holder of the corresponding private key signed the document and that the document matches the signed hash. It does not, by itself, make the document confidential.

    Explanation

    The document can remain public while its signature is used to verify its origin and integrity.

  51. 51

    Why is the security of a digital signature dependent on protecting the private key?

    Model answer

    A person with the private key can create signatures that verify with the corresponding public key, so a stolen key could be used to forge the owner’s signatures.

    Explanation

    The signature system’s security depends on keeping the private key private.

  52. 52

    Why must a recipient know that a public key really belongs to the claimed signer?

    Model answer

    The recipient needs to trust that the key used for verification is actually associated with the signer rather than an impostor.

    Explanation

    That association may be supported by a registry, a trusted third party, or a trusted source such as the signer’s website.

  53. 53

    Are public and private keys normally tied to a user’s IP address?

    Model answer

    No. The content describes keys as associated with people through registries or other trust systems, not typically through IP addresses.

    Explanation

    A public key may be distributed through a central registry, email, a website, or another trusted channel.

  54. 54

    How do passkeys use public- and private-key cryptography to avoid passwords?

    Model answer

    A device creates a key pair for a website, sends the public key to the website, and keeps the private key for later authentication.

    Explanation

    The website can authenticate the user without storing or checking a conventional password.

  55. 55

    What might a device ask a user to provide when setting up or using a passkey, and what is that check for?

    Model answer

    It may ask for a fingerprint, face scan, or PIN to check that the person is authorized to use the device.

    Explanation

    The device uses this factor locally as part of access to the passkey.

  56. 56

    What does a website do to challenge a user during passkey login, and how does the device respond?

    Model answer

    The website sends randomly generated data as a challenge, and the device signs it with the user’s private key and returns the signature.

    Explanation

    The challenge is a new piece of data the website can use to test possession of the private key.

  57. 57

    How does a website verify a passkey login?

    Model answer

    It uses the stored public key to verify the returned signature and checks that it corresponds to the challenge it sent.

    Explanation

    A successful check indicates that the login response was made using the private key paired with that public key.

  58. 58

    Why does using a different passkey key pair for each website limit the impact of a compromise?

    Model answer

    Each key pair is specific to one website, so a key used for one site is not the key used for other sites.

    Explanation

    The content describes devices generating a separate public- and private-key pair for each website or app.

  59. 59

    What is one important risk users must consider when relying on passkeys?

    Model answer

    They may lose access if they lose the device or the keys stored on it and have no synchronized copy or recovery method.

    Explanation

    Cloud services may synchronize passkeys across devices, but access depends on the keys remaining available.

  60. 60

    What is the difference between encryption in transit and end-to-end encryption?

    Model answer

    Encryption in transit protects data along a particular connection, while end-to-end encryption protects it between the communicating users so intermediaries cannot read it.

    Explanation

    A service can provide encrypted connections to both users yet still be able to access their messages.

  61. 61

    Why do encrypted connections from Alice to an email provider and from Bob to the same provider not necessarily protect Alice’s message from the provider?

    Model answer

    Each connection may be encrypted only between a user and the provider, leaving the provider able to access the message between those connections.

    Explanation

    Encryption on two separate links does not automatically create end-to-end encryption between the users.

  62. 62

    What can an intermediary see when communication is properly protected with end-to-end encryption?

    Model answer

    The intermediary can see ciphertext but should not be able to understand the message without the required key.

    Explanation

    The data remains encrypted from the sender to the intended recipient even as it passes through intermediaries.

  63. 63

    Why might a service provider prefer not to offer end-to-end encryption?

    Model answer

    End-to-end encryption can prevent the provider from accessing user data that it might otherwise use, for example, for advertising purposes.

    Explanation

    The provider may want access to data even while protecting its servers and network connections.

  64. 64

    How does end-to-end encryption differ from simply having a secure connection to a service such as a video-conferencing platform?

    Model answer

    A secure connection to the platform protects data in transit to the platform, but the platform may still be able to access the communication. End-to-end encryption is intended to prevent intermediaries, including the platform, from reading it.

    Explanation

    The protection depends on whether the service encrypts the communication between the actual participants.

  65. 65

    Why is deleting a file by moving it to the Trash or Recycle Bin not the same as securely deleting it?

    Model answer

    Moving a file there generally changes how the system treats it but does not immediately erase the data from the storage device.

    Explanation

    The file may remain recoverable even after the Trash or Recycle Bin is emptied.

  66. 66

    What usually happens to a file’s data when the Trash or Recycle Bin is emptied?

    Model answer

    The operating system generally forgets where the file’s data is stored and marks that space as available for reuse, rather than immediately erasing the data.

    Explanation

    The underlying bits may remain until other data overwrites them.

  67. 67

    Why might remnants of a deleted file remain on a storage device for some time?

    Model answer

    The space is reused gradually, so some of the original data may remain until it is overwritten by new data.

    Explanation

    Deleted data can persist even after parts of its storage have been repurposed.

  68. 68

    What is the basic idea of securely deleting a file by overwriting it?

    Model answer

    Replace the file’s stored bits with other values, such as zeros, ones, or random bits, so the original data is no longer represented there.

    Explanation

    Overwriting aims to prevent recovery from leftover original bit patterns.

  69. 69

    What is encryption at rest?

    Model answer

    Encryption at rest protects data while it is stored on a device rather than being transmitted between devices.

    Explanation

    Full-disk encryption is one example of encryption at rest.

  70. 70

    How does full-disk encryption protect a device when it is locked or powered off?

    Model answer

    It stores the device’s data in encrypted form so that someone without the appropriate password or biometric cannot readily access it.

    Explanation

    When the authorized user unlocks the device, the data is decrypted for normal use.

  71. 71

    Why can full-disk encryption help protect a device that is sold, donated, or traded in?

    Model answer

    If the data was encrypted and the new owner does not have the password or biometric needed to unlock it, the stored data should remain inaccessible.

    Explanation

    This protection depends on the credentials and encryption having been set up properly.

  72. 72

    Why is it useful to enable full-disk encryption when a device is new?

    Model answer

    Storage hardware may wear out or become unable to overwrite some bits, so encrypting the data from the start helps protect it even if those bits later cannot be changed.

    Explanation

    Encryption can protect data that remains on parts of a device that can no longer be reliably rewritten.

  73. 73

    What usability trade-off can full-disk encryption create?

    Model answer

    If users lose the password or can no longer use the required biometric, they may also lose access to their encrypted data.

    Explanation

    The security benefit depends on the user being able to authenticate and unlock the device.

  74. 74

    What is ransomware, and how do attackers use it for extortion?

    Model answer

    Ransomware encrypts data on a system and demands payment in exchange for the key needed to recover it.

    Explanation

    Attackers may target personal devices, businesses, hospitals, or municipal networks.

  75. 75

    Why does quantum computing pose a potential threat to current cryptographic protections?

    Model answer

    If quantum computers give attackers much greater computational capability, attacks that are currently impractical could become feasible against existing cryptographic systems.

    Explanation

    The concern is that attackers might search or calculate much more efficiently than with conventional computing.

  76. 76

    What is a qubit, and how does it differ from a conventional bit as described in the content?

    Model answer

    A conventional bit is either zero or one, while a qubit can represent a combination of both states at once.

    Explanation

    This property is presented as a source of quantum computing’s potential computational power.

  77. 77

    How does the number of possible states described for qubits grow as more qubits are added?

    Model answer

    The number doubles with each additional qubit: two qubits can represent four states, three can represent eight, and 32 can represent about four billion.

    Explanation

    The stated growth is exponential in the number of qubits.

  78. 78

    Why might the development of quantum computing require cryptographic algorithms to change?

    Model answer

    If quantum computing makes attacks on current systems practical, stronger or different algorithms will be needed to protect data.

    Explanation

    The content notes that cryptographic methods will need to evolve alongside computing technology.

  79. 79

    Why is quantum computing presented as a future concern rather than an immediate reason to abandon current security practices?

    Model answer

    The content describes it as a potential future threat and notes that cryptographic algorithms are expected to evolve as the technology develops.

    Explanation

    The immediate practical advice is to use current protections correctly while security methods continue to advance.

1 of 79
Question 1 of 79

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent