[Figure: FiveStudy logo]
FiveStudy
Cybersecurity · Unit 5 · 5.3.a
AP Cybersecurity · Securing Applications and Data
How Encryption Protects Files
The algorithm is public. The key is the secret — and the keyspace is what makes guessing hopeless.
key ideaThe algorithm is public. The key is what is secret — and the keyspace is what makes guessing hopeless.
The mechanism
The purpose of cryptography is to hide information. A cryptographic algorithm defines a process for encrypting and decrypting: encryption hides the information, and decryption reverses it for anyone holding the key.
An encryption algorithm defines a process for combining the information with a predefined key. The input is called plaintext; the output is ciphertext. Nothing about the process is secret except the key.| Term | What it means |
|---|
| plaintext | the information to be encrypted |
| ciphertext | the output of the encryption process |
| key | the predefined value combined with the information by the algorithm |
| keyspace | the number of possible keys the algorithm can use |
| encryption | the process of hiding the information |
| decryption | the process of reversing it |
The keyspace is the one that decides security. The larger the keyspace, the longer it takes an adversary to discover the correct key by guessing — which is the whole argument for longer keys.
Keys and who holds them
| Classified by | Options | How they differ |
|---|
| number of keys | symmetric | the same key encrypts and decrypts |
| | asymmetric | a key pair — one key encrypts, the other decrypts |
| how information is processed | block encryption | handles information in fixed-size chunks of bits |
| | stream encryption | handles information one bit at a time |
The two classifications are independent: an algorithm is symmetric or asymmetric, and block or stream. AES, for instance, is a symmetric block cipher.
| Symmetric | Asymmetric |
|---|
| keys | one, shared | two — a pair |
| the sharing problem | the key must reach the other party safely | the encrypting key can be public |
| speed | faster | slower |
| typical use | encrypting files and traffic in bulk | digital signatures, certificates, exchanging a symmetric key |
Row 2 is why both exist. Symmetric encryption is efficient but leaves the key distribution problem unsolved; asymmetric encryption solves that at a cost in speed.
Worked analysis
EX 1
Name every part
A user encrypts report.txt with a password-derived key, producing report.enc. Name each component.
1
The input
report.txt is the plaintext — the information to be encrypted.
2
The process
An encryption algorithm defining how to combine the information with the key.
3
The secret
The key, here derived from the password.
4
The output
report.enc is the ciphertext.
5
The reverse
Decryption with the same key recovers the plaintext. The algorithm is public; only the key protects anything.
EX 2
Why keyspace decides security
Two algorithms use the same process but different key sizes. Explain why the larger key is more secure.
1
Define the term
The keyspace is the number of possible keys the algorithm can use.
2
State the relationship
A larger keyspace means more keys an adversary must try.
3
State the consequence
The larger the keyspace, the longer it takes to discover the correct key by guessing.
4
Note what is unchanged
The algorithm is the same — only the number of candidates differs.
5
Note the cost
Longer keys take more time to encrypt and decrypt, which is why key length is a decision rather than a maximum.
EX 3
Classify an algorithm twice
An algorithm uses one key for both directions and processes data in 128-bit chunks. Classify it on both axes.
1
Apply the key-count classification
One key for both directions → symmetric.
2
Apply the processing classification
Fixed-size chunks → block encryption.
3
State both together
A symmetric block cipher — the category AES belongs to.
4
Note what stream would mean
Handling the information one bit at a time instead.
5
State why both labels matter
The two classifications are independent, so a complete answer names both.
Watch out
The algorithm is not the secret
A cryptographic algorithm defines a public process. Security comes from the key and the size of the keyspace — not from concealing how the algorithm works.
Symmetric versus asymmetric is about key count
Symmetric uses the same key to encrypt and decrypt; asymmetric uses a key pair. It says nothing about how the data is chunked.
Block versus stream is a separate question
Block encryption handles fixed-size chunks; stream handles one bit at a time. An algorithm is classified on both axes.
A larger keyspace costs time
Longer keys are harder to guess and slower to use. The right length is chosen against current guessing speed, not maximized.
Check yourself
What is the purpose of cryptography, and what do the two processes do?
Show answer
To hide information. Encryption hides it; decryption reverses the process.
Define plaintext, ciphertext and keyspace.
Show answer
Plaintext is the information to be encrypted; ciphertext is the output of encryption; keyspace is the number of possible keys the algorithm can use.
How are cryptographic algorithms classified?
Show answer
By number of keys — symmetric uses the same key to encrypt and decrypt, asymmetric uses a key pair — and by how information is processed — block encryption in fixed-size chunks, stream encryption one bit at a time.
Why does a larger keyspace improve security?
Show answer
The larger the keyspace, the longer it will take an adversary to discover the correct key by guessing — there are simply more candidates to try.