1、对称密钥密码体系(密钥密码体系)
- 消息发送方和消息接收方必须使用相同的密钥,该密钥必须保密
- 发送方用该密钥对待发送的消息进行加密,然后将消息发送给接收方
- 接收方使用相同的密钥对接收到的消息进行解密
2、非对称密钥密码体系(公钥密码体系)
- 使用两个密钥:一个公共密钥和一个私有密钥
- 这两个密钥在数学上是相关的,不能由公钥计算出对应的私钥,同样也不能由私钥计算出对应的公钥--公钥可以所以发布,私钥只有自己知道
- 发送密文的一方使用对方的公钥进行加密处理
- 对方接受到加密信息后,使用自己的密钥进行解密
3、对称密钥体系和非对称密钥体系的比较
- 非对称加密的方式不需要发送用来解密的密钥,可以保证安全性
- 和对称加密相比,非对称加密发送消息比较慢
- 偏向使用对称加密来发送消息,但是对称加密所使用的密钥可以使用非对称加密的方式发送出去
【附】数字证书
数字证书是经过权威机构(CA)认证的公钥,通过查看证书可以知道证书:证书的签发机构、证书的使用人以及以及使用人的公钥
数字证书的特点:
- 由专门的机构签发的数字证书才安全有效
- 签发数字证书收费
- 不会被冒充,安全可信
- 数字证书有使用期限,过期证书不可用。CA也可以在试用期内,对证书进行作废处理