I've created a GPG key on a newly installed Debian virtual machine. I've noticed that most keys I've seen begin with 0x, however the one I created doesn't. I selected 'RSA (set your own capabilities)' with a 4096 bit key size. Should I create again this key?

  • could it be that you used different tools to view the keys each time? 0x is often a prefix to indicate that what follows is a hex string (base 16), eg. 0xABBA is actually only 2 bytes: 171 (ab) and 186 (ba) - here's a good article on the topic JIMBLOM '?? – brynk Apr 5 at 22:26

most keys I've seen begin with 0x

I assume you are referring to the Key ID, and the 0x is not part of the actual key ID, but merely a display option indicating that the string of digits are hexadecimal (which all Key ID's are, including yours, regardless of whether they are prepended with "0x").

Should I create again this key?

No. The key is fine.

If you want GnuPG to display your keys with the "0x" you can add the option keyid-format 0xlong to your gpg.conf file.

If the gpg.conf file is not already present in your home directory's .gnupg/ directory, you can create it with bash:

echo 'keyid-format 0xlong' > $HOME/.gnupg/gpg.conf
  • Great! Thank you. I wanted to be certain, since I hope to use the key for a long time. – nobody Apr 6 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.