コマンドラインツールpwgen
を使用してパスワードを生成しています。これは、sha1
コマンドラインフラグを使用した場合の再現性が気に入っているためです。manページを引用するには:
-H, --sha1=/path/to/file[#seed]
Will use the sha1's hash of given file and the optional seed to
create password. It will allow you to compute the same password
later, if you remember the file, seed, and pwgen's options used.
ie: pwgen -H ~/your_favorite.mp3#your@email.com gives a list of
possibles passwords for your pop3 account, and you can ask this
list again and again.
WARNING: The passwords generated using this option are not very
random. If you use this option, make sure the attacker can not
obtain a copy of the file. Also, note that the name of the file
may be easily available from the ~/.history or ~/.bash_history
file.
これを使用して、次のようなパスワードを生成(および取得)します。
pwgen -1cnsy --sha1=/path/to/my/gpg/private-key.asc#username@example.com
唯一の問題は、パスワードに必要な文字数を指定する方法がわからないことです。デフォルトでは8文字のパスワードを生成します。これはブルートフォース攻撃の影響を受けやすくなります。
または、apg
文字数を指定できるを使用することもできますapg
が、ファイルと文字列をシードとして使用して繰り返し可能な文字を取得する方法がわかりません。
pwgen
指定した長さのパスワードを生成する方法はありますか?
このような秘密鍵を使用すると、危険にさらされます。変更されないランダムファイルを使用することをお勧めします(彼らが言及するMP3など)。または、このアドバイスを使用してください(文字通りではありません!)。
—
フォンブランド2013年
このような秘密キーを使用すると、どのように危険にさらされますか?暗号は元に戻せませんよね?
—
ケリック
破壊される可能性のあるプログラムによって読み取られています。リスクは最小限ですが、なぜリスクを冒すのか...
—
フォンブランド2013年