What’s the difference between authentication and authorization?
Authentication proves who you are (e.g., username + password). Authorization determines what that authenticated user is allowed to access or do once identified.
Video Summary
Passwords are the core of authentication but must be long and complex to resist brute force and dictionary attacks.
Use unique credentials per site to prevent credential stuffing after breaches.
Enable two-factor authentication (prefer app-based OTPs or hardware) to add a second, different factor.
Password managers generate, store, and auto-fill strong unique passwords; protect them with a strong master password.
Phishing and social engineering exploit trust—verify URLs and avoid clicking unsolicited links or entering credentials on unknown pages.
Authentication proves who you are (e.g., username + password). Authorization determines what that authenticated user is allowed to access or do once identified.
A four-digit PIN has only 10,000 combinations, so brute-force software can try every possibility quickly — the lecture demonstrates such a PIN can be cracked in seconds.
Credential stuffing uses lists of stolen username/password pairs from one breach to try logging into other sites. It succeeds when users reuse the same credentials across services.
Password managers generate and store unique, strong passwords per site, autofill only on recognized URLs (reducing phishing risk), and sync across devices. The caveat is protecting the manager with a strong master password and guarding against losing access to it.
Passkeys are device-generated public/private key pairs: the device stores a private key and the service stores a public key. They authenticate you automatically (often via biometrics) and remove the need to memorize passwords.
“This week, let's focus on securing accounts.”
David Malan introduces the CS50 lecture on cybersecurity, emphasizing the significance of securing accounts in a world filled with numerous online platforms.
He mentions that the lecture will cover the various threats to personal accounts and the defenses available to protect them.
“If someone else gets that key, of course, they too can let themselves into that system.”
Malan compares physical security, represented by a key to a locked door, to digital security measures that protect our online accounts.
He explains that just as physical access can lead to intrusion, in the digital realm, unauthorized access can occur if proper precautions are not taken.
“Authentication refers to this process, digitally, of proving who you are.”
The concept of authentication is introduced as the method of verifying an individual's identity online, such as using a username and password.
Malan elaborates on authorization, which determines what a verified user can access once their identity is confirmed, stressing its importance for account security.
“The thing that you and I ideally keep private is, of course, our password.”
The discussion highlights the role of passwords in digital security, designed to be a secret component alongside public usernames.
Malan points out the necessity of having unique passwords for different accounts to minimize vulnerability to attacks.
“It's not good enough to just have a password; you need to have a good password.”
Malan stresses that simply having a password is insufficient; it should be complex enough to withstand various forms of cyber attacks.
He explains dictionary attacks, where hackers try common words to gain access, illustrating the need for passwords that are not easily guessable.
“Brute force attacks mean using software to digitally try all possible passwords.”
The lecture details brute force attacks, where attackers systematically check every possible password to gain access to a system.
Malan emphasizes that even complex passwords can be susceptible if they are too short, urging the need for longer and more complex password structures.
“How secure is a four-digit password?”
Malan walks the audience through calculating the security of a four-digit numeric password, illustrating that there are only 10,000 possible combinations.
He poses questions to the audience to gauge their understanding of the time it might take a hacker to guess a simple four-digit password, highlighting the necessity for stronger security measures.
"Using a four-digit password is not very secure at all because it can be cracked quickly."
The lecturer demonstrates a brute force attack by running code that attempts to crack a four-digit password by iterating through all possible combinations from 0000 to 9999.
The Python script imports digits and uses nested loops to exhaustively check each combination, showcasing how quickly an adversary can gain access to a device.
The demonstration shows that even a simple four-digit password can be compromised in a matter of seconds, emphasizing the importance of stronger security measures.
"Instead of using a four-digit passcode, let's use four letters instead."
After revealing the vulnerability of a four-digit PIN, the lecturer suggests using four letters instead, which significantly increases the number of possibilities.
He explains that using both lowercase and uppercase letters expands the options from 26 to 52 for each character, leading to a total of 7 million possible four-letter passwords.
This shift highlights the mathematical exponential growth in security when more varied characters are included but still implies that four letters might not suffice for adequate protection.
"Let's incorporate punctuation, which adds complexity and enhances security."
The lecturer further strengthens the proposed password by incorporating punctuation, resulting in 94 possible characters including both letter cases, digits, and punctuation marks.
This combination allows for a staggering 78 million total possibilities for a password, demonstrating a marked improvement over earlier estimates.
The increase in complexity illustrates the critical need for incorporating a variety of character types in password creation to mitigate potential security breaches effectively.
"Odds are, it's at least a conventional eight characters nowadays."
The discussion progresses to the necessity of longer passwords, recommending at least eight characters which is now the industry standard for security.
With 94 available characters for each position, the possible combinations rise dramatically, reaching about 6 quadrillion possibilities for eight characters.
This exponential increase underscores the ongoing challenges faced by adversaries in brute-forcing passwords, emphasizing the importance of adhering to best practices for password creation.
"It's a game of relativity and resources when it comes to cybersecurity and securing our accounts."
The duration it takes to crack a password correlates with its complexity and length. By adding more characters, such as digits, letters, and punctuation, we raise the difficulty for potential attackers.
Choosing a more complex password can significantly increase the time it would take for an adversary to brute-force attack your account, especially if it has a large number of possible combinations.
If users select a random password within a substantial range, such as 6 quadrillion possibilities, it becomes exponentially harder for attackers to gain access.
"There's a balancing act between the usability of the account and the security of that account."
While it is essential to have a complex password, an increase in complexity may lead to difficulties in remembering them, posing a usability issue.
Finding a personal or corporate balance between ease of access and security is crucial in creating effective account protections.
"Your intuition is correct; it's expensive to have another device."
Questions arise regarding the lack of widespread use of USB devices with fingerprint recognition, primarily due to their cost and practicality for most consumers.
Emerging technologies, such as passkeys that leverage existing devices like smartphones, are becoming more common and provide easier access to accounts through biometric recognition.
"Memorized secrets shall be at least eight characters in length."
The National Institute of Standards and Technology (NIST) recommends that passwords include a minimum of eight characters to enhance security, aligning with the idea that longer passwords are generally more secure.
Consumers and companies should be aware of these guidelines as they represent best practices for account security.
"Verifiers shall compare the prospective secrets against a list that contains commonly used, expected, or compromised passwords."
Websites and applications should be designed to prevent users from choosing weak passwords that are commonly used or previously compromised, significantly lowering the risk of unauthorized access.
The guide details that password creation must be cautious of dictionary words and repetitive sequences, which are easily exploitable by adversaries.
Encouraging longer, more complex passwords, while avoiding simplicity or common patterns, is increasingly vital for maintaining account security.
"If you can think of it, even if you think you're being clever, odds are a just-as-clever adversary can think of that heuristic as well."
Passwords like "1235abcd" or "Gmail password" are vulnerable to being easily guessed by adversaries who use common heuristics.
Context-specific words related to a service or personal information should be avoided when creating passwords. For example, using "Amazon password" for an Amazon account is not secure.
It’s important to recognize that if a password seems intuitive for the user, it is likely just as intuitive for a potential attacker.
"Verifiers shall not permit subscribers to store a hint that is inaccessible to an unauthenticated claimant."
Many websites violate best practices by allowing users to store hints that can reveal personal information linked to passwords.
When users provide hints that are related to their passwords, such as "the name of my first pet," it can lead to security breaches if this information is publicly available or easily guessable.
Collecting personally identifiable information should be limited because adversaries can exploit this information for unauthorized access.
"Verifiers shall not require memorized secrets to be changed arbitrarily, for instance, periodically."
Requiring users to change passwords regularly, such as every month, has been shown to be ineffective and not recommended in current best practices.
Frequent changes can lead users to create predictable passwords based on past patterns, inadvertently heightening security risks.
The difficulty of remembering multiple varying passwords can lead to users compromising their security by recycling weak passwords or choosing easily guessable alternatives.
"Verifiers shall implement a rate-limiting mechanism that effectively limits the number of failed authentication attempts."
Rate-limiting is a security mechanism that helps prevent brute-force attacks by limiting the number of incorrect login attempts a user can make within a specified time frame.
Users often experience being locked out after multiple incorrect attempts as a way to identify and thwart unauthorized access.
The goal of rate-limiting is to slow down potential attackers, thereby increasing the difficulty and cost of conducting a successful attack.
"Two-Factor Authentication, or 2FA, is a technology where, in addition to entering a password, you also use a second or different factor to log in."
Two-Factor Authentication requires users to provide an additional verification factor, enhancing security beyond just a password.
These factors are categorized into three types: something known (knowledge), something possessed (device), and a unique biometric feature.
Implementing 2FA significantly strengthens account security, making it more resilient against attacks, even if the password becomes compromised.
A knowledge factor is something like your password, which ideally you keep secret.
There are three main types of authentication factors: knowledge factors, possession factors, and inherence factors.
A knowledge factor refers to something you know, such as a password, which serves to authenticate your identity.
A second type, the possession factor, is something you physically have, like a key fob or your smartphone, which may generate a temporary code for authentication.
Using both a knowledge factor and a possession factor decreases the likelihood of unauthorized access to an account, as it narrows the pool of potential threats.
A third type of factor nowadays might be something that is unique to you, specifically described as biometrics.
Inherence factors, commonly associated with biometrics, include identifiers such as fingerprints or facial recognition.
These factors are unique to each individual and provide an additional level of security by ensuring that only the legitimate user can access their account.
The distinction between two-step and two-factor authentication is important; two-step may refer to two passwords, while two-factor authentication specifically involves two fundamentally different types of factors.
What you're receiving in those models is generally known as a One-Time Password, or OTP.
One-Time Passwords (OTPs) are temporary codes used for authentication, which are not reused and are valid only for a single session or transaction.
OTPs can be delivered through various means, including SMS, mobile apps, or physical key fobs that generate time-sensitive codes.
It’s critical that the OTP matches the one generated and synchronized by the server for successful authentication.
More secure would be something like an actual app that you install from the App Store.
While SMS-based OTPs are common, they are considered less secure due to potential vulnerabilities associated with SMS interception.
Applications that generate OTPs directly and communicate with a server without relying on SMS are typically safer.
Such applications minimize the risk of SIM swapping attacks where an adversary could gain access to your OTPs by convincing your mobile provider to transfer your number.
It is very possible for adversaries to somehow get software, malicious software, otherwise known as malware, onto your devices.
Malware can include keyloggers, software that captures every keystroke or tap made on a device, making users vulnerable to unauthorized access to sensitive information like usernames and passwords.
If an adversary successfully captures your OTP as you input it, they may gain total access to your accounts before you can act.
Users should be cautious when using shared or public devices, as they may be compromised and infected with malware that could lead to data breaches.
I will in general only log into websites and apps on my own personal devices.
To protect sensitive information, it's advised to use only personal devices for logging into accounts, minimizing the chance of unexpected malware exposure.
It's also important to exercise caution when using computers in public spaces, as their security cannot be easily verified.
Employing good security practices and remaining vigilant against possible threats significantly reduces the risk of unauthorized access to personal data.
"Short answer, yes, but we'll come to that in more detail in just a few minutes."
"Credential stuffing means not using dictionaries, not using brute force, but just literally using a list of already known usernames and passwords."
Credential stuffing is an attack method where adversaries utilize a collection of stolen usernames and passwords from one platform to gain unauthorized access to other platforms. This method exploits the tendency of users to reuse the same credentials across multiple websites or applications.
Malan warns that anyone using the same username and password on multiple sites is vulnerable to credential stuffing attacks. If any one of those sites is breached, attackers will try the same credentials on other platforms, increasing the likelihood of a successful breach.
"Ideally, if you want to be immune to this kind of credential stuffing attack, you have to use different credentials on each and every website."
The key takeaway from this discussion is that users should always utilize unique passwords for every website and application they use. Reusing passwords increases vulnerability to credential stuffing attacks, and users are advised to avoid using the same password across different sites.
Malan also highlights the importance of using different usernames, particularly steering clear of using email addresses as usernames when possible.
"Social engineering isn't a technical attack per se, but rather a social one, an attack among humans."
Malan introduces the concept of social engineering, which involves manipulating individuals into divulging confidential information. This tactic relies on building trust and exploiting social interactions rather than technical vulnerabilities.
He provides an intriguing demonstration by asking participants to write down a password, illustrating how trust can lead individuals to compromise their security. The act of writing down passwords for someone else underscores the risk of falling victim to social engineering tactics.
"Phishing is all about using social engineering, in this case in a technical way, to convince you through very convincing looking emails and even websites."
Phishing attacks are characterized by deceptive emails or websites that appear legitimate but aim to trick individuals into providing sensitive information. Malan warns that these attacks often exploit user trust and familiarity with brands like PayPal or Gmail.
He points out that phishing can take various forms, such as emails that ask users to click on links leading to fraudulent sites. This highlights the importance of vigilance when receiving unsolicited communication that requests personal information.
"It's important to begin to develop an intuition or a suspicion for when and when these sites might not be legitimate."
Users should actively assess the authenticity of websites and links, especially those involving sensitive information. Malan advises looking closely at the URL to ensure it is legitimate and established.
Best practices involve directly navigating to websites by typing the URL into the browser rather than clicking on potentially unsafe links. This cautious approach can enhance security and mitigate the risk of falling for phishing scams.
"This is even more worrisome when it comes to two-step verification."
Many users face a dilemma when weighing the usability of a service against the security of their accounts. This conflict becomes evident with two-step verification, which, while enhancing security, can also complicate access for users.
Advanced phishing attacks can exploit vulnerabilities in both usability and security. Attackers might create fake webpages that mimic legitimate ones, such as Gmail, and trick users into providing their login credentials and two-factor authentication codes.
"If any of them are malicious and are maybe storing your data, it's possible that you might not be having secure communications."
Machine-in-the-middle attacks involve malicious entities intercepting data between a user and the intended website. This highlights the importance of securing communication channels, especially given the multiple machines that data passes through.
Without proper security measures, users may unknowingly expose sensitive information to these intercepting machines. Understanding this risk is crucial in developing effective defenses against such attacks.
"The whole story here today started with you and I not being very good at choosing passwords."
One significant source of security vulnerabilities is poor password management by users. Often, individuals select passwords that meet only minimal requirements rather than adhering to best practices that enhance security.
These lax practices are compounded by the demands of modern life, such as managing numerous accounts. As a result, many resort to insecure methods, such as storing passwords on sticky notes or unencrypted digital files.
"Single sign-on refers to an ability to sign up for, to log in to one's website using an account that you already have on another website."
Single Sign-On (SSO) streamlines the login process by allowing users to access multiple websites using a single set of credentials from a major account, like Google or Facebook. This reduces friction and enhances usability while potentially improving security if users employ strong passwords and two-factor authentication for their main accounts.
SSO maintains backward compatibility with traditional login methods while offering additional convenience and improved protections for users.
"Increasingly, best practice is to use a piece of software that manages your passwords for you."
Password managers are essential tools for maintaining strong security practices. They help users generate, store, and manage unique passwords for different accounts, significantly reducing the risk of credential stuffing attacks.
By utilizing password managers, individuals can avoid the pitfalls of weak or repetitive passwords, ensuring better protection across all their online profiles. These tools also simplify the password creation process, making it easier to choose complex, secure passwords.
"Password managers literally do just that. They have even more features than that."
Password managers generate and securely store passwords so that users do not have to memorize them.
They help to eliminate the risk of writing passwords down or using insecure methods like post-it notes.
Upon returning to a website, these tools can automatically log users in by filling in their usernames and passwords, but only for legitimate sites like gmail.com or facebook.com.
"The password manager will ignore your keystrokes and not actually log you in if the URL is not recognized."
Password managers track the URLs associated with usernames and passwords.
This feature acts as a safeguard against phishing attacks by refusing to auto-fill login credentials on fraudulent sites, thus enhancing security.
"The one catch is that the onus is on you to remember one primary password that protects your password manager itself."
Users must remember a strong master password to protect their password manager, consolidating many passwords into one secure access point.
This master password should be complex, reasonably long, and memorable to ensure it is not easily compromised.
"Password managers offer additional features beyond what browsers provide, and they really protect all of the things that you're using."
"Using what comes with your computer from the major manufacturers is probably a good thing."
Many operating systems, like Apple's iCloud Keychain, Google’s password manager, and Microsoft’s credential manager, now include integrated password management features.
This reduces the need for third-party options, although some may still offer additional benefits.
"If you're not using a password manager, it's probably time to start doing so."
It is crucial to start using a password manager for managing sensitive accounts, especially those related to personal, medical, or financial information.
Users should also implement best practices like two-factor authentication, preferably using reliable applications instead of SMS when possible.
"Take baby steps. Bite off the easiest, most important accounts first."
The migration to a password manager should be gradual. Users can start with their most critical accounts first and update passwords when they next log in.
This step-by-step approach reduces the overwhelm of changing multiple passwords at once while balancing usability and security.
"You should certainly be using antivirus for other reasons that we'll talk about in another class."
While password managers enhance security, users must also use antivirus software to protect against malware that can log keystrokes and compromise accounts.
Strong antivirus solutions are essential for overall cybersecurity hygiene.
"If you're using voice recognition technology... you should disable those features and stop using them."
Users are advised against using voice recognition as a security feature due to advancements in AI that allow for the mimicry of voices, potentially compromising sensitive accounts.
Alternatives, such as two-factor authentication, are recommended to reduce these risks.
"If you're using pretty easy-to-guess passwords everywhere, this is probably a net positive to move to a password manager."
The trade-off of using one password manager is assessed. It can offer significant security benefits for users who currently use weak or reused passwords.
However, those already utilizing strong, unique passwords for various accounts may need to weigh the risks of consolidating them into one location.
"Decide for yourself based on these trade-offs, these upsides and downsides."
"Now, password managers are not all upside."
"Fortunately, there is an alternative that's increasingly available on websites and apps known as passkeys."
"What’s nice about passkeys is that moving forward, it will be your Mac, your PC, or your phone that generates a passkey for a new website or app."
"Rather, it's a pair of values, a private value and a public value, that have a mathematical relationship."
"The next time you try to access that website or application, your Mac, your PC, or your phone will use those values to automatically authenticate you thereafter."
"Better yet, those values are synchronized as needed across your devices."
"But to better understand these passkeys, we'll need to know a little something about the world of cryptography."