DiffieHellman Secret Key Exchange

本文介绍了一种用于安全地在两个用户间交换密钥的算法。该算法利用公开参数素数q和g作为原始根来生成私有密钥。通过交换公开计算值,双方能够独立计算出相同的私有密钥,用于后续的消息加密。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The purpose of this algorithm is to enable two users to exchange a key securely that can then be used for subsequent encryption of messages. The algorithm itself is limited to the exchange of keys.

Two publicly known parameters:

1.prime number q

2.integer g that is primitive root of q.

Using these two parameters, suppose two users A and B want to exchange a key. Respectively A and B generate their own private key Xa and Xb. (Xa<q, Xb<q). Calculate Ya=g^Xa mod q, Yb=g^Xb mod q. A sends Ya to B. B sends Yb to A. Now they can calculate the private as follows:

                                     A:   Yb^Xa mod q=(g^Xb mod q)^Xa mod q=g^(Xb*Xa) mod q

                                     B:   Ya^Xb mod q=(g^Xa mod q)^Xb mod q=g^(Xa*Xb) mod q

转载于:https://www.cnblogs.com/songwanzi/p/3415170.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值