Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show keygrips #50

Open
orhun opened this issue Dec 2, 2022 Discussed in #48 · 4 comments
Open

Show keygrips #50

orhun opened this issue Dec 2, 2022 Discussed in #48 · 4 comments
Labels
feature/tui New feature for TUI good first issue Good for newcomers

Comments

@orhun
Copy link
Owner

orhun commented Dec 2, 2022

Discussed in #48

Originally posted by dievilz October 12, 2022
I would love to see the keygrips inside the TUI. That way, I think this program would be even more efficient than already is, at least for me 🤘🏻. And include the respective setting in the config. file too.
I don't think this feature is implemented and I don't know if it is out of scope, but still I'll make the request 😅.
I would love to contribute and make a pull request but sadly I know nothing about Rust :c

@orhun orhun added the feature/tui New feature for TUI label Dec 2, 2022
@orhun orhun added the good first issue Good for newcomers label Oct 10, 2023
@bsodmike
Copy link

bsodmike commented Jul 8, 2024

I'll try picking this up soon :)

@orhun
Copy link
Owner Author

orhun commented Jul 27, 2024

Hey @bsodmike! Are you still interested in working on this? I'm happy to guide with the implementation 🐻

@bsodmike
Copy link

Hey @bsodmike! Are you still interested in working on this? I'm happy to guide with the implementation 🐻

Hey, sure, please let me know what you have planned :)

@orhun
Copy link
Owner Author

orhun commented Jul 28, 2024

Apparently a keygrip is:

This term is used by GnuPG to describe a 20 byte hash value used to identify a certain key without referencing to a concrete protocol. It is used internally to access a private key. Usually it is shown and entered as a 40 character hexadecimal formatted string.

The key grip is (as a first approximation) a hash of the public key material. This is different from the fingerprint, which is a hash of the public key material and some meta-data (in particular, the packet's version, and the key's creation time). This means that if two keys have the same public key material, but different meta-data, then they will have different fingerprints, but the same key grip. As I understand it, the key grip is a gpg invention, which has to do with how gpg-agent works. There's no standard, and no other OpenPGP implementation really uses it.

You can see an example here:

$ gpg -k --with-keygrip

pub   rsa4096 2023-09-28 [SC]
      7545E677A4449CD72A2E3F71930FCF192DECE98B
      Keygrip = FF886AD832FAC91A5AF498434C2DF0D3F8730E5A
uid           [ultimate] daktilo <[email protected]>
sub   rsa4096 2023-09-28 [E]
      Keygrip = 5A16A03CAF1FDE48154F8FF7D9767C48F07A93F4

We can access these values via Subkey::keygrip function in Rust.

So the question is how should we display them?

Well, key fingerprint and keygrip has the same length so we can add a new command (e.g. keygrip) to show keygrips instead. Or we can show it in the 2nd detail level, somewhere.

You need to play around a bit to find out which one looks better :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/tui New feature for TUI good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants