← ACARA Digital Technologies Years 9–10

Base64 is encoding, not encryption

Rewrites data using 64 printable characters so it can be sent as text. It has no secret key, so anyone can reverse it. It is encoding, not encryption, and protects nothing.

Understanding Base64 is encoding, not encryption in ACARA Digital Technologies Years 9–10

What it does: These 64 printable characters (with = for padding) make up the Base64 alphabet, which is why the output is safe to send as text. Both are just different ways to write the same data and neither uses a key. Base64 packs more bits per character, so its output is shorter than hex. Base64 is encoding. It changes how data is written so it can travel as text. It does not use a secret key to protect anything. Base64 uses a public, well-known method. Free tools and a line of code can decode it, so there is no key to keep secret.

Common mistakes: The Python module is called base64, not base46. The first line should be import base64 so b64encode() can be used. Base64 is encoding, not encryption, so there is no decrypt function and no key. Anyone can reverse it with base64.b64decode(enc).

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 876–944) and word search (Modules 860–944).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Base64 turns the text "Hi" into "SGk=". Which statement describes what Base64 is?
Encryption: it hides data using a secret keyEncoding: it rewrites data in a different form
Matches
secret = base64.b64encode(password) # now it is safe
↓
Treating Base64 as encryption. There is no key, so anyone can decode it and read the password.
Applying
Meanings
Term
Base64
Meaning
Rewrites data using 64 printable characters so it can be sent as text. It has no secret key, so anyone can reverse it. It is encoding, not encryption, and protects nothing.
Practice
import base64
Testing
Gaps
import
Check Answer
Spots
1import base46
2msg = b'Hi'

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Jellyfish' badge — Flow Controller, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Base64 turns the text "Hi" into "SGk=". Which statement describes what Base64 is?
A. Encoding: it rewrites data in a different form ✓
B. Encryption: it hides data using a secret key
Base64 is encoding. It changes how data is written so it can travel as text. It does not use a secret key to protect anything.
2. Mia finds the text "cGFzc3dvcmQ=" in a file. Who can turn it back into the original text?
A. Anyone, because Base64 has no secret key ✓
B. Only someone who knows the secret key
Base64 uses a public, well-known method. Free tools and a line of code can decode it, so there is no key to keep secret.
3. A developer stores user passwords as Base64 text. Is this a safe way to protect them?
A. Yes, the characters look scrambled so they are protected
B. No, anyone can decode Base64 straight away ✓
Looking scrambled is not the same as being protected. Base64 only changes the format. Passwords should be hashed with a salt instead.
4. Why is Base64 often used when sending files or images inside emails and web pages?
A. It locks the data so interceptors cannot read it
B. It rewrites data as printable text characters that can be sent as text ✓
Base64 uses 64 printable characters (A-Z, a-z, 0-9, + and /) so binary data can travel through systems built for text. Secrecy is not its job.
5. Which comparison of Base64 and hexadecimal (hex) is correct?
A. Both are encodings that anyone can reverse without a key ✓
B. Base64 is an encoding but hex is a secure encryption
Hex uses 16 characters and Base64 uses 64, but both just rewrite data. Neither uses a secret key, so neither protects data.

Match the Pairs

base64.b64encode(b"Hi") → Rewrites the bytes of Hi as Base64 text (SGk=). No key is used, so anyone can turn it back.
base64.b64decode("SGk=") → Reverses Base64 text back to the original data (Hi) with no password or key needed.
Base64 uses only 64 printable characters, so binary data can travel as plain text. → A-Z a-z 0-9 + /
Hex uses 16 characters for each 4 bits, while Base64 uses 64 characters for each 6 bits, so Base64 is shorter. → Hi = 4869 (hex) or SGk= (Base64)
secret = base64.b64encode(password) # now it is safe → Treating Base64 as encryption. There is no key, so anyone can decode it and read the password.
Encrypted with Base64: SGVsbG8= (only I can read it) → Base64 is not encrypted and has no secret key. Anyone can decode SGVsbG8= to Hello.

Key Term

Base64
Rewrites data using 64 printable characters so it can be sent as text. It has no secret key, so anyone can reverse it. It is encoding, not encryption, and protects nothing.

Fill in the Blanks

1. import base64 msg = b"Hi" print(base64.b64encode(msg))
Hint: Type the name of the Python library imported to work with this encoding.
2. import base64 coded = base64.b64encode(b"Hello") print(coded)
Hint: Type the function that turns bytes into Base64 text.
3. import base64 coded = "SGk=" print(base64.b64decode(coded))
Hint: Type the function that reverses Base64. It needs no key.
4. text = "SGk=" data = base64.b64decode(text) print(data)
Hint: Type the variable that holds the Base64 string. Notice that no secret key is passed in.
5. data = b"Hi" print(data.hex()) print(base64.b64encode(data))
Hint: Type the method that writes bytes in hexadecimal so you can compare it with Base64.

Spot the Error

Question 1
A import base46
B msg = b'Hi'
C code = base64.b64encode(msg)
D print(code)
Line A — The Python module is called base64, not base46. The first line should be import base64 so b64encode() can be used.
Question 2
A import base64
B pw = b'password1'
C enc = base64.b64encode(pw)
D print(base64.decrypt(enc))
Line D — Base64 is encoding, not encryption, so there is no decrypt function and no key. Anyone can reverse it with base64.b64decode(enc).
Question 3
A import base64
B enc = 'SGk='
C raw = base64.b64encode(enc)
D print(raw)
Line C — To get the original data back you must decode, not encode again. Line 3 should be raw = base64.b64decode(enc), which needs no key.
Question 4
A import base64
B data = b'Hi'
C print(data.hexdigest())
D print(base64.b64encode(data))
Line C — Bytes have a .hex() method that writes them in hex (16 characters). hexdigest() belongs to hash objects, not bytes. Line 3 should be print(data.hex()).
Question 5
A import base64
B def encode(text, key):
C b = text.encode()
D return base64.b64encode(b)
Line B — Base64 has no secret key, so the function needs no key parameter. The line should be def encode(text):.

Student with a class code? Join your class →