Most security keys can’t act as GPG smart cards, other than Yubikeys. So I only buy Yubikeys. An encryption, authentication and sign keg in a Yubikey is very useful. Does anyone know if a Wireguard secret key could be transferred to Yubikey?
It seems like you can by using the PIV applet found in yubikeys: https://www.procustodibus.com/blog/2023/02/wireguard-yubikey... You can read more about the type of cryptography that wireguard uses here: https://www.wireguard.com/protocol/
But I have to admit that there is probably no way to do that properly. If Wireguard key is in Yubikey, every packet has to go to Yubikey for encryption and decryption. That doesn’t work!
The usual recommendation is to encrypt the Wireguard key with pass or gpg. But an attacker that can access a Wireguard key in /etc/Wireguard must have root access. Such attacker would have access to stdout put by Gpg and could read the key. It could also dump the memory and read the key from there.