This is great. Here is a short guide for beginners if you would like to learn how to create your own Wireguard keys without having to save data to disk, but still view it on the screen.
Generating WireGuard Keys on Windows 11 Without Admin Privileges
Why This Method?
No Disk Writes: Sensitive keys are not written to disk, reducing the attack surface.
Clipboard Isolation: The keys are isolated in the clipboard temporarily, limiting exposure.
Immediate Inspection: You can directly paste and inspect the keys in Notepad++, without them ever touching the filesystem.
Prerequisites
Windows 11 machine
WireGuard utilities installed
Notepad++ installed
Steps
Open Command Prompt
Open a standard Command Prompt window. No need for admin privileges.
Generate Private Key and Copy to Clipboard
wg genkey | clip
This pipes the generated private key directly to the clipboard.
Paste Private Key in Notepad++
Open Notepad++.
Paste the private key and save the file as privatekey (optional).
Generate Public Key
echo "<private_key_here>" | wg pubkey
Replace <private_key_here> with the actual private key. This will display the public key in the console.
Copy Public Key
Manually select and copy the public key from the console output.
Paste Public Key in Notepad++
Open a new tab in Notepad++.
Paste the public key and save the file as publickey (optional).
Generating WireGuard Keys on Ubuntu Without Disk Writes
Why This Method?
No Disk Writes: Keys aren't written to disk, reducing potential attack vectors.
Clipboard Isolation: Temporarily holds the keys in the clipboard to minimize exposure.
Immediate Inspection: Keys can be pasted into a text editor like vim or nano for immediate inspection, never touching the filesystem.
Generating WireGuard Keys on Windows 11 Without Admin Privileges
Why This Method?
Prerequisites
Steps
privatekey
(optional).<private_key_here>
with the actual private key. This will display the public key in the console.publickey
(optional).Generating WireGuard Keys on Ubuntu Without Disk Writes
Why This Method?
vim
ornano
for immediate inspection, never touching the filesystem.Prerequisites
sudo apt install wireguard-tools
)xclip
installed for clipboard operations (sudo apt install xclip
)Steps
Open a terminal window. No need for root privileges.
vim
ornano
.Ctrl-Shift-V
in terminal) and save the file asprivatekey
if needed.<private_key_here>
with the actual private key. The corresponding public key will be displayed in the terminal.publickey
if needed.