AES-256-CBCを使用したSSHペアの作成

AES-256-CBCを使用したSSHペアの作成

いいですね。 SSHペアを作成するのは簡単です。しかし、AES-256-CBCを使用できるSSHペアをssh-keygen作成するにはどうすればよいですか?ssh-keygen

デフォルトのパラメータは常にAES-128-CBCです。他のパラメータを試しましたが、次のようには機能しません。

ssh-keygen -b 4096 -t rsa -Z aes-256-cbc

しかし、彼らは仕事を持っていません。何をすべきか知っていますか?

ベストアンサー1

あなたはそうですいいえaes使用時に使用するキーを生成しますssh-keygen。なぜならaes対称パスワード、その鍵はいいえペアとして表示されます。通信の両端は同じキーを使用します。

ssh-keygenで生成されたキーの使用公開鍵暗号化認証に使用されます。ssh-keygenマニュアルから:

 ssh-keygen generates, manages and converts authentication keys for
 ssh(1).  ssh-keygen can create RSA keys for use by SSH protocol version 1
 and DSA, ECDSA, Ed25519 or RSA keys for use by SSH protocol version 2.

sshマニュアルから:

 Public key authentication works as follows: The scheme is based on
 public-key cryptography, using cryptosystems where encryption and
 decryption are done using separate keys, and it is unfeasible to derive
 the decryption key from the encryption key.  The idea is that each user
 creates a public/private key pair for authentication purposes.  The
 server knows the public key, and only the user knows the private key.
 ssh implements public key authentication protocol automatically, using
 one of the DSA, ECDSA, Ed25519 or RSA algorithms.

公開鍵暗号化の問題は、速度が非常に遅いことです。対称鍵暗号化はより速く、ssh実際のデータ転送に使用されます。対称暗号化に使用される鍵は、接続が確立された後に動的に生成されます(マニュアルの引用sshd)。

 For protocol 2, forward security is provided through a Diffie-Hellman key
 agreement.  This key agreement results in a shared session key.  The rest
 of the session is encrypted using a symmetric cipher, currently 128-bit
 AES, Blowfish, 3DES, CAST128, Arcfour, 192-bit AES, or 256-bit AES.  The
 client selects the encryption algorithm to use from those offered by the
 server.  Additionally, session integrity is provided through a
 cryptographic message authentication code (hmac-md5, hmac-sha1, umac-64,
 umac-128, hmac-ripemd160, hmac-sha2-256 or hmac-sha2-512).

これを使用するには、aes256-cbc-cオプションを使用してコマンドラインで指定する必要があります。最も基本的な形式は次のとおりです。

$ ssh -c aes256-cbc user@host

ssh_configカンマ区切りリストを使用して、必要なパスワードを指定することもできます。ただし、デフォルト値を変更することは専門家に任せるのが最善であるため、お勧めできません。 OpenSSH開発者は、デフォルト値を選択する際のさまざまな要素と長年の経験を考慮しています。

おすすめ記事