重用公钥/私钥
我正在编写一个旨在通过本地 WiFi 网络使用的程序。为了提供一些安全性,我正在考虑让设备通过本地 https 连接。使用 openssl 生成一个自签名密钥对,然后分发使用完全相同的私钥和公钥的软件包是否被认为是一种常见做法?
I am writing a program that is meant to be used over a local wifi network. With the intention of providing some security, I am considering to have devices connect over local https. Is it considered to be common practice to generate one self signed key pair using openssl, then distribute a software package that uses that exact same private and public key?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会说不,因为可以从软件包中提取密钥,并且可以解密数据。
您应该在安装软件包后生成一个密钥,这样它对于安装来说是唯一的。
I would say no, because the key can be extracted from the software package, and the data can be decrypted.
You should generate a key after installing the package, so that it would be unique to the installation.
私钥只能由创建者使用。如果您将私钥分发给任何其他方,它就会受到损害,并且您无法保证使用此密钥的任何安全性。
所以答案是:您应该在每个客户端上生成密钥对并仅分发公钥。即使在这种情况下,您也应该了解存在“中间人”攻击的风险。
Private key must be used only by person who created it. If you distribute private key to any other side it becomes compromised and you can't guarantee any security with utilizing this key.
So the answer is: you should generate key pair on each client and distribute only public keys. And even in this case you should understand that there is a risk of "man-in-the-middle" attack.