---
title: "数字签名与消息认证"
description: "数字签名写借条，就算借条丢了也能还原（王继林教授说支付宝就用的这个数字签名）"
canonical_url: "https://yangqiuyi.com/blog/da-xue/xin-xi-an-quan/shu-zi-qian-ming-yu-xiao-xi-ren-zheng"
---

> Index of every page on this site: [llms.txt](https://yangqiuyi.com/llms.txt)

数字签名写借条，就算借条丢了也能还原（王继林教授说支付宝就用的这个数字签名）

## 定义

以电子形式模拟搜狐写签名（hand-written signature）

- Unforgeability
不可伪造
- Undeniability
不可抵赖

**Requirements:**

- 依赖于被签署的文件
- 快速计算（compute）
- 任何人都能验证
- 易于存储
should be short enough

## Attacks on digital signature

**Attack type：**

- key-only attack
只知道公钥，想办法伪造（攻击难度大，所以比较容易防治）
- Known-message attack
已知一部分消息及其签名，对新消息使用就签名想办法伪造
- Chosen-message attack
对相似消息的签名进行分析，想办法签名新的消息

对于上面这个无序列表，某个方案能抗击下面的攻击，则必然能抗击上面的攻击。

## 流程

signer使用私钥对msg签名，验证者使用signer的公钥对签名进行验证

**Usage：**
off-line：签名
on-line：验证

a想要验证b是不是b，则对b发送m，b使用b的私钥对m进行签名，a使用b的公钥对m的签名进行验证，如果b是真的b，则验证通过，反之通不过
**Digital Signature Law is Infrastructure**

## 算法

- 基于纠错码
- 基于椭圆切线
- 基于 two hard problem
典型的：

  1. RSA（基于大数分解）
  消息可能很大，所以需要先hash下，变成256位，再签名
  现在一般是使用sha-256进行hash
  2. ElGamal（离散对数）

**E-cash：**
电子签名，基于盲签名

## Sitemap

See the full [sitemap](https://yangqiuyi.com/sitemap.md) for all pages.
