Skip to content

Hashing and digital signatures

Cyber security Lesson 11 1:34 English narration · English + 中文 subtitles burned in

space play · ←/→ 5s · j/l 10s · f fullscreen · ,/. speed

Chapters

Transcript
In lesson seven we hashed passwords for secrecy. 第 7 课我们用哈希来保密。
The same function does a second job: it protects integrity, which means proving that data was not changed. 同一个函数还干第二件事:它保护"完整性", 也就是证明数据没有被改动过。
Look at these two words — they differ by one letter, and their hashes have nothing in common. 看这两个词——它们只差一个字母, 而它们的哈希毫无共同之处。
A changed file cannot keep its hash. 被改过的文件,留不住它原来的哈希。
That gives you a check you can run yourself. 这就给了你一个可以自己动手做的检查。
A site publishes the hash of a file beside the download link. 网站会把文件的哈希公布在下载链接旁边。
You download the file, hash your own copy, and compare the two. 你把文件下载下来,给自己这一份做哈希,然后两相比对。
If they match, the file arrived intact. 一致,说明文件完好无损地到了。
If they do not, it was corrupted on the way, or tampered with. 不一致,说明它在路上损坏了,或者被人动了手脚。
Now bolt that onto last lesson's key pair and you get a digital signature, which proves who sent something as well as that it did not change. 现在把它和上一课那对密钥拼起来,你就得到了数字签名, 它既证明东西是谁发的,也证明它没有被改过。
The sender hashes the message, then encrypts that hash with their private key — note the direction, it is the private key doing the encrypting this time. 发送方先给消息做哈希,再用"自己的私钥"把这个哈希加密—— 注意方向,这一次做加密的是私钥。
Anyone can check the result with the sender's public key, and only the real sender could have made it. 任何人都能用发送方的公钥去核对结果, 而只有真正的发送方才做得出这个签名。
Four things to take with you. 带走四点。
One: hashing also proves integrity, not just secrecy. 第一:哈希也用来证明完整性,不只是保密。
Two: compare a download's hash to the published one. 第二:把下载文件的哈希和官网公布的那个比对。
Three: signing encrypts the hash with the private key. 第三:签名是用私钥去加密那个哈希。
Four: anyone verifies it with the sender's public key. 第四:任何人都能用发送方的公钥来验证它。
Now compare two hashes in the task below. 现在去下面的题里比对两个哈希。

Log in or create account

IGCSE, A-Level & AP