keybase / keybase-issues

A single repo for managing publicly recognized issues with the keybase client, installer, and website.
902 stars 37 forks source link

Uploading private Key Error: Error: unknown cipher: 2 #442

Closed plaetzchen closed 10 years ago

plaetzchen commented 10 years ago

Hi,

Tried to upload a private key (made with GPGTools on Mac) and got this error "Error: Error: unknown cipher: 2" and I could not save anything.

Philip

maxtaco commented 10 years ago

That means your key is encrypted with triple-des, which is pretty out-of-date. Can you update your key on the client side? We just never implemented triple-des because we thought people weren't using it much these days. Thanks.

plaetzchen commented 10 years ago

Could you give me an example how to do this?

maxtaco commented 10 years ago

Which version of GPG are you running locally?

plaetzchen commented 10 years ago

gpg (GnuPG/MacGPG2) 2.0.22 libgcrypt 1.5.3 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

maxtaco commented 10 years ago

First backup your key.

gpg -a --export-secret-key <your-key-id> > some-secret-file

Now read and save it with the new algo. You'll need to "reset your password" but feel free to leave it as is:

gpg --edit-key --s2k-cipher-algo=AES <your-key-id> password

If that works, you can throw away the backup.

plaetzchen commented 10 years ago

Works! Great thank you for your quick help!

RulerOf commented 7 years ago

Working on CentOS 6.8 with gpg version 2.0.14, the re-ciphering process is:

gpg --s2k-cipher-algo <name> --edit-key <keyid>

Then run the passwd command in the gpg CLI, and supply old/new passwords. Then re-export.

A list of algorithms and a longer explanation is available on the gpg mailing list here: https://lists.gnupg.org/pipermail/gnupg-users/2010-October/039737.html