用于加密的公共密钥;私钥解密? [英] public key for encryption; private key for de-cryption?

查看:73
本文介绍了用于加密的公共密钥;私钥解密?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解到,私钥和公钥在数学上是相关的,用一个密钥加密的数据只能用另一个密钥解密.我的问题是,私钥始终用于加密数据,而公钥始终用于解密数据?或者可以是反之,如果可以的话,您可以举一些示例应用程序在其他方向使用的示例(用于加密的公共密钥和用于解密的私有密钥)?

I understand that private and public keys are mathematically related and data encrypted with one key can only be decrpyted with other. My question is that private key is always used to encrypt data whereas public key is always used to de-crypt it? Or can be be vice-vera and if so can you give some example application where its used in other direction (public key to encrypt and private key to decrypt)?

推荐答案

它是可互换的.

数字签名->私钥加密,公钥解密,以便验证发件人.

Digital Signature -> Private key encrypts, public key decrypts so to verify sender.

发送消息->公钥加密,私钥解密,所有者读取消息.

Send a message -> Public key encrypts, private decrypts and owner reads the message.

人们似乎不同意可互换"的定义.我需要澄清的是,我所说的是操作的数学观点,而不是安全性方面的最佳观点.Ofc,您应该使用按键进行预期的操作.

People seem to disagree with the "Interchangeable" definition. I need to clarify that I am talking about the mathematical perspective of the operation, not what is best in terms of security. Ofc, you should use keys for their intended operation.

但是,SO线程中的HenrickHellström响应解释了为什么它们可以在数学上互换:公钥和私钥可以互换吗?

However, Henrick Hellström response in SO thread explains why they are interchangeable mathematically : Are public key and private key interchangeable?

这篇关于用于加密的公共密钥;私钥解密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆