Score:0

how does wireguard encrypted verifies with public key

cn flag

After stumbling upon this question, I wondered if I could obtain a behaviour similar to WireGuard (private and public keys) by using the same WireGuard private key to encrypt a message via OpenSSL in one end, and having the other end being able to verify that message signature by possessing the WireGuard public key. So it could work as some sort of authentication/validation for a request.

For example:

  1. Bob encrypts message foobar with his WireGuard private key
  2. The result is U2FsdGVkX19nhSv3cEBJw4gKSZGzFpE=
  3. Bob sends a request to Alice with the result from step 2.
  4. Alice confirms result is signed by Bob by verifying with his public WireGuard key;
  5. Alice allows the request to pass based on Bob's signature;

I am sorry if I am talking a lot of nonsense here, as I am still trying to learn about encryption and got fascinated by reading a few articles about how WireGuard being really fast, etc. So I believe the exercise above would help me to get to know more about it.

So far I could understand I could encrypt a message with a specifc cypher like chacha2 like:

echo foobar | openssl enc -chacha20 -a -k foo

But I don't understand if the password would be the private key for example, or that is something completely different. Any suggestions for reading material would also be very welcome.

Thank you.

Maarten Bodewes avatar
in flag
This doesn't make much sense (as you already suspected). Signing is not the same as encryption with the private key. The encryption that you show is symmetric encryption which uses a secret key, not a private key and there wouldn't be a public key. If you supply a password to a high level encryption method then it generally uses a Password Based Key Derivation Function (PBKDF) and generates a key which is then used to perform the actual encryption / decryption.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.