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 Digital Accounts

Modern life depends on digital accounts for communication, banking, education, shopping, health care, and entertainment. Each account is a potential target because access to it may reveal private information or allow someone else to act on the account holder’s behalf.

Account security is therefore a balance between two goals:

  • Security: Preventing unauthorized people from gaining access.
  • Usability: Making it practical for legitimate users to access their accounts.

A system that is extremely secure but impossible to use will frustrate legitimate users. A system that is convenient but easy to break will expose users to unnecessary danger. Good cybersecurity tries to raise the difficulty for attackers without making normal use unreasonable.

Authentication and Authorization

A useful starting point is the distinction between authentication and authorization.

Authentication is the process of proving an identity.
Authorization is the process of deciding what an authenticated identity is allowed to access.

A physical key illustrates the difference. If a person uses a key to open a building, the key authenticates that person—or, more precisely, suggests that the person possesses the correct key. But authentication alone does not answer whether that person should be allowed into every room. Authorization determines whether the person may enter the lobby, an office, a laboratory, or the entire building.

The same distinction applies digitally. A website may first determine that a person is associated with a particular username. It must then determine what that account is allowed to do. An ordinary user might be authorized to read personal messages but not to change another user’s account or access the website’s administrative controls.

Usernames and Passwords

A username identifies an account. It might be a short name, a full name, or an email address. Usernames are often public or relatively easy to discover.

A password, by contrast, is intended to remain secret. The traditional assumption is that the legitimate account holder knows both the username and the password, while an attacker does not. If the correct pair is entered, the system assumes that the person entering them is the account holder.

This assumption is imperfect. Passwords can be guessed, stolen, exposed through deception, captured by malicious software, or reused across multiple services. Password security therefore depends not only on keeping a password private but also on choosing passwords that are difficult to guess and using additional defenses.

Authentication based on a password works only as well as the secrecy and strength of that password.

Password-Guessing Attacks

Dictionary Attacks

A dictionary attack uses a prepared list of likely words and passwords. Instead of trying random combinations immediately, an attacker begins with words found in dictionaries and lists of common passwords.

For example, an attacker might try:

  • Common English words
  • Common words in other languages
  • Names
  • Popular passwords
  • Words associated with the target
  • Passwords exposed in previous data breaches

A password that is an ordinary word is vulnerable because the attacker does not need to test every possible combination. The attacker can prioritize a much smaller set of highly probable choices.

A password such as “ocean” may feel private to the account holder, but it is still a dictionary word. The important issue is not whether the person personally thought of it, but whether an attacker’s software is likely to try it early.

Brute-Force Attacks

A brute-force attack systematically tries every possible password within a chosen character set and length. It does not rely on guessing what the user is likely to choose. Instead, it eventually tests every combination.

The number of possible passwords can be calculated using the multiplication principle. If each position has nnn possible characters and the password has LLL positions, then the total number of possible passwords is:

nLn^LnL

The exponent represents the number of positions, while the base represents the number of choices for each position.

Four-Digit Passcodes

A four-digit passcode allows each position to contain one of the ten decimal digits, from 000 through 999. Therefore, the number of possibilities is:

104=10×10×10×10=10,00010^4 = 10 \times 10 \times 10 \times 10 = 10{,}000104=10×10×10×10=10,000

The range begins with 000000000000 and ends with 999999999999. Although the numerical difference between those values is 9,9999{,}9999,999, the starting value counts as an additional possibility, producing 10,00010{,}00010,000 total combinations.

A brute-force program can test these combinations extremely quickly, especially if it communicates directly with a device or account. In the simplest demonstration, all 10,00010{,}00010,000 possibilities may be generated in less than a second. A four-digit passcode is therefore a relatively low barrier against a technically capable attacker.

Four Letters

Suppose each position may contain an uppercase or lowercase English letter. There are 262626 lowercase letters and 262626 uppercase letters, for a total of 525252 possibilities per position.

A four-letter password then has:

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

This is much larger than 10,00010{,}00010,000, so it takes longer to search. However, millions of possibilities may still be manageable for modern hardware. A four-letter password, even with uppercase and lowercase letters, may still be too short to provide strong protection.

Four Characters from a Larger Set

A character set containing lowercase letters, uppercase letters, digits, and punctuation can contain approximately 949494 printable characters on a typical United States keyboard:

  • 262626 lowercase letters
  • 262626 uppercase letters
  • 101010 digits
  • 323232 punctuation symbols

A four-character password using this entire set has:

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

This is approximately ten times larger than the four-letter space, so a brute-force search takes approximately ten times as much work, assuming all characters are equally likely.

However, even about 787878 million possibilities may be searched quickly by sufficiently capable hardware. Increasing the character set helps, but password length has an especially powerful effect because it changes the exponent.

Eight Characters

An eight-character password using the same 949494-character set has:

948=6,095,689,385,574,97694^8 = 6{,}095{,}689{,}385{,}574{,}976948=6,095,689,385,574,976

This is approximately 666 quadrillion possibilities. The increase is dramatic because the character set is used eight times rather than four times.

The important principle is that security depends on both:

  1. The size of the character set
  2. The length of the password

Adding digits, uppercase letters, lowercase letters, and punctuation increases the base of the calculation. Adding more characters increases the exponent. A longer password can therefore increase the search space enormously.

Randomness Matters

A large theoretical search space does not automatically guarantee security. A user could choose an eight-character password such as a repetitive or predictable pattern. If the password is 00000000, an attacker will probably try it very early rather than treating it as one random possibility among quadrillions.

The strongest benefit occurs when the password is both:

  • Long enough to create a large search space
  • Unpredictable enough that the attacker cannot prioritize it

An attacker’s practical task is to find the password before the account holder changes it, stops using the account, or otherwise removes its value. Password security is therefore a contest involving time, computing resources, money, and attacker motivation.

The Usability–Security Trade-Off

Long, complicated passwords are usually harder to remember and type. If a system requires frequent complex passwords, users may respond in unsafe ways:

  • Reusing one password across services
  • Writing passwords on sticky notes
  • Saving them in unprotected files
  • Making small predictable changes
  • Choosing short passwords to avoid inconvenience

A theoretically strong rule can therefore produce weaker real-world behavior if it is too difficult to follow. The best security design considers human behavior rather than assuming that users will remember hundreds of complex secrets perfectly.

Think About It

A student comparing a four-digit passcode with a long passphrase should ask: does the second option increase security because it uses more kinds of characters, because it is longer, because it is less predictable, or because of all three?

Password Recommendations

Modern password guidance emphasizes length, freedom of choice, and resistance to common guesses.

Minimum Length

A memorized password should be at least eight characters long. Four-digit codes are convenient, but they create a relatively small search space. Increasing the minimum length makes brute-force attacks more expensive.

A website or application should ideally allow passwords much longer than eight characters—at least as long as 646464 characters. A long phrase can be easier for a human to remember than a short collection of random symbols.

For example, a phrase made from several unrelated words may be easier to recall than a short password containing arbitrary punctuation. The phrase must still avoid obvious quotations, common expressions, and information connected to the account holder.

Acceptable Characters

A system should permit all printable ASCII characters, spaces, and Unicode characters. ASCII includes familiar English letters, digits, and punctuation. Unicode includes characters from many languages, accented letters, symbols, and emoji.

Restricting users to a small set of symbols can reduce usability. Requiring a particular number of uppercase letters, lowercase letters, digits, and approved punctuation may make passwords harder to remember without necessarily making them much harder for attackers to guess.

A better design generally allows long passwords and passphrases rather than forcing users to satisfy a complicated collection of arbitrary rules.

Block Common and Compromised Passwords

A website should compare a new password against a list of passwords known to be weak, common, expected, or compromised. The password should be rejected if it appears on such a list.

The list should include passwords from previous data breaches. When a website is hacked, usernames and passwords may be published or circulated among attackers. Those exposed passwords become an especially valuable guessing list. An attacker can try them before beginning a full brute-force search.

A password should also be rejected if it contains:

  • Dictionary words
  • Repetitive characters, such as aaaaaa
  • Sequential patterns, such as 123456
  • Obvious digit patterns, such as 0000
  • The name of the service
  • The username or email address
  • Simple variations of account-specific terms

A password such as “GmailPassword” is weak for a Gmail account because the service name and the word “password” are obvious clues. An attacker who knows the account’s service can prioritize those guesses.

Avoid Password Hints and Security Questions

A system should not allow an unauthenticated person to view a password hint. It should also avoid asking users to choose answers to predictable 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 not secret. Social media, public records, family members, and casual conversation may reveal them. A security question may therefore become an alternative password that an attacker can discover.

A hint can also leak too much information. A hint such as “the name of a first pet” tells an attacker exactly what kind of personal information to investigate.

Do Not Require Arbitrary Periodic Changes

A system should generally avoid requiring users to change passwords on an arbitrary schedule, such as every month or every three months, unless there is a specific reason to believe a password has been compromised.

Frequent forced changes can encourage predictable behavior. A user whose password is password1 may change it to password2, then password3. If an attacker knows the earlier password, the next one becomes easier to predict.

Frequent changes also increase the chance that users will forget passwords, write them down, reuse them, or choose weaker replacements. A stronger policy is to require a change when there is evidence of compromise or when the user has chosen a password on a known-compromised list.

Rate Limiting

A rate-limiting mechanism restricts how quickly failed login attempts can occur. After too many incorrect attempts, a system may:

  • Temporarily lock the account
  • Require a longer waiting period
  • Require additional verification
  • Notify the account holder
  • Erase the device after a configured threshold

For example, a phone may impose a delay after several failed passcode attempts. Further failures may produce increasingly long delays or trigger a device wipe.

Rate limiting does not reduce the number of possible passwords. Instead, it makes each guess more expensive in time. A brute-force program that can test 10,00010{,}00010,000 combinations in less than a second becomes far less effective if the device permits only a small number of attempts before imposing delays.

Rate limiting also creates a usability trade-off. A legitimate user can be locked out after mistyping a password repeatedly. Nevertheless, the delay helps distinguish ordinary use from an attacker trying thousands of guesses.

Multifactor Authentication

A password is only one kind of authentication factor. Multifactor authentication, often called two-factor authentication when two factors are used, requires two or more fundamentally different categories of evidence.

The three major categories are:

  1. Knowledge: Something the person knows
  2. Possession: Something the person has
  3. Inherence: Something the person is

Knowledge Factors

A password or passcode is a knowledge factor. The assumption is that the legitimate user knows the secret and an attacker does not.

Two passwords are still generally the same type of factor. Requiring two knowledge factors is not as strong as combining different categories, because one attack may reveal both secrets or because the user may store both in the same insecure place.

Possession Factors

A possession factor is something the user physically has. Examples include:

  • A hardware security key
  • A changing-code key fob
  • A mobile phone
  • An authentication application

The security benefit comes from narrowing the group of possible attackers. Anyone on the internet might attempt to discover a password, but a possession factor requires the attacker to obtain the physical device or access it remotely.

Inherence Factors

An inherence factor is something inherent to the person. Common examples include:

  • A fingerprint
  • A face
  • Other biometric characteristics

Biometrics can be convenient because the user does not need to remember or type a secret. However, biometric information is not exactly like a password. A password can be changed after exposure; a fingerprint or face cannot easily be replaced. Biometric systems should therefore be used thoughtfully and protected by appropriate device security.

Two-Step Versus Two-Factor Authentication

The term “two-step authentication” may describe any process involving two steps. Those steps might both use passwords or other evidence from the same category.

The term two-factor authentication more precisely means that the system uses two different factor categories, such as:

  • A password, which is knowledge
  • A phone or security key, which is possession

Using different factor types makes it harder for one compromise to defeat the entire login process.

One-Time Passwords

A one-time password, or OTP, is a temporary code intended for a single login attempt or a short period of time. It is not a permanent password that the user memorizes and repeatedly reuses.

An OTP may be:

  • Sent by text message
  • Displayed in an authenticator application
  • Delivered through a push notification
  • Shown on a hardware token
  • Generated automatically by a synchronized device

A hardware token may display a changing code every few seconds. The token and the authentication server share a method for generating or validating the current code. If the code entered by the user matches the expected code, the system gains evidence that the person possesses the token.

SMS-Based Authentication

Text-message authentication is more secure than using only a password, but it has weaknesses. A mobile phone number is associated with a SIM card or an embedded SIM. An attacker may attempt a SIM-swap attack, in which the mobile carrier is tricked into transferring the victim’s phone number to the attacker’s SIM.

If that succeeds, text messages containing login codes go to the attacker. The attacker may then use a stolen password and the intercepted code to enter the account.

When possible, an authenticator application, push notification, or hardware security key is generally preferable to SMS because it does not depend on the mobile phone number being transferred to the correct SIM.

Malware and Keylogging

Malware is malicious software. It may arrive through an untrusted application, an infected file, a virus, a worm, or another compromise.

One type of malware performs keylogging. A keylogger records what a person types, and sometimes what the person taps or enters through other input methods. The recorded information may be sent to a server controlled by an attacker.

A keylogger can capture:

  • Usernames
  • Passwords
  • Personal messages
  • Payment information
  • One-time authentication codes

Multifactor authentication still provides protection in many situations, but a sufficiently capable attacker may capture a password and a temporary code quickly enough to use them. This is a more advanced attack, but it demonstrates that no single defense is perfect.

A practical defense is to avoid entering sensitive credentials on shared or untrusted devices, such as:

  • Public computers
  • Internet café computers
  • Shared laboratory computers
  • Uncontrolled workplace devices
  • Another person’s computer

Using a personal device does not guarantee safety, but it gives the user more control over updates, installed software, antivirus protection, and device settings. Antivirus and anti-malware tools remain important because malware can steal data, delete files, encrypt files, send spam, and perform other harmful actions.

Think About It

A student using a password manager and multifactor authentication should still ask whether the device itself is trustworthy. Security measures protect accounts only if the device used to enter the credentials has not already been compromised.

Credential Stuffing

A credential is information used to authenticate an account, such as a username and password. Credential stuffing occurs when an attacker takes a known username-and-password pair from one service and tries it on other services.

The attack depends on password reuse. For example, if a person uses the same password for a shopping site, an email account, and a financial service, a breach of the shopping site may expose all three accounts.

Credential stuffing is different from brute force:

  • Brute force generates and tries possible passwords.
  • Dictionary attacks try likely words and common patterns.
  • Credential stuffing tries real credentials that were already obtained elsewhere.

The strongest defense is to use a different password for every website and application. Reusing a username or email address is often unavoidable and is less dangerous because usernames are frequently public. Reusing passwords is the critical problem.

Social Engineering

Social engineering is the manipulation of people rather than the direct defeat of technical systems. The attacker creates a situation that encourages a person to reveal information or perform an unsafe action.

For example, a person may ask for a password while appearing to be a trusted instructor, coworker, technician, or administrator. The target may comply because the request seems legitimate. The attacker succeeds by exploiting trust and authority.

Social engineering can involve:

  • Requests for passwords
  • Requests for security-question answers
  • Pretending to provide technical support
  • Urgent claims that an account will be closed
  • Requests to reveal personal information
  • Instructions to transfer money or open a file

A healthy skepticism is an important defense. The target should consider why the information is being requested, whether the request is expected, and whether it can be verified through an independent channel.

Personal information should also be treated carefully. Social media and professional websites may reveal names, pets, workplaces, family details, favorite songs, and other facts that attackers can use to answer security questions or make a deception more convincing.

Phishing

Phishing is a form of social engineering that commonly uses email, text messages, websites, or social media. The attacker attempts to imitate a trusted person or service and persuade the target to provide information or click a dangerous link.

A phishing message may pretend to come from:

  • A bank
  • An email provider
  • A payment service
  • A school
  • A government organization
  • A supervisor
  • A friend or family member

The message may claim that an account has a problem and ask the target to verify a password, make a payment, or confirm personal information.

Recognizing Phishing

A phishing page may look identical to a legitimate login page. Visual appearance is therefore not enough. A user should inspect the website address and determine whether it is the genuine domain.

Useful precautions include:

  • Inspecting the URL in the browser’s address bar
  • Hovering over links to reveal their destination
  • Looking for misspelled or misleading domains
  • Avoiding login links received unexpectedly
  • Opening a new browser tab
  • Manually typing the known official address
  • Contacting the organization through a trusted method

For example, rather than clicking a suspicious link claiming to lead to a payment service, the user can manually enter the service’s known web address into the browser.

This adds inconvenience, but the inconvenience is a reasonable cost when protecting financial, medical, educational, or personal information.

Phishing Multifactor Codes

A sophisticated phishing site may request not only a username and password but also a multifactor code. The attacker can relay the information to the genuine website in real time.

This illustrates a broader principle: a familiar screen is not proof that the screen is legitimate. Users should evaluate the destination and the context of a request instead of blindly entering credentials whenever a login form appears.

Social Media as a Source of Information

A social media post asking people to share a favorite childhood song may appear harmless. However, some participants may have used that song as the answer to a security question. The post can therefore collect answers that attackers may later use.

The general lesson is that seemingly casual personal information can have security consequences.

Machine-in-the-Middle Attacks

Internet communication usually passes through many devices between the user and the destination service. These may include routers, servers, internet service provider equipment, university systems, and home networking equipment.

A machine-in-the-middle attack occurs when an intermediary observes, stores, alters, or interferes with communication between two endpoints.

The user may feel connected directly to a service such as an online store or messaging application, but the data may travel through numerous other machines. Secure communication protocols, cryptography, and encryption help prevent intermediaries from reading or modifying sensitive information.

The key idea is that network communication involves more than the visible endpoints. Security depends on protecting the data while it travels through the systems in between.

Single Sign-On

Single sign-on, or SSO, allows a person to use an existing account from one service to access another service. A new website might offer options such as signing in with an established account from a major identity provider.

SSO can improve both usability and security:

  • The user does not need to create another password.
  • The user avoids reusing a password across many sites.
  • The identity provider may already use strong security controls.
  • Multifactor authentication on the primary account may protect connected services.
  • The new service does not need to manage another password directly.

How SSO Works

When a person chooses to sign in through an identity provider, the browser should be redirected to the genuine identity provider’s website. The user enters the identity provider’s credentials there, not on the new third-party website.

The identity provider then sends the third-party service a confirmation that authentication succeeded. Through cryptographic methods, the third-party service can receive identity information or an authentication assertion without receiving the user’s password.

This separation is important. The third-party website learns that the identity provider authenticated the person, but it does not need to know the password used for the identity-provider account.

The primary account must therefore be protected especially well. If the identity-provider account is compromised, connected services may also be affected.

Password Managers

A password manager is software that stores, generates, and fills passwords.

Password managers address several common problems at once:

  • They generate long, random passwords.
  • They store a different password for every service.
  • They eliminate the need to memorize dozens or hundreds of passwords.
  • They reduce the temptation to write passwords on paper or in unprotected files.
  • They can automatically fill credentials on recognized websites.
  • They can synchronize credentials across approved devices.

Protection Against Credential Stuffing

A password manager makes unique passwords practical. Instead of trying to remember a separate random password for every account, the user remembers one primary password and allows the manager to handle the rest.

If one service is breached, the exposed password will not work on other services because each account has its own credential.

Protection Against Phishing

Password managers often associate saved credentials with the legitimate website address where they were created. If a user visits a fake page that resembles a real service but has a different address, the manager may refuse to fill in the password.

This does not make phishing impossible, but it removes some opportunities for a user to accidentally type credentials into a fraudulent page.

The Primary Password

The password manager itself becomes a highly valuable target because it contains many other credentials. Its primary password should therefore be:

  • Long
  • Difficult to guess
  • Unique
  • Carefully protected
  • Supported by multifactor authentication when available

A password manager concentrates many secrets in one place. This is a genuine risk, but for many users it is safer than reusing weak passwords, storing passwords in an unprotected file, or writing them on visible notes.

The decision depends on the alternative. A password manager is usually a net improvement for someone who currently reuses passwords or chooses easily guessed passwords. Someone who already maintains unique, strong, securely stored passwords may face a different balance of benefits and risks.

Browser Password Storage

Browsers can remember usernames and passwords, but a dedicated password manager may offer additional features, including:

  • Better synchronization across devices
  • Password generation
  • Shared access for appropriate family or organizational accounts
  • More deliberate security controls
  • Stronger protection against filling credentials on the wrong website

Built-in managers provided by major operating systems and device manufacturers can be reasonable choices, especially when they synchronize securely across the user’s devices. Third-party managers may offer additional organizational or sharing features.

Passkeys

A passkey is a newer authentication method based on public-key cryptography. Instead of requiring the user to create and remember a conventional password, the device generates a mathematically related pair:

  • A private key, kept secret by the device
  • A public key, shared with the service

The private key is used to prove possession of the passkey, while the public key allows the service to verify that proof. The private key does not need to be sent to the website.

A phone, computer, or other device may unlock the passkey using a fingerprint, face recognition, or a local device code. In this arrangement, the biometric or device code protects access to the private key rather than being sent directly to the website as the main secret.

Passkeys can be synchronized across approved devices, allowing a person to authenticate from a phone, laptop, or desktop without memorizing a separate password. They also reduce risks associated with password reuse, password databases, and some phishing attacks because there is no ordinary password for a fake website to collect.

Understanding the underlying cryptography explains more precisely why public and private keys can authenticate a user without exposing the private key.

Comprehensive Review

Account security begins with distinguishing authentication from authorization: authentication establishes who someone is, while authorization determines what that identity may access.

Passwords remain common, but their strength depends on length, unpredictability, and secrecy. Dictionary attacks exploit likely words and patterns, while brute-force attacks systematically search possible combinations. The number of combinations follows:

nLn^LnL

where nnn is the number of available characters and LLL is the password length. Increasing length often produces a dramatic increase in the search space.

Strong account practices include:

  • Using long, unique passwords
  • Avoiding dictionary words and predictable patterns
  • Rejecting passwords found in breach lists
  • Avoiding password hints and predictable security questions
  • Avoiding arbitrary forced password changes
  • Enabling rate limiting
  • Using multifactor authentication
  • Preferring authenticator applications or security keys over SMS when possible
  • Avoiding sensitive logins on untrusted devices
  • Using different passwords for different services
  • Treating unexpected requests and links with skepticism
  • Checking URLs before entering credentials
  • Using single sign-on carefully
  • Using a password manager when it improves the user’s overall security
  • Considering passkeys as they become available

The central lesson is that no defense is perfect. Good cybersecurity combines multiple layers—strong authentication, careful account management, trustworthy devices, skepticism toward social manipulation, secure communication, and sensible attention to usability.

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent