← Dashboard

computer science / security

University Computer Security Courses You Can Take Online, Compared

For computer science students and self-taught programmers: CS50 Cybersecurity, MIT 6.5660, Stanford CS155, Berkeley CS161 and Stanford CS253 side by side, with what each assumes, what the assignments cover, and which free hands-on platform pairs with it. Pages checked in October 2026.

updated Nov 2026·a 9-minute read·course pages read directly

Security courses at universities are not interchangeable. One teaches how a buffer overflow rewrites a return address, another how a browser enforces the same-origin policy, a third how to reason about an attacker before writing any code. If you already know how to program, the quickest route to a deep understanding is to pick the course that matches the layer you want and do its assignments. This page compares the main free ones. It is written for readers with a programming background, so it does not repeat the career-entry advice on our cybersecurity fundamentals page or the certification costs on our certifications page.

01 · THE MAP

Which course for which background

Course selector
You are...TakeReason
New to programming, curious about securityCS50's Introduction to CybersecurityFive weeks on accounts, data, systems and software; free certificate available
A CS student wanting systems securityMIT 6.5660 or Stanford CS155Threat models, buffer overflows and control hijacking labs
Comfortable with C, data structures and discrete mathBerkeley CS161Memory safety, cryptography, web and network security, with a free textbook
A web developerStanford CS253Web attacks and defenses; prerequisite is web development experience
Wanting the math behind encryptionBoneh's Cryptography ISeven modules on ciphers, integrity and protocols

02 · THE COURSES

What each course assumes and asks of you

Where a page does not state a fact, the cell says so.

Free security courses, checked October 2026
CourseAssumesWhat you doFree certificate
CS50 Cybersecurity (Harvard)Not stated on the course page5 weeks: lectures, assignments, final projectYes, with 70% or better on every problem and the final project
MIT 6.5660 (formerly 6.858)Not stated on the course pageLectures with readings; Lab 1 is buffer overflowsNone listed
Stanford CS155, Spring 2026Not stated on the main pageProject 1 control hijacking; Project 2 web security; homework; examNone listed
Berkeley CS161, Fall 2026CS61C, CS61B and CS70 are listed as prerequisitesProjects, homework, lecture playlist; free textbookNone listed
Stanford CS253 Web SecurityCS 142 or equivalent web development experienceWeb attacks and countermeasures; Fall 2021 materialsNone listed
Cryptography I (Stanford, Coursera)Not stated on the course page7 modules, about 2 weeks at 10 hours a week as listedShareable certificate; cost not stated on the page

Two details are worth knowing. The old link to MIT 6.858 now lands on the 6.5660 pages: the course was renumbered, and the site's Spring 2023 calendar starts with threat models and a buffer-overflow lab. And Stanford CS253's page shows Fall 2021 materials, so treat its specifics as a few years old even though the concepts hold.

03 · THINKING LIKE THE COURSES

Worked example: a threat model for password reset

MIT's first lecture is on threat models, and the habit it teaches is worth practicing before you touch an exploit. A threat model names what you protect, who might attack, how, and what stops them. Here is one for a "forgot password" email link.

Threat model: password reset by email link
AssetAttackerAttackControl
User accountStranger who knows the email addressGuesses the reset tokenLong random token from a cryptographic generator
User accountAnyone who obtains an old emailReuses a stale linkShort expiry and single use
Reset pageStrangerFloods requests to lock out or spam the userRate limiting per account and per address
Knowledge of who has an accountScraperTells existing from missing emails by the responseIdentical response either way
User's sessionAttacker with a stolen linkSets a new password while the old sessions stay aliveInvalidate existing sessions on reset

Notice that nothing here required exploit knowledge. It requires asking, for each part of a design, who benefits from breaking it. Courses then supply the vocabulary and depth: memory safety for the code, cryptography for the tokens, web security for the pages.

04 · PRACTICE

Pairing lectures with hands-on work

pwn.college, run by Arizona State University, is described as open and free to participants worldwide, and it powers much of ASU's cybersecurity curriculum. You progress through belts, beginning with a white belt. Carnegie Mellon's CyLab Security Academy, the successor to picoCTF, is described as CMU's free cybersecurity learning platform. For reading, Ross Anderson's Security Engineering has its chapters available as free downloads from the author's page, including chapters on protocols, cryptography and access control.

WATCHOnly attack what you are authorized to attack. Course labs and the platforms above are built for it. Testing anyone else's system, even out of curiosity, can be a crime.

05 · FAQ

Frequently asked questions

Where should I start learning computer security?

If you can already program, start with a university course that fits your background: CS50's Introduction to Cybersecurity is the gentlest, and Berkeley CS161 with its free textbook is a thorough option. Pair any course with a hands-on platform.

Can I learn ethical hacking for free and legally?

Yes. pwn.college and CyLab Security Academy are free platforms built for practice, and PortSwigger's Web Security Academy offers free web-attack labs. They give you legal targets, which is the point.

Do I need a CS degree to work in security?

Not necessarily, though university course material is a good way to get the same foundations. Requirements differ by employer, and documented lab work shows skill whatever your degree.

What should I learn before cybersecurity?

Programming and an understanding of how operating systems and networks work. Berkeley CS161 lists CS61C, CS61B and CS70 as prerequisites, which is a sign of the background that courses at that level expect.

Is it illegal to practice hacking?

Only if you target systems without permission. Course labs, deliberately vulnerable applications and platforms like pwn.college are authorized for practice. Never test a real site you do not own or have written permission to test.