From Fedora Project Wiki
(Created page with "{{autolang}} '''Cryptographic technology''' helps provide security and privacy by allowing you to encrypt and sign electronic communications. Fedora includes the [http://openssh...")
 
(修改标题 修改http为https 链接页面)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:密码学}}
{{autolang}}
{{autolang}}
'''Cryptographic technology''' helps provide security and privacy by allowing you to encrypt and sign electronic communications.  Fedora includes the [http://openssh.org/ OpenSSH] and [http://gnupg.org/ GnuPG] tools for cryptographic communications.  [[Software/LUKS| LUKS]] has also been integrated with Fedora to provide hard disk encryption.
'''加密技术''' 为你的谈话和文件保障了安全和隐私。Fedora 内置了两个有关工具: [http://openssh.org/ OpenSSH] [https://gnupg.org/ GnuPG] [[Software/LUKS/zh-cn| LUKS]] 也被整合进入了Fedora以便提供硬盘加密功能。


== The Theory ==
== 原理 ==


OpenSSH and GnuPG use a common cryptographic theory to allow encryption and cryptographic signatures based upon public and private keys.  In this theory, each person or organization has one or more private keys, and each private key has a corresponding public key.  The private key is required to decrypt data and create signatures.  The public key can be shared freely and is used to encrypt data and verify signatures.  More information about how and why this works can be found on the [http://openssh.org/ OpenSSH] and [http://gnupg.org/ GnuPG] websites.
OpenSSH和GnuPG使用通用的加密理论来允许基于公钥和私钥的加密和加密签名。 在该理论中,每个人或组织具有一个或多个私钥,并且每个私钥具有相应的公钥。 必须通过私钥来解密数据和创建签名。 公钥可以自由共享,用于加密数据和验证签名。 更多关于如何运作以及为什么如此运作的原理,请访问[http://openssh.org/ OpenSSH][https://gnupg.org/ GnuPG]网站。


== OpenSSH ==
== OpenSSH ==


OpenSSH is an SSH implementation included in Fedora.  SSH (Secure SHell) allows encrypted and cryptographically authenticated connections between computers.
OpenSSH是Fedora中包含的SSH实现。SSH(Secure SHell)允许在计算机之间进行加密和加密认证的连接。
=== 安装 OpenSSH ===


=== Installing OpenSSH ===
默认情况下,OpenSSH通常包含在Fedora安装中。 如果你还没有安装它,你可以使用dnf或yum来安装软件包:
 
OpenSSH is usually included by default on Fedora installations.  If you do not already have it installed, you can install the package using yum:


<pre>dnf install openssh</pre>
<pre>yum install openssh</pre>
<pre>yum install openssh</pre>


=== Creating SSH Keys ===
=== 生成 SSH 密钥 ===


Once SSH is installed, you can use <code>ssh-keygen</code> to create your private and public keys:
安装SSH后,你可以使用<code>ssh-keygen</code>创建私钥和公钥:


<pre>ssh-keygen -t rsa</pre>
<pre>ssh-keygen -t rsa</pre>


You will be prompted for a location (pressing Enter uses the default. You may wish to name this something specific if you are using this key to access some specific set of machines), and a passphrase.  Choose a good passphrase that you won't forget.
系统将提示你输入密钥存储路径位置(按Enter键将使用默认路径。如果你使用此密钥来访问某些特别的计算机组,你可以使用特别的名称命名密钥)还有密码。 选择一个你不会忘记的密码(不容易破解)。


{{admon/warning|You must remember this passphrase!|If you forget it, you will not be able to recover it, and you will not be able to access anything using your key.  You would then have to create a new key and share the new public key with anyone who had your old one.}}
{{admon/warning|你必须记住这个密码!|如果你忘了它,你将无法恢复它,并且你将无法使用你的密钥访问任何东西。 然后,你必须创建一个新密钥,并与拥有老密钥的人共享新的公钥。}}


For usage instructions for <code>ssh-keygen</code>, run <code>man ssh-keygen</code> to view the manual.
关于<code>ssh-keygen</code>的使用说明,请运行 <code>man ssh-keygen</code>来查看帮助手册。


By default, your new private and public keys will be stored in <code>~/.ssh/id_rsa</code> and <code>~/.ssh/id_rsa.pub</code>, respectively.
默认情况下,新的私钥和公钥将分别存储在<code>~/.ssh/id_rsa</code> <code>~/.ssh/id_rsa.pub</code>中。


You can share your public key openly.  Server administrators can use it to grant you access to their systems.  You should carefully protect your private key and not share it with anyone.
你可以公开分享你的公钥。 服务器管理员可以使用它授予你访问其系统的权限。 你应该小心保护你的私钥,不要与任何人分享。


You can use your ~/.ssh/config file to determine which key is used for which hosts:  
You can use your ~/.ssh/config file to determine which key is used for which hosts:  
你可以使用 ~/.ssh/config 文件来确定哪个密钥用于哪些主机:


<pre>
<pre>
Line 39: Line 42:
</pre>
</pre>


see 'man ssh_config' for more information.
有关更多信息,请参阅<code>man ssh_config</code>。


Additional information is available at:
更多信息,请访问:


* http://openssh.org/
* http://openssh.org/
Line 47: Line 50:
== GnuPG ==
== GnuPG ==


The GNU Privacy Guard (GnuPG or GPG) is a generic cryptographic tool.  GPG is often used to sign email messages, and the Fedora Project uses it to sign packages.
GNU Privacy Guard(GnuPG或GPG)是一种通用的加密工具。 GPG通常用于签署电子邮件消息,Fedora项目使用它来签署包。


=== Installing GnuPG ===
=== 安装 GnuPG ===


GnuPG is included in Fedora.  It can be installed using yum:
GnuPG包含在Fedora中。 它可以使用dnf或yum安装:


<pre>dnf install gnupg</pre>
<pre>yum install gnupg</pre>
<pre>yum install gnupg</pre>


=== Creating GPG Keys ===
=== 创建GPG密钥 ===
 
GPG密钥创建比SSH密钥创建更复杂,许多人更喜欢使用图形界面,例如在KDE上使用<code>kgpg</code>,或者在GNOME上使用<code>seahorse</code>。  <code>kgpg</code>可在<code>kdeutils</code>包中找到。<code>seahorse</code>位于Fedora存储库中。
 
有关详细的命令行说明,请参阅Fedora文档项目中的[[Creating_GPG_Keys/zh-cn|创建GPG密钥]]。
 
更多信息,请访问:


GPG key creation is more complex than SSH key creation, and many people prefer to use a graphical interface such as <code>kgpg</code> on KDE or <code>seahorse</code> on GNOME. <code>kgpg</code> is available in the <code>kdeutils</code> package.  <code>seahorse</code> is in the Fedora repository.
* https://gnupg.org/


See [[Creating GPG Keys]] from the Fedora Documentation Project for detailed command line instructions.
== 磁盘和文件加密==


Additional information is available at:
Fedora提供全盘加密,可以在安装时选择,也支持透明加密目录,也支持使用各种实用程序来加密单个文件。


* http://gnupg.org/
有关概述,请参见[[Disk_and_File_Encryption/zh-cn|磁盘和文件加密]]。


[[Category:Documentation]]
[[Category:Informal_Documentation]]
[[Category:Encryption]]

Latest revision as of 13:36, 9 February 2019

加密技术 为你的谈话和文件保障了安全和隐私。Fedora 内置了两个有关工具: OpenSSHGnuPG LUKS 也被整合进入了Fedora以便提供硬盘加密功能。

原理

OpenSSH和GnuPG使用通用的加密理论来允许基于公钥和私钥的加密和加密签名。 在该理论中,每个人或组织具有一个或多个私钥,并且每个私钥具有相应的公钥。 必须通过私钥来解密数据和创建签名。 公钥可以自由共享,用于加密数据和验证签名。 更多关于如何运作以及为什么如此运作的原理,请访问OpenSSHGnuPG网站。

OpenSSH

OpenSSH是Fedora中包含的SSH实现。SSH(Secure SHell)允许在计算机之间进行加密和加密认证的连接。

安装 OpenSSH

默认情况下,OpenSSH通常包含在Fedora安装中。 如果你还没有安装它,你可以使用dnf或yum来安装软件包:

dnf install openssh
yum install openssh

生成 SSH 密钥

安装SSH后,你可以使用ssh-keygen创建私钥和公钥:

ssh-keygen -t rsa

系统将提示你输入密钥存储路径位置(按Enter键将使用默认路径。如果你使用此密钥来访问某些特别的计算机组,你可以使用特别的名称命名密钥)还有密码。 选择一个你不会忘记的密码(不容易破解)。

Warning.png
你必须记住这个密码!
如果你忘了它,你将无法恢复它,并且你将无法使用你的密钥访问任何东西。 然后,你必须创建一个新密钥,并与拥有老密钥的人共享新的公钥。

关于ssh-keygen的使用说明,请运行 man ssh-keygen来查看帮助手册。

默认情况下,新的私钥和公钥将分别存储在~/.ssh/id_rsa~/.ssh/id_rsa.pub中。

你可以公开分享你的公钥。 服务器管理员可以使用它授予你访问其系统的权限。 你应该小心保护你的私钥,不要与任何人分享。

You can use your ~/.ssh/config file to determine which key is used for which hosts:

你可以使用 ~/.ssh/config 文件来确定哪个密钥用于哪些主机:

HOST *.fedoraproject.org fedorapeople.org *.fedorahosted.org
     IdentityFile ~/.ssh/id_rsa_fedora

有关更多信息,请参阅man ssh_config

更多信息,请访问:

GnuPG

GNU Privacy Guard(GnuPG或GPG)是一种通用的加密工具。 GPG通常用于签署电子邮件消息,Fedora项目使用它来签署包。

安装 GnuPG

GnuPG包含在Fedora中。 它可以使用dnf或yum安装:

dnf install gnupg
yum install gnupg

创建GPG密钥

GPG密钥创建比SSH密钥创建更复杂,许多人更喜欢使用图形界面,例如在KDE上使用kgpg,或者在GNOME上使用seahorsekgpg可在kdeutils包中找到。seahorse位于Fedora存储库中。

有关详细的命令行说明,请参阅Fedora文档项目中的创建GPG密钥

更多信息,请访问:

磁盘和文件加密

Fedora提供全盘加密,可以在安装时选择,也支持透明加密目录,也支持使用各种实用程序来加密单个文件。

有关概述,请参见磁盘和文件加密