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:
- Bob encrypts message
foobar
with his WireGuard private key
- The
result
is U2FsdGVkX19nhSv3cEBJw4gKSZGzFpE=
- Bob sends a request to Alice with the result from step 2.
- Alice confirms
result
is signed by Bob by verifying with his public WireGuard key;
- 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.