Encryption

In AP Computer Science Principles, encryption is the process of encoding data so that unauthorized parties can't read it; it protects information like PII when it travels over public networks, and it comes in two flavors on the exam, symmetric key encryption and public key encryption.

Verified for the 2027 AP Computer Science Principles examLast updated June 2026

What is Encryption?

Encryption is the process of encoding data so that only people who are supposed to read it actually can. Think of it as scrambling a message into nonsense that only someone with the right key can unscramble. The reverse process, turning the scrambled data back into readable form, is decryption. Most modern encryption relies on keys, which are like secret recipes for scrambling and unscrambling the data.

The AP CSP exam cares about two specific approaches. Symmetric key encryption uses one key for both encrypting and decrypting, which means both parties have to securely share that same key ahead of time. Public key encryption solves that problem with a key pair. Anyone can use your public key to encrypt a message to you, but only your private key can decrypt it. That's why public key encryption powers secure communication across the open internet, where you can't safely hand a secret key to a stranger first.

Why Encryption matters in AP Computer Science Principles

Encryption lives in Topic 5.6 Safe Computing in Unit 5: Impact of Computing, and it directly supports learning objective AP Comp Sci P 5.6.B, explaining how computing resources can be protected. The CED is blunt about the threat. Data sent over public networks can be intercepted, analyzed, and modified (EK IOC-2.C.3), and the internet routes your data through tons of devices you don't control. Encryption is the main answer to that problem. It also connects to AP Comp Sci P 5.6.A, because the personally identifiable information (PII) that computing systems collect, like medical records, financial data, and biometric data, is exactly the stuff worth encrypting. If you understand encryption, you understand the core defense in the entire Safe Computing topic.

How Encryption connects across the course

Public Key Encryption (Unit 5)

This is the version of encryption the exam loves most. It uses a public key to encrypt and a private key to decrypt, so two strangers can communicate securely without ever meeting to swap a secret key first. That key-sharing fix is the whole point.

Symmetric Key Encryption (Unit 5)

The older, simpler approach where one shared key does both jobs. It's fast, but it has a built-in weakness. You have to get that key to the other person without anyone intercepting it, which is hard over a public network.

Rogue Access Point (Unit 5)

A rogue access point is a fake wireless hotspot that lets an attacker intercept your network traffic. It's the perfect example of WHY encryption matters. If your data is encrypted, an attacker who intercepts it just gets unreadable scrambled bits.

Multifactor Authentication (Unit 5)

Encryption and authentication are the two pillars of 5.6.B, but they protect different things. Authentication controls who gets in the door, while encryption protects the data itself, even if someone steals it. Strong security uses both.

Is Encryption on the AP Computer Science Principles exam?

Encryption shows up in multiple-choice questions, since AP CSP has no FRQs anymore (the written portion was replaced by the Create Performance Task). Expect scenario-based stems. A classic setup describes data being sent over a public network or intercepted by a rogue access point, then asks which protection applies. Another favorite asks you to compare symmetric and public key encryption, especially the key distribution problem that public key encryption solves. Practice questions also pair encryption with PII, asking which technique transforms personal data into a protected form while it stays useful. Your job is to (1) define encryption as encoding data to prevent unauthorized access, (2) match the right type of encryption to the scenario, and (3) distinguish it from authentication measures like passwords and MFA.

Encryption vs Authentication

Both protect computing resources under 5.6.B, but they do different jobs. Authentication verifies WHO you are before granting access, using things like strong passwords and multifactor authentication. Encryption protects the DATA itself by scrambling it, so even if someone intercepts or steals it, they can't read it. A quick test for MCQs is to ask whether the scenario is about getting into an account (authentication) or about protecting information in transit or storage (encryption).

Key things to remember about Encryption

  • Encryption is the process of encoding data to prevent unauthorized access, and decryption is the process of decoding it back into readable form.

  • Symmetric key encryption uses one shared key for both encrypting and decrypting, which creates the problem of securely sharing that key.

  • Public key encryption uses a public key to encrypt and a private key to decrypt, so secure communication is possible without sharing a secret key in advance.

  • Encryption matters because data sent over public networks can be intercepted, analyzed, and modified, including by rogue access points.

  • Encryption protects data itself, while authentication measures like strong passwords and multifactor authentication control who can access a system.

Frequently asked questions about Encryption

What is encryption in AP Computer Science Principles?

Encryption is the process of encoding data so unauthorized parties can't read it. It's covered in Topic 5.6 Safe Computing under learning objective AP Comp Sci P 5.6.B, and the exam tests two types, symmetric key and public key encryption.

What's the difference between symmetric and public key encryption?

Symmetric key encryption uses one shared key for both encrypting and decrypting, so both parties need that same key. Public key encryption uses a pair, where a public key encrypts and a private key decrypts, which means no secret key ever has to be shared over the network.

Is encryption the same as authentication?

No. Authentication verifies a user's identity before granting access, using things like passwords and multifactor authentication. Encryption scrambles the data itself so it stays unreadable even if it's intercepted or stolen.

Does encryption make data completely safe?

No, encryption protects data from being read if intercepted, but it doesn't stop other attacks. Phishing tricks you into handing over information directly, and keylogging records your keystrokes before anything gets encrypted, so encryption is one layer of defense, not the whole strategy.

Why is public key encryption better for the internet?

Because the internet is a public network where data can be intercepted, you can't safely hand a secret key to someone you've never met. Public key encryption lets anyone encrypt a message with your freely shared public key, while only your private key can decrypt it.