教材原文段落
10 mod 3 = 1
10 mod 2 = 0
32 mod 8 = 0
32 mod 26 = 6
We'll revisit this function in Chapter 7 when we explore the RSA public key
encryption algorithm (named after Ron Rivest, Adi Shamir, and Leonard
Adleman, its inventors). One-Way Functions
A one-way function is a mathematical operation that easily produces output
values for each possible combination of inputs but makes it impossible to
retrieve the input values. Public key cryptosystems are all based on some sort
of one-way function. In practice, however, it's never been proven that any
specific known function is truly one-way.
Cryptographers rely on functions
that they believe are one-way, but it's always possible that they might be
broken by future cryptanalysts. Here's an example. Imagine you have a function that multiplies three
numbers together. If you restrict the input values to single-digit numbers, it's
a relatively straightforward matter to reverse-engineer this function and
determine the possible input values by looking at the numerical output. For
example, the output value 15 was created by using the input values 1, 3, and 5. However, suppose you restrict the input values to five-digit prime numbers.
It's still quite simple to obtain an output value by using a computer or a good
calculator, but reverse-engineering is not quite so simple. Can you figure out
which three prime numbers were used to obtain the output value
10,718,488,075,259? Not so simple, eh? (As it turns out, the number is the
product of the prime numbers 17,093; 22,441; and 27,943.) There are actually
8,363 five-digit prime numbers, so this problem might be attacked using a
computer and a brute-force algorithm, but there's no easy way to figure it out
in your head, that's for sure! Nonce
Cryptography often gains strength by adding randomness to the encryption
process.
One method by which this is accomplished is through the use of a
nonce. A nonce (from the phrase “number used once”) is a random number
that acts as a placeholder variable in mathematical functions. When the
function is executed, the nonce is replaced with a random number generated
at the moment of processing for one-time use. The nonce must be a unique
10 mod 3 = 1
10 mod 2 = 0
32 mod 8 = 0
32 mod 26 = 6
中文直译 / 整理
我们将在第7章中重新讨论这个函数,届时我们将探讨RSA公钥加密算法
(以其发明者Ron Rivest、Adi Shamir和Leonard Adleman命名)。 单向函数
一个单向函数是一种数学运算,它能够轻松地为每个可能的输入组合生成输出
值,但却无法反向推导出输入值。 公钥加密系统都基于某种单向函数。 然而,
在实践中,从未证明任何已知的具体函数确实是单向的。 密码学家依赖于他们
认为是单向的函数,但这些函数始终可能被未来的密码分析者破解。 举个例子。 假设你有一个将三个数字相乘的函数。 如果将输入值限制为个位数,
那么通过观察数值输出来逆向推导出可能的输入值相对简单。 例如,输出值15
是由输入值1、3和5生成的。 然而,假设你将输入值限制为五位数的质数。 使用
计算机或高性能计算器来获得输出值仍然相当简单,但逆向推导却不再那么容
易了。 你能算出是哪三个质数相乘得到了输出值10,718,488,075,259吗? 显然
没那么简单,对吧? (事实上,这个数是质数17,093、22,441和27,943的乘积。
)
实际上,共有8,363个五位数质数,因此可以使用计算机和暴力算法来攻击这个
问题,但毫无疑问,你绝不可能在脑海中轻易算出答案! 随机数
密码学通常通过在加密过程中添加随机性来增强安全性。 实现这一目标的一种
方法是使用随机数。 一个nonce(来自“一次性使用的数字”这一短语)是一
个在数学函数中充当占位符变量的随机数。 当函数执行时,nonce 会被在处
理时刻生成的随机数替换,用于一次性使用。 nonce 必须是唯一的
小白解释
场景先行:财务要把合同发给供应商:不想被别人看懂,要加密;不想被人改金额,要校验完整性;不想对方抵赖,要签名和证书。密码学不是炫技,是解决这些业务信任问题。
这一页真正想让你理解的是:单一控制不够,安全靠多个机制配合。
把它放进公司里看,关键不是背定义,而是判断:把加密、哈希、签名混在一起,会导致控制目标错位。
你作为负责人可以这样想:机密性用加密,完整性用哈希/签名,身份信任用证书和 PKI。
本页术语用人话说:
加密:加密把内容变成未授权者看不懂的形式。
密码学:密码学用数学方法保护信息,常用于机密性、完整性、认证和不可否认性。
常见误区:哈希不是加密;签名也不是为了隐藏内容。
读完后用一句话复述:如果我是系统架构师,我会先识别风险,再选择控制,并保留能证明判断合理的证据。
考点提醒
考题会把“保护机制:分层、隐藏、加密和边界”包装成一个业务场景:有人要上线系统、处理事故、审供应商、分配权限或选择控制。
先抓题干里的角色和目标:这里更像是系统架构师在做判断。
最佳答案通常不是“最强工具”,而是能降低风险、符合职责、成本合理、还能留下证据的动作。
加密主要保护机密性,也可配合签名、哈希支持完整性和真实性。
加密保护机密性,哈希保护完整性,数字签名支持完整性、真实性和不可否认性。
排除法提醒:哈希不是加密;签名也不是为了隐藏内容。