With no lock不上鎖
The message goes as you wrote it. Compare the three boxes when it arrives. Who knows the secret now?
訊息照你寫的原樣送出去。送到的時候比一比三個格子:現在有誰知道這個祕密?
How Computers Work · Unit 4 · Lesson 14 · 電腦概論 單元四 第十四課
A message travels from your computer to a friend’s, and someone in the middle is watching. Send it in 3D with no lock, then lock it with a key and see what the watcher gets. Give your friend the wrong key. Let the watcher try every key. Then lock and unlock messages yourself, break a cipher as the watcher, and see how many keys a real lock has.
一則訊息從你的電腦送到朋友的電腦,中間有人在偷看。在 3D 裡先不上鎖送一次,再用金鑰鎖起來,看偷看的人拿到什麼。給朋友一把錯的金鑰;讓偷看的人把每一把金鑰都試一遍。接著自己加密、解密,當一次偷看的人破解密文,再看看真正的鎖有幾把金鑰。
To keep a message secret, a computer scrambles it by a rule, using a secret number called a key. Anyone on the way can see the scrambled message but cannot understand it. Only someone with the right key can turn it back. The rule itself can be known to everyone. The lock is safe only if there are far too many keys to try.
要讓一則訊息保密,電腦會照一個規則把它打亂,打亂時用到一個祕密的數,叫做金鑰。路上的任何人都看得到被打亂的訊息,卻看不懂。只有拿著正確金鑰的人,才能把它變回來。規則本身可以讓所有人知道。要金鑰多到試不完,這把鎖才安全。
3D Model · 3D 模型
You are on the left and your friend is on the right. The message travels along the cable between you, past the teal relay points. Behind the middle one stands someone who can see everything that goes by. Choose a message, choose whether to lock it, and press Send. The three boxes on the right show what each person ends up with. Change the key and send again.
你在左邊,朋友在右邊。訊息沿著你們中間那條線走,經過幾個青色的中繼點。中間那個點的後面站著一個人,經過的東西他全都看得到。選一則訊息,決定要不要上鎖,然後按「送出」。右邊三個格子顯示每個人最後拿到什麼。改一改金鑰,再送一次。
Drag to turn · 拖曳旋轉
This 3D model needs WebGL, which this browser does not support. The buttons and the three boxes below still work, and so do the reading and the games.
這個瀏覽器不支援 WebGL,無法顯示 3D 模型;下面的按鈕和三個格子照樣能用,課文和小遊戲也都能用。
A teaching model. The lock here is the letter-shift cipher that Julius Caesar used about two thousand years ago. It is easy to follow, and it is far too weak for real use: it has only 25 keys. Real encryption does not shift letters. It works on the bits of the message, with keys that are very long numbers. Real computers also do not need to meet in advance to agree on a key; a method called public-key cryptography lets them do that across the network. What is the same is the idea: a public rule, a secret key, and a watcher who sees only nonsense.
這是教學用的示意模型。這裡的鎖是大約兩千年前凱撒用過的字母位移。它很容易看懂,但實際使用遠遠不夠強:金鑰只有 25 把。真的加密不是移字母,而是對訊息的位元動手,用的金鑰是很長的數。真的電腦也不必事先見面約好金鑰;有一種叫公開金鑰密碼學的方法,讓它們隔著網路就能約好。相同的是這個道理:規則公開、金鑰保密,偷看的人只看到一串沒有意義的東西。
Model and code are drawn and programmed by My Culture Connect. Every message is tested to lock and unlock exactly with every key, in tools/computers/test/cipher.test.mjs.
模型與程式由人師教育協會自行繪製、撰寫;每一則訊息都測過「用每一把金鑰加密再解密,都和原文一模一樣」(tools/computers/test/cipher.test.mjs)。
Reading · 英文閱讀
In Lesson 13 you saw that a message does not go straight from your computer to the other one. It passes through many machines on the way, and you do not control any of them. Anyone who runs one of those machines could look at what goes by. So how can you send something private? The answer is very old. It is called cryptography: writing a message so that only the person it is meant for can understand it.
Here is one way, used by Julius Caesar. Move every letter three places along the alphabet: A becomes D, B becomes E, and so on. “MEET ME AT NOON” turns into “PHHW PH DW QRRQ.” Scrambling a message like this is called encryption. There are two parts to it. The rule is “move each letter along.” The key is the number that says how far: here, 3.
Your friend knows the key, so your friend moves every letter back three places and reads the message. That is decryption. The watcher in the middle sees the same letters, but without the key they mean nothing. Notice what has to be secret. It is not the rule. Everyone can know the rule. Only the key must be kept between the two of you, and you must both have exactly the same one.
Caesar’s lock has a weakness. There are only 25 possible keys. A watcher can simply try them all, one after another, until the message makes sense. So the safety of a lock depends on how many keys there are. A computer’s key is a number written in bits, and you saw in Lesson 1 that every extra bit doubles the count. A standard method used today has keys of 128, 192, or 256 bits. A key of 128 bits can be any one of a number of keys that is 39 digits long.
One puzzle remains. How can two computers that have never met agree on a key, when the watcher hears everything they say? In 1976, two researchers, Whitfield Diffie and Martin Hellman, described a way. Each side has two keys. One is published for everyone to use for locking. The other is kept secret and is the only one that unlocks. Anyone can send you a locked message, and only you can open it.
You use all this every day. When a web address begins with https, the browser and the server are encrypting everything they send to each other. The machines in between see only scrambled data. But remember what encryption does and does not do. It keeps the message private on the way. It cannot tell you whether the person at the other end is honest, and it cannot help if you give your password to the wrong person.
Questions · 閱讀理解
In Caesar’s cipher, what is the rule and what is the key? Which one must be kept secret?
Why is a cipher with only 25 keys not safe?
What does https at the start of a web address tell you, and what does it not tell you?
Words & Phrases · 生字及片語
Quick Check · 小測驗
1. What does encryption do to a message?
2. In Caesar’s cipher with the key 3, what does A become?
3. What must be kept secret?
4. Why is Caesar’s cipher easy to break?
5. According to the reading, what does https NOT tell you?
Try It in the Model · 在模型裡試試
Then choose your own key with the plus and minus buttons, and send each of the three messages.
接著用加號和減號選一把自己的金鑰,把三則訊息各送一次。
The message goes as you wrote it. Compare the three boxes when it arrives. Who knows the secret now?
訊息照你寫的原樣送出去。送到的時候比一比三個格子:現在有誰知道這個祕密?
The watcher still gets the message. What is different about what the watcher has?
偷看的人還是拿到了訊息。他拿到的東西有什麼不一樣?
Your friend’s key is off by just one. How close to the real message is the result?
朋友的金鑰只差了一。解出來的東西,離真正的訊息有多近?
The watcher has no key, but has patience. How many tries does it take? What would it take with the key 25?
偷看的人沒有金鑰,可是有耐心。他試了幾把?如果金鑰是 25 呢?
Try It · 自己試試
Type a message in English and move the slider to choose a key. The two rows of letters show the rule: each letter in the top row becomes the one below it. Then switch to Unlock: the scrambled text moves up into the box, and the same key turns it back.
用英文打一則訊息,拉動滑桿選一把金鑰。那兩排字母就是規則:上面一排的每個字母,變成它正下方的那一個。接著切到「解密」:打亂的文字會移到上面的格子裡,同一把金鑰把它變回來。
Result · 結果
Only the 26 English letters are moved. Spaces, numbers, punctuation, and Chinese characters stay as they are. Nothing you type here is sent anywhere. And do not use this for a real secret: you are about to see how quickly it can be broken.只有 26 個英文字母會被移動;空白、數字、標點和中文都原樣不動。你在這裡打的東西不會送到任何地方。還有,不要拿它來保護真正的祕密:你馬上就會看到,它多快就被破解。
Game · 小遊戲
Now change sides. You have caught three locked messages, and you do not know the key to any of them. But you know the rule, and there are only 25 keys. Each message is shown with every key tried. Find the line that is real English.
現在換邊。你攔到三則上了鎖的訊息,每一則的金鑰你都不知道。可是你知道規則,而金鑰只有 25 把。每一則訊息都把 25 把金鑰試過的結果列出來。找出真正是英文的那一行。
Broken · 破解了 0
Trying every key like this is called a brute-force attack. It works on any cipher if the keys are few enough. That is the whole reason real keys are so long.像這樣把每一把金鑰都試一遍,叫做暴力破解(brute-force attack)。只要金鑰夠少,它對任何加密方法都有效。真正的金鑰要那麼長,原因就在這裡。
See Why · 看看為什麼
A computer’s key is a number written in bits. Move the slider to make the key longer, and watch how many different keys there could be. Remember that the watcher’s only way in is to try them.
電腦的金鑰是用位元寫成的數。拉動滑桿把金鑰變長,看看可能的金鑰有幾把。別忘了,偷看的人唯一的辦法就是一把一把試。
1 bit · 1 個位元256 bits · 256 個位元
How many different keys there are · 一共有幾把不同的金鑰
A number with 0 digits · 這個數有幾位數
These are exact numbers: 2 multiplied by itself once for each bit. The standard called AES uses keys of 128, 192, or 256 bits. We do not say how long trying them all would take, because that depends on the machine. The point is the size of the number.這些都是精確的數字:有幾個位元,就把 2 自己乘幾次。叫做 AES 的那套標準,用的金鑰是 128、192 或 256 個位元。我們不說「全部試完要多久」,因為那要看用什麼機器;重點是這個數有多大。
Stories Behind Secret Writing · 祕密書寫的故事
Four short stories about keeping messages private.
關於「不讓別人看懂訊息」的四個小故事。
Caesar · 凱撒
According to Britannica, the Roman writer Suetonius describes the cipher that Julius Caesar used in his letters: he replaced each letter with the letter three places down in the alphabet, and for letters at the end, the cipher went back around to the start. Caesar’s successor, Augustus, found this too complicated and replaced each letter with the one right after it. The method is still named after Caesar.
根據大英百科,羅馬作家蘇埃托尼烏斯(Suetonius)記下了凱撒寫信時用的加密方法:把每個字母換成字母表上往後第三個字母,到了字母表的尾巴就繞回開頭。凱撒的繼承人奧古斯都覺得這樣太複雜,改成把每個字母換成緊接著的下一個。這個方法至今仍以凱撒為名。
ROT13
There are 26 letters, and 13 is half of 26. So if you shift a message by 13 and then shift it by 13 again, every letter has gone all the way around and is back where it began. Britannica notes that this cipher, called ROT13, has been widely used to protect text against being read by accident, and that it was chosen because applying it twice returns the original. CODE becomes PBQR, and PBQR becomes CODE.
英文字母有 26 個,13 剛好是 26 的一半。所以把一則訊息移 13 格,再移 13 格,每個字母都繞了一整圈,回到原來的位置。大英百科提到,這種叫 ROT13 的加密一直被廣泛用來避免文字被不小心讀到;選 13,就是因為做兩次會回到原文。CODE 變成 PBQR,PBQR 又變回 CODE。
1976
With a cipher like Caesar’s, the two sides must somehow share one key, and a key that is sent can be caught on the way. Britannica calls what happened in 1976 one of the most inspired insights in the history of the subject: Whitfield Diffie and Martin Hellman proposed that each user keep a decryption key secret and publish an encryption key in a public directory. It was the first discussion of the idea in the open literature. Later it was revealed that James Ellis, Clifford Cocks, and Malcolm Williamson at Britain’s GCHQ had discovered it earlier, in secret.
用凱撒那樣的加密,兩邊得想辦法拿到同一把金鑰,而送出去的金鑰可能在路上被攔走。大英百科把 1976 年發生的事稱為這門學問史上最有靈感的洞見之一:迪菲和赫爾曼提出,每個使用者把解密的金鑰自己留著,把加密的金鑰放在一份公開的名錄裡。這是公開文獻中第一次討論這個想法。後來才揭露,英國政府通訊總部(GCHQ)的艾利斯(James Ellis)、考克斯(Clifford Cocks)和威廉森(Malcolm Williamson)更早就祕密地發現了它。
128 bits · 128 個位元
The United States standard called AES says its keys are 128, 192, or 256 bits long. The rest of this card is our own arithmetic. Caesar’s cipher has 25 keys, fewer than 5 bits would give. A key of 128 bits can be any of 340,282,366,920,938,463,463,374,607,431,768,211,456 keys. Each extra bit doubles the number, exactly as each extra switch did in Lesson 1. Trying keys one by one is the slow search from Lesson 10, and a good lock is designed so that there is no quicker way.
美國一套叫 AES 的標準寫明,它的金鑰長度是 128、192 或 256 個位元。這張卡接下來的部分是我們自己算的。凱撒的加密有 25 把金鑰,比 5 個位元的還少。128 個位元的金鑰,可能的數目是 340,282,366,920,938,463,463,374,607,431,768,211,456 把。每多一個位元,數目就加倍,和第一課每多一個開關一樣。一把一把試金鑰,就是第十課那種慢的找法;好的鎖在設計上,就是要讓人找不到更快的方法。
Myth vs. Fact · 常見迷思
✗ Myth · 迷思If nobody can see my screen, nobody can see my message.只要沒人看到我的螢幕,就沒人看得到我的訊息。
✓ Fact · 事實A message passes through many machines between you and the other person. Without encryption, whoever runs them could read it.訊息在你和對方之間會經過很多台機器。沒有加密的話,管那些機器的人就讀得到。
✗ Myth · 迷思A code is safe as long as nobody knows how it works.只要沒人知道密碼是怎麼運作的,它就安全。
✓ Fact · 事實Everyone knows how Caesar’s cipher works. Safety has to come from the key, and from there being too many keys to try.凱撒的加密方法人人都知道。安全必須來自金鑰,而且金鑰要多到試不完。
✗ Myth · 迷思Once a message is encrypted, it cannot be read by anyone else.訊息一旦加密,別人就一定讀不到。
✓ Fact · 事實It depends on the lock. With only 25 keys, a brute-force attack tries them all. Britannica notes that Caesar’s cipher can be broken in other ways too.要看是什麼鎖。金鑰只有 25 把的話,暴力破解把它們全部試一遍就行了。大英百科指出,凱撒的加密還有別的破解方法。
✗ Myth · 迷思If the address starts with https, the site can be trusted.網址開頭是 https,這個網站就可以信任。
✓ Fact · 事實The letters mean that what travels between you and the server is encrypted. They say nothing about who runs the server or whether what it tells you is true.這幾個字母的意思是:你和伺服器之間傳的東西有加密。它們並沒有說那台伺服器是誰在管,也沒有說它告訴你的事是不是真的。
Remember It · 記憶口訣
Everyone may know the method. Nobody else may know the key.
方法誰都可以知道;金鑰不能讓別人知道。
Off by one, and it is nonsense.
差一,就是一堆亂碼。
25 keys can all be tried.
25 把,全部試得完。
That is why real keys are long.
所以真的金鑰很長。
Before You Start · 動手之前
Classroom Activity 1 · 課堂活動一
You need · 準備材料
Steps · 步驟
Talk about the whisper. How did the two ends agree on the key without the watcher hearing? In a real network there is no whisper, which is the puzzle that public-key cryptography solved. In Taiwan’s junior high Information Technology curriculum, this lesson matches the topic “Information technology and human society”: 資 H-IV-1, protecting personal data, and 資 H-IV-3, information security.
和學生談談那句「小聲約好」。兩端是怎麼不讓偷看的人聽到就約好金鑰的?真的網路上沒有辦法小聲說,這正是公開金鑰密碼學解決的難題。對照十二年國教國中「資訊科技」的學習內容,這一課對應「資訊科技與人類社會」主題:資 H-IV-1 個人資料保護、資 H-IV-3 資訊安全。
Classroom Activity 2 · 課堂活動二
You need · 準備材料
Steps · 步驟
CODE becomes PBQR, and PBQR becomes CODE again. On a phone the address may be partly hidden; tap the address bar to see all of it. An address beginning with https means the connection is encrypted. It is not a promise about the site itself.
CODE 會變成 PBQR,PBQR 又變回 CODE。手機上的網址可能只顯示一部分,點一下網址列就看得到完整的。網址開頭是 https,表示連線有加密;它並不是對這個網站本身的保證。
Go Further · 延伸閱讀
Sources · 資料出處
Facts on this page were checked against these sources (October 2026); the model uses Caesar’s cipher only as an illustration, and every message is tested · 本頁的事實依下列資料查證(2026 年 10 月);模型只是拿凱撒的加密來示意,每一則訊息都有測試