密码学:公开规则,守住秘密Cryptography: Public Rules, Protected Secrets
小禾要把班级活动安排传给同学。路上有人看信,还可能改信。保护信息只有藏起来这一种办法吗?He sends a class plan to a friend. Someone might read or alter it on the way. Is hiding it the only protection?
第 1 步:先分清要保护什么Step 1: Identify the protection needed
看不见内容,和改不了内容是一回事吗?Is hiding content the same as preventing undetected changes?
保密性关心谁能读到内容。完整性关心内容有没有被改。身份认证关心对方是谁。这些目标不同。加密主要保护秘密,认证机制帮助发现冒充和改动。密码学研究实现这些目标的数学方法。它不等于设置一个难猜的登录口令。Confidentiality concerns who can read information. Integrity concerns whether it was changed. Authentication concerns identity or origin. These are different goals. Encryption primarily protects secrecy; authentication mechanisms help detect impersonation and changes. Cryptography studies mathematical techniques for such goals. It means more than choosing a difficult login password.
第 2 步:规则可以公开Step 2: The rule can be public
别人知道算法,秘密就保不住了吗?Must the algorithm itself remain hidden?
可靠方案通常不靠隐藏算法。密钥是一段需要妥善管理的数据。相同规则配上不同密钥,结果会不同。移位密码把字母依次挪几格,适合观察密钥作用。但它选择太少,很容易试遍。教学小游戏能说明原理,不能用来保护真实信息。A sound design generally does not rely on hiding its algorithm. A key is data that must be managed appropriately; the same algorithm with different keys produces different results. A letter-shift cipher illustrates this, but its tiny set of keys is easy to try exhaustively. The game teaches a concept and must not protect real information.
第 3 步:数学之外还有管理Step 3: Management matters too
算法很强,为什么还会泄密?Why can a strong algorithm still fail in use?
密钥泄露、设备被控制或实现有缺陷,都可能破坏保护。小禾不把密钥和密文放在同一封公开邮件。真实系统还需要可靠随机数和经过审查的实现。算法会随研究进展更新。选算法、管理密钥和设计流程,必须一起考虑。Leaked keys, compromised devices and implementation flaws can defeat protection. He should not put the secret key beside ciphertext in a public message. Real systems need suitable randomness and reviewed implementations. Standards evolve as research advances. Algorithm choice, key management and the surrounding workflow must be designed together.
🎮 字母转盘实验🎮 Alphabet wheel experiment
旋转字母表,让四段短消息变成指定密文。这里只演示易破解的移位密码。Rotate the alphabet to encode four messages. This deliberately weak shift cipher is only for learning.
一句话记住它:Remember: 密码学用数学机制保护信息,但密钥和流程同样重要。Cryptography protects information through mathematics, with keys and workflows equally important.
保密、完整性与身份认证不同。Secrecy, integrity and authentication differ.知道算法不等于知道密钥。Knowing an algorithm is not knowing its key.移位密码不能保护真实秘密。A shift cipher cannot protect real secrets.