DSA 与 RSA:如何区分

发布于 2024-11-06 18:06:07 字数 73 浏览 0 评论 0原文

是否有人可以使用工具来区分 RSA 公钥与 DSA 公钥?我有两个 SSH .pub 文件,我需要知道它们是 RSA 还是 DSA。

Does anyone have a tool to use in order to differentiate an RSA public key vs a DSA public key? I have two SSH .pub files and i need to know if they're RSA or DSA.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

原来分手还会想你 2024-11-13 18:06:07

您可以使用 ssh-keygen 获取指纹并从 .pub 文件中输入:

ssh-keygen -lf id_rsa.pub

You can use ssh-keygen to get a fingerprint and type out of a .pub file:

ssh-keygen -lf id_rsa.pub
人│生佛魔见 2024-11-13 18:06:07

正如另一个答案中所述,由于文件是 SSH.COM 格式,因此您可以转换为 openssh 格式,然后打开文件以检查 ssh-dsa 或 ssh-rsa :

To convert your SSH.COM key to OpenSSH format use:

ssh-keygen -i -f ssh_key.pub

From the ssh-keygen manpage

 -i   This option will read an unencrypted private (or public) key
      file in SSH2-compatible format and print an OpenSSH
      compatible private (or public) key to stdout.  ssh-keygen
      also reads the `SECSH Public Key File Format'.  This option
      allows importing keys from several commercial SSH
      implementations.
 -f  Specifies the filename of the key file.

来源:http://landru.uwaterloo.ca/cgi-bin/wiki.pl?OpenSSH_-_SSH.Com_Interoperability

As noted in the other answer, since the file is in SSH.COM format, you can convert to openssh format and just open the file to check for ssh-dsa or ssh-rsa:

To convert your SSH.COM key to OpenSSH format use:

ssh-keygen -i -f ssh_key.pub

From the ssh-keygen manpage

 -i   This option will read an unencrypted private (or public) key
      file in SSH2-compatible format and print an OpenSSH
      compatible private (or public) key to stdout.  ssh-keygen
      also reads the `SECSH Public Key File Format'.  This option
      allows importing keys from several commercial SSH
      implementations.
 -f  Specifies the filename of the key file.

Source: http://landru.uwaterloo.ca/cgi-bin/wiki.pl?OpenSSH_-_SSH.Com_Interoperability

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文