> For the complete documentation index, see [llms.txt](https://docs.junyangz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.junyangz.com/note/secret-knowledge.md).

# Secret knowledge

> a lot of useful information, idea from the-book-of-secret-knowledge.

## 4A

* 身份验证 Authentication
* 账号管理 Account
* 授权控制 Authorization
* 安全审计 Audit

## 数字签名

> ref \[1]

现在实用的数字签名机制一般利用公开密钥算法实现。具体的实现方式如下所述。

当A方打算发一条消息x给B方并签名时，首先用他的秘密密钥Kd对x加密，得到签名$$y=f\_{K\_{d}}(x)$$，然后发送有序信息对(x,y)。B方收到(x,y)后，用A方的公开密钥Ke对y解密，得到$$x^{\prime}=f\_{K\_{\mathrm{s}}}(y)$$。x'与x完全相同的条件是：

* 信息对(x,y)在传输过程中无任何变化，x或y的任何变化都会使x'与x不等。
* y确实是用Kd对x加密得到的，Kd的任何变化都会使x'与x不等。

因此，只要x'与x相等，就可以确定三件事：

* 消息x确实由A方发来。
* 签名y确实由A方生成。
* B方收到的消息是完整的。

由于只有A方知道他的秘密密钥Kd，所以通过上述签名和验证可以防止下面两种情况：

* A方否认他曾经发送消息x，或者否认B方收到的消息属实。因为只有他能生成y，而y与x是对应的。
* B方伪造消息。因为他得不到Kd，无法证明与伪造消息对应的签名是A方生成的。

为了防止B方事后否认收到消息x，A方可以要求B方提供收信回执，如"B从A处得到x"一段文字，并且要求B方用他的秘密密钥对这段文字签名，以防抵赖。

综上所述，数字签名可以验证消息的完整性，有效地对抗冒充、抵赖等威胁。

## Github budget

<https://img.shields.io/badge/Last_Updated-18--11--23-blue.svg?style=flat> <https://img.shields.io/badge/Words-769-red.svg?style=flat> <https://img.shields.io/badge/Read-3_min-ff69b4.svg?style=flat>

## Reference

\[0] [the-book-of-secret-knowledge](https://github.com/trimstray/the-book-of-secret-knowledge)

\[1]【清华计算机网络课程：计算机网络体系结构】
