新しいシステム(空のパスワードは入力できません)ソフトウェアバージョン:

新しいシステム(空のパスワードは入力できません)ソフトウェアバージョン:

パスワードを使用していない古いGPGバージョンのGPG設定があります。プロンプトが表示されたら、Enterのみを入力します。これは、鍵が暗号化されていないことを意味するのか、空のパスワードで暗号化されたのかは不明です。

とにかく最近私に送信されたものを復号化しようとすると、gpgは私の秘密鍵にアクセスする必要があり、パスワードの入力を求められますが、もはや空のパスワードを使用できなくなりました。 gpgは次のように失敗します:

$ gpg -d foo.asc
(X dialog that prompts me for passphrase, I just press enter)
gpg: public key decryption failed: No passphrase given
gpg: decryption failed: No secret key

私のキーを再利用したいです。これからパスワードを設定しても構いませんが、どうすればいいかわかりません。

$ gpg --passwd [email protected]
(X dialog that prompts me for current passphrase, I just press enter)
gpg: key xxxxxxxxxxxxxxxx/aaaaaaaaaaaaaaaa: error changing passphrase: No passphrase given
gpg: key xxxxxxxxxxxxxxxx/bbbbbbbbbbbbbbbb: error changing passphrase: No passphrase given
gpg: error changing the passphrase for '[email protected]': No passphrase given

私はopenSUSE 15.0でgpg(GnuPG)2.2.5とlibgcrypt 1.8.2を実行しています。

ベストアンサー1

私はキーを持つ古いシステムを使用してこの問題を解決しました。

  • 空のパスワード入力が機能していた古いシステムに新しいパスワードを設定しました。
  • 古いシステム秘密鍵をエクスポートして新しいシステムにコピーします。
  • 新しいシステムのgpgステータスをクリーンアップします(.gnupgを.gnupg.bakに移動します)。
  • 空でないパスワード秘密鍵を取得する

私が実行したコマンドは次のとおりです。

# put a non-empty passphrase on current key
me@old$ gpg --passwd [email protected]
(leave empty on first prompt)
(put a new non-empty passphrase on 2nd)
(confirm new passphrase)

# now we export it

me@old$ gpg --list-secret-keys                               
/home/xxxxx/.gnupg/secring.gpg
-------------------------------
sec   4096R/AAAAAAAA 2015-01-01
uid                  Foo Bar <[email protected]>
uid                  Bar Foo <[email protected]>
ssb   4096R/BBBBBBBB 2015-01-01

# I've used the first key id (should be 8 hex digits)
me@old$ gpg --export-secret-keys AAAAAAAA > priv.key

# copy key over new system

# backup .gnupg dir just in case
me@new$ mv .gnupg .gnupg.back
# import new priv key
me@new$ gpg --import priv.key
(type new passphrase set previously)

# done!

完全性を期すために、両方のシステムのソフトウェアバージョンは次のとおりです。誰かに役立つかもしれません。

新しいシステム(空のパスワードは入力できません)ソフトウェアバージョン:

  • gpg(GnuPG) 2.2.5
  • libgcrypt 1.8.2
  • pinentry-curses (pinentry) 1.1.0

古いシステム(空のパスワードを入力できます)ソフトウェアバージョン:

  • gpg(GnuPG) 2.0.24
  • libgcrypt 1.6.1
  • pinentry-curses (pinentry) 0.8.3

おすすめ記事