1. Home
  2. Explore
  3. Computer Science
  4. Securing Digital Accounts

Study methods

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

Securing Digital Accounts

Securing Accounts

Account security involves protecting digital systems from unauthorized access while keeping legitimate access usable. The central concepts are authentication, authorization, strong secrets, additional authentication factors, and defenses against technical and human-based attacks.


Authentication and Authorization

Authentication: Proving Identity

Authentication is the process of digitally proving who someone is.

For example, a website authenticates a user when the user provides a username and password that match the account’s records. The underlying assumption is:

  • The username or email address identifies the account and may be publicly known.

  • The password is private and supposedly known only by the legitimate account holder.

  • Correctly providing both values demonstrates that the person is probably the account owner.

A physical key illustrates the same basic idea. A key allows someone to unlock a building, but anyone who obtains a copy of that key may also be able to enter.

Authorization: Determining Permitted Access

Authorization determines what an authenticated person is allowed to access or do.

Authentication answers:

“Who is this person?”

Authorization answers:

“What is this person allowed to access?”

Being authenticated as a particular person does not automatically mean that the person should have access to every part of a system. For example, someone might be authenticated as a resident of a building but authorized to enter only a common area, not another resident’s private room.

A secure system therefore needs both:

  • Authentication: verifying identity.

  • Authorization: enforcing permissions after identity has been established.


Passwords and Password-Based Authentication

A username, account name, or email address is generally not secret. It identifies the account and may be shared publicly.

A password is intended to remain private. The traditional security assumption is that the legitimate user is the only person who knows both the account identifier and its password.

However, a password is useful only if it is sufficiently difficult for an adversary to guess, discover, steal, or reuse elsewhere.

Characteristics of a Better Password

A password should ideally be:

  • Long, because each additional character increases the number of possibilities.

  • Unpredictable, avoiding obvious patterns and personal information.

  • Unique, meaning it is not reused on another website or application.

  • Allowed to contain many character types, including letters, digits, punctuation, spaces, and, where supported, Unicode characters.

A password containing uppercase letters, lowercase letters, numbers, and punctuation is not automatically secure. If it is short or follows an obvious pattern, it may still be easy to guess.


Password-Cracking Attacks

Dictionary Attacks

A dictionary attack uses a prepared list of likely passwords rather than trying every possible character combination.

An adversary may use:

  • Words from an English or other-language dictionary.

  • Common names and places.

  • Frequently used passwords.

  • Previously breached passwords.

  • Common substitutions, such as replacing a letter with a number.

  • Obvious phrases and predictable patterns.

A password that is an ordinary dictionary word can be discovered quickly because the adversary tries likely words first instead of wasting time on unlikely combinations.

Dictionary attacks are more efficient than random guessing when users choose predictable passwords.

Brute-Force Attacks

A brute-force attack systematically tries every possible password in a defined search space.

For example, an adversary might try:

  1. Every possibility for the first character.

  2. Every possibility for the second character.

  3. Every possibility for the third character.

  4. Every possibility for the remaining characters.

A brute-force attack does not need to predict what the user chose. It eventually tries the correct password if:

  • The attacker has enough time.

  • The system does not limit failed attempts.

  • The password is within the search space.

  • The attacker can test guesses quickly enough.

Password security therefore depends partly on the size of the search space and partly on how quickly guesses can be tested.


Password Search Spaces and Security

The number of possible passwords can be estimated using the multiplication principle.

If each position has NNN possible characters and the password has LLL positions, the total number of possible passwords is:

NLN^LNL

This assumes that characters may be repeated and that every position can use the same set of NNN characters.

Four-Digit Passcodes

A decimal digit has 101010 possibilities: 000 through 999.

For a four-digit passcode:

104=10,00010^4 = 10,000104=10,000

The possibilities range from 0000 through 9999, inclusive. There are 10,00010,00010,000 possibilities rather than 9,9999,9999,999 because 0000 counts as one of them.

A brute-force program can rapidly generate all of these possibilities. Without protections such as rate limiting, a four-digit passcode may be tested extremely quickly.

Four Letters

Using only lowercase English letters gives 262626 possibilities per position. Using both lowercase and uppercase letters gives 525252 possibilities per position.

For four uppercase-or-lowercase letters:

524=7,311,61652^4 = 7,311,616524=7,311,616

This is substantially larger than 10,00010,00010,000, but modern computers can still process millions of possibilities relatively quickly in some attack situations.

Four Letters, Digits, and Punctuation

A typical US keyboard contains approximately:

  • 262626 lowercase letters.

  • 262626 uppercase letters.

  • 101010 decimal digits.

  • 323232 punctuation symbols.

This gives approximately 949494 possible characters.

For four characters:

944=78,074,89694^4 = 78,074,896944=78,074,896

This is about ten times larger than the four-letter search space, but still may not provide adequate protection if an attacker can test guesses rapidly.

Eight Characters

For an eight-character password using the same 949494 possible characters:

948=6,095,689,385,574,65694^8 = 6,095,689,385,574,656948=6,095,689,385,574,656

This is approximately 666 quadrillion possibilities. A sufficiently random password from this space is far more difficult to brute-force than a four-character password.

However, the calculation represents the theoretical search space, not necessarily the actual difficulty of guessing a user’s password. If the user chooses a predictable password such as a repeated character or a common phrase, an adversary may find it through a dictionary or heuristic attack without searching the entire space.

Key principle: Longer and less predictable passwords raise the cost of an attack, but length and character variety help only when the chosen password is not predictable.


The Security–Usability Trade-Off

Security measures often make systems less convenient.

Stronger Security

Long, complex, unique passwords:

  • Increase the number of possible guesses.

  • Make brute-force attacks more expensive.

  • Reduce the chance of successful dictionary attacks.

  • Make password reuse less practical.

Better Usability

Short or simple passwords:

  • Are easier to remember.

  • Are faster to type.

  • Reduce the chance that users forget their credentials.

  • May encourage people to continue using the service.

The problem is that making passwords too difficult can cause users to:

  • Reuse the same password across many accounts.

  • Write passwords on paper or sticky notes.

  • Save them in unprotected text files or spreadsheets.

  • Choose predictable variations of an old password.

  • Abandon the service because access becomes frustrating.

The goal is not maximum theoretical complexity at any cost. The goal is a practical balance in which the account is difficult to attack but still usable.


Password Recommendations

The National Institute of Standards and Technology (NIST) provides widely used recommendations for password systems.

Minimum and Maximum Length

A system should require memorized secrets to be at least eight characters long. More importantly, websites and applications should permit passwords of at least 646464 characters.

Long passwords do not necessarily need complicated punctuation if they are sufficiently unpredictable. A memorable sentence or phrase may be easier for a person to remember while still being difficult to guess.

For example, a long, unusual phrase is generally preferable to a short password forced to contain one uppercase letter, one number, and one punctuation symbol.

Systems should support:

  • Long passwords.

  • Spaces.

  • All printable ASCII characters.

  • Unicode characters, including accented characters and symbols.

Restricting users to only a small set of punctuation marks creates unnecessary friction and may reduce usability without providing a proportional security benefit.

Blocking Common and Compromised Passwords

A verifier—the website or application checking the password—should compare new passwords against a list of values that are:

  • Commonly used.

  • Easily guessed.

  • Expected in the context of the service.

  • Found in previous data breaches.

  • Present in publicly available password collections.

A password appearing in a previous breach should not be considered safe merely because it is long or contains symbols. Attackers often begin with lists of breached passwords before attempting a full brute-force search.

Passwords to Avoid

Systems should reject or discourage:

  • Dictionary words.

  • Common passwords.

  • Repetitive characters, such as aaaaaa.

  • Sequential patterns, such as 123456.

  • Simple combinations, such as 1234abcd.

  • Repeated digits, such as 0000.

  • The name of the service.

  • The username or email address.

  • Variations of the service name.

  • Personal information that can be found online.

A password such as “Gmail password” or “Amazon password” is especially weak because it is context-specific and easy for an attacker to prioritize.

Password Hints and Security Questions

Websites should not allow unauthenticated people to view password hints. They also should not require users to answer predictable personal questions such as:

  • The name of a first pet.

  • The name of a first car.

  • A parent’s name.

  • A birthplace.

  • A favorite song.

These answers are often discoverable through social media, public profiles, conversations, or online searches. A hint such as “the name of my first pet” may reveal exactly how to recover the password.

Avoiding Arbitrary Periodic Password Changes

Modern guidance generally discourages forcing users to change passwords on a fixed schedule unless there is evidence that the password has been compromised.

Frequent mandatory changes can cause users to:

  • Forget the newest password.

  • Confuse old and new passwords.

  • Make only trivial changes.

  • Use predictable sequences such as password1, password2, and password3.

  • Write passwords down or reuse them elsewhere.

If an attacker discovers a previous password, predictable periodic changes may help the attacker guess the current one.

Passwords should generally be changed when:

  • They may have been exposed.

  • The service has experienced a breach.

  • The user suspects unauthorized access.

  • The password has been reused or was weak.

  • The account recovery process indicates a problem.

Rate Limiting Failed Attempts

A system should implement rate limiting, which limits how many failed authentication attempts can occur within a period of time.

Possible responses include:

  • Temporarily locking the account.

  • Increasing the delay after each failed attempt.

  • Requiring additional verification.

  • Sending an alert to the account owner.

  • Wiping a device after a configured number of failures.

For example, a phone may delay access after several incorrect passcodes and increase the delay after additional failures.

Rate limiting does not reduce the number of possible passwords, but it reduces the number of guesses an attacker can make per unit of time. It therefore increases the cost and risk of brute-force attacks.


Multifactor Authentication

Multifactor authentication (MFA) requires two or more different types of authentication factors. Two passwords do not normally count as two different factors because both are knowledge factors.

The three main categories are:

Knowledge Factors

A knowledge factor is something the user knows.

Examples include:

  • A password.

  • A passcode.

  • A PIN.

  • A memorized answer.

Possession Factors

A possession factor is something the user physically has.

Examples include:

  • A mobile phone.

  • A hardware security key.

  • A changing code generator.

  • A key fob.

  • A device receiving an authentication notification.

A possession factor narrows the likely source of the threat. A password can potentially be guessed by anyone on the internet, whereas a physical device must generally be obtained or controlled by the attacker.

Inherence Factors

An inherence factor is something inherent to the user, usually a biometric characteristic.

Examples include:

  • A fingerprint.

  • Facial characteristics.

  • Other physical traits used for biometric recognition.

Biometrics can be convenient, but they should be considered carefully. Unlike a password, a fingerprint or face cannot easily be replaced if biometric data is copied or compromised.

Two-Step Versus Two-Factor Authentication

“Two-step authentication” may sometimes mean two separate steps that are not fundamentally different factors. For example, entering two passwords is still based only on knowledge.

More technically, two-factor authentication requires factors from different categories, such as:

  • A password plus a phone-generated code.

  • A password plus a hardware security key.

  • A password plus a fingerprint.


One-Time Passwords

A one-time password (OTP) is a temporary authentication code intended for a single use or a short period.

OTPs may be:

  • Sent by SMS.

  • Displayed in an authenticator application.

  • Delivered by push notification.

  • Generated by a hardware key fob.

  • Produced by a device synchronized with a server.

A hardware token may display a code that changes every few seconds. The server independently knows what code should currently be valid. If the submitted code matches, the system treats possession of the device as evidence that the user is legitimate.

Some devices can authenticate directly through USB or another connection, reducing the need for a person to manually type the code.


Comparing OTP Delivery Methods

SMS-Based Codes

SMS is convenient but has important weaknesses.

A mobile phone uses a SIM card or embedded SIM with a unique identifier associated with the user’s phone number. An attacker may carry out a SIM-swapping attack by convincing a mobile carrier to associate the victim’s phone number with the attacker’s SIM.

If the swap succeeds:

  • The victim’s text messages may be sent to the attacker.

  • SMS-based one-time passwords may be exposed.

  • The attacker may use the code to bypass password-based authentication.

This attack may rely on personal information gathered from public sources or social engineering directed at the mobile carrier.

Authenticator Applications and Hardware Tokens

An authenticator application or hardware security key is generally preferable to SMS when available because it does not depend on the cellular carrier transferring text messages to the correct SIM.

These methods may:

  • Generate codes locally.

  • Communicate through an encrypted data connection.

  • Use push notifications.

  • Require physical possession of a device or security key.

When choosing between SMS and a dedicated authenticator application or hardware token, the dedicated application or token is generally the stronger option.


Malware and Keylogging

Malware is malicious software that can perform unauthorized actions on a computer or phone.

Malware may be installed when a user:

  • Downloads untrusted software.

  • Opens a malicious attachment.

  • Visits a compromised website.

  • Uses an infected device.

  • Fails to update or protect the operating system.

A keylogger is malware that records what a user types or taps. It may send the captured information to a server controlled by the attacker.

A keylogger can capture:

  • Usernames.

  • Passwords.

  • Credit card numbers.

  • Private messages.

  • One-time authentication codes.

Even MFA may not fully protect an account if malware captures the username, password, and temporary code quickly enough. An attacker could use the stolen information from another device before the code expires.

Defense Against Keylogging

Users should be cautious about entering credentials on devices they do not control, including:

  • Public computers.

  • Internet café computers.

  • Shared laboratory computers.

  • Someone else’s computer.

  • Devices with unknown security practices.

Using a personal, updated, and well-protected device reduces the probability that credentials will be captured. Antivirus and other security tools remain important because malware can also delete data, encrypt files, send spam, or perform other harmful actions.


Credential Stuffing

A credential is information used to authenticate an account, such as a username and password.

Credential stuffing occurs when an attacker uses credentials obtained from one breach to attempt access to many other services.

The attack depends on password reuse:

  1. A website is breached.

  2. Attackers obtain usernames and passwords from that service.

  3. The attackers try the same combinations on popular websites and applications.

  4. Any account using the same credentials may be compromised.

Credential stuffing differs from:

  • Dictionary attacks, which try likely words.

  • Brute-force attacks, which try combinations systematically.

  • Credential stuffing, which uses already known username-password pairs.

The main defense is to use a unique password for every account. Reusing an email address as a username is usually unavoidable and not itself the central problem. Reusing the password is the major risk.

Password managers make unique passwords practical.


Social Engineering

Social engineering is an attack that manipulates people rather than directly exploiting a technical vulnerability.

The attacker creates a situation that causes the victim to trust the attacker or comply with a request. The victim may then voluntarily reveal sensitive information or perform a dangerous action.

Examples include:

  • Pretending to be a teacher, coworker, bank employee, or system administrator.

  • Asking a victim to write down a password.

  • Requesting the answer to a security question.

  • Creating a false emergency to pressure the victim.

  • Using authority or familiarity to discourage questioning.

The defense is healthy skepticism. A person should consider why someone is requesting sensitive information and whether the request is appropriate.

Passwords should never be disclosed merely because the request appears to come from a trusted person.

AI-Generated Voice and Deepfakes

Modern AI systems can generate convincing audio and video resembling real people. This creates new social-engineering risks, including:

  • A fake phone call that sounds like a manager.

  • A fabricated voice message appearing to come from a family member.

  • A synthetic voice used to authenticate with a bank.

  • A deepfake video used to create credibility.

Voice recognition should generally be disabled when a stronger alternative, such as an authenticator application or push notification, is available. A recorded voice may be copied and synthesized, making “my voice is my password” a weak security model.


Phishing

Phishing is a form of social engineering that uses fraudulent electronic messages or websites to trick people into revealing information or taking an unsafe action.

Phishing commonly appears through:

  • Email.

  • Text messages.

  • Social media posts.

  • Fake login pages.

  • Fraudulent password-reset requests.

  • Fake donation or account-verification links.

A phishing message may impersonate:

  • A bank.

  • A payment service.

  • Google or another technology company.

  • A school or employer.

  • A government official.

  • A person the victim knows.

The attacker exploits:

  • Trust in a familiar organization.

  • Familiar visual designs and interfaces.

  • Urgency or fear.

  • The assumption that a link’s visible text matches its actual destination.

A fraudulent website can be made to look nearly identical to a legitimate one through copying and modifying an existing site.

Defenses Against Phishing

Users should:

  • Inspect the browser’s address bar.

  • Check the actual domain name carefully.

  • Be alert to misspellings and unusual domain extensions.

  • Hover over links to preview their destinations.

  • Avoid entering credentials after following an unexpected link.

  • Open a new browser tab and manually type the known official address.

  • Treat urgent requests for passwords, codes, payments, or personal information with suspicion.

For sensitive services, manually navigating to the official website is safer than blindly trusting a link in an email or message.

Phishing Against MFA

Sophisticated phishing sites may request not only a username and password but also an MFA code.

A real-time attack may proceed as follows:

  1. The victim enters a username and password into a fraudulent login page.

  2. The fake site immediately sends those credentials to the real service.

  3. The real service requests an MFA code.

  4. The fake site asks the victim for the same code.

  5. The attacker submits the code to the real service.

  6. The attacker gains access before the code expires.

MFA remains valuable, but users should still verify the website and the context of every authentication request.


Machine-in-the-Middle Attacks

When a device communicates with an online service, data may pass through many intermediate machines, including:

  • Home routers.

  • Internet service provider equipment.

  • University or workplace networks.

  • Servers and routing infrastructure.

  • Other network devices.

A machine-in-the-middle attack occurs when an intermediary observes, alters, or interferes with communications between the user and the intended service.

The apparent connection may feel like a direct exchange between a person and a website, but other systems may be involved in transporting the data.

Cryptography and encryption help protect communications by making intercepted data difficult to understand or modify. Secure communication practices are therefore important even when the user believes the only participants are the user and the website.


Single Sign-On

Single sign-on (SSO) allows a user to access one service through an account already held with another service.

A website may offer options such as:

  • Registering with a new email address and password.

  • Logging in with Google.

  • Logging in with Facebook.

  • Using another established identity provider.

Benefits of SSO

SSO can:

  • Reduce the number of passwords a user must remember.

  • Reduce password reuse.

  • Make registration faster.

  • Lower friction for users.

  • Allow the new service to benefit from security practices applied to the existing account.

  • Centralize important authentication protections such as MFA.

The user should protect the identity-provider account especially well because it may provide access to many connected services.

How SSO Works

When a user selects “Log in with Google” or a similar option:

  1. The browser redirects to the identity provider’s genuine website.

  2. The user enters credentials directly into that provider’s page.

  3. The identity provider authenticates the user.

  4. The provider sends the third-party service a confirmation of identity.

  5. The user’s password is not given to the third-party service.

Cryptographic techniques help establish trust between the identity provider and the third-party application. The third-party site receives confirmation that the user authenticated successfully, rather than receiving the user’s password.


Password Managers

A password manager is software that stores, generates, and fills in account credentials.

Password managers address several common problems:

  • Forgetting many different passwords.

  • Reusing the same password.

  • Choosing short or predictable passwords.

  • Writing passwords on paper.

  • Storing passwords in unprotected files.

  • Creating passwords that are difficult to type manually.

Key Features

A password manager can:

  • Generate random passwords.

  • Create passwords of a chosen length.

  • Include letters, digits, and symbols as required.

  • Store a different password for every website.

  • Fill in usernames and passwords automatically.

  • Synchronize credentials across approved devices.

  • Share selected credentials in controlled family or organizational settings.

  • Remember the legitimate URL associated with a credential.

Protection Against Phishing

A password manager may recognize the website address where a credential was created or previously used. If a user visits a fraudulent site that looks like a legitimate service but has a different URL, the manager may refuse to autofill the credentials.

This behavior provides an important phishing defense because it does not rely entirely on the user noticing subtle visual differences.

The Master Password

The password manager itself is protected by a primary or master password.

This password is especially important because the manager may contain credentials for dozens or thousands of accounts. It should be:

  • Long.

  • Difficult to guess.

  • Unique.

  • Carefully protected.

  • Memorable enough that the user will not lose it.

The password manager concentrates many credentials in one place. If an attacker obtains the master password, the attacker may gain access to the stored accounts.

Password Managers Built into Devices

Password-management features are increasingly included in operating systems and major platforms, such as:

  • Apple iCloud Keychain.

  • Google Password Manager.

  • Microsoft credential-management tools.

Browser-based saving may be limited to one browser or device, while a dedicated platform password manager may offer broader synchronization, generation, phishing protection, and controlled sharing.

Evaluating the Trade-Off

A password manager is usually a major improvement for someone who:

  • Reuses passwords.

  • Uses weak passwords.

  • Has difficulty remembering credentials.

  • Stores passwords insecurely.

  • Needs many unique passwords.

For someone who already uses strong, unique, securely stored passwords, centralizing all credentials in one manager introduces a different risk. The choice should be based on the user’s existing practices and the protections offered by the manager.

A practical migration strategy is to begin with the most important accounts, such as:

  • Banking and financial services.

  • Medical accounts.

  • Email.

  • Cloud storage.

  • Accounts containing sensitive family or personal information.

The remaining accounts can be migrated gradually.


Passkeys

Passkeys are an increasingly available alternative to traditional passwords.

Instead of requiring the user to invent and remember a password, a device such as a phone, computer, or tablet generates a mathematically related pair of values:

  • A private value, kept secret by the user’s device.

  • A public value, provided to the service.

The private value is not shared with the website. The public and private values work together through cryptographic operations to authenticate the user.

Advantages of Passkeys

Passkeys can:

  • Eliminate the need to memorize individual passwords.

  • Reduce password reuse.

  • Resist many forms of phishing.

  • Use a phone’s fingerprint or facial recognition to unlock the credential.

  • Synchronize securely across approved devices.

  • Avoid sending the actual secret to the website.

The user may authenticate with a biometric feature or device unlock mechanism, while the underlying cryptographic credential remains protected by the device.

Understanding passkeys in greater depth requires knowledge of cryptography and public-key techniques.

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent