Generated for you
snippet at the bottom of this page.
It is 24 bytes from
Crypto.getRandomValues, base64 encoded to create a 32
With this snippet, the private key stays securely in your browser. If you wish to generate it on your own system, use one of the Generation methods below.
The Regenerate button will generate a new, random PSK when clicked.
Use the following methods to generate a strong 32-character shared secret.
Run the following OpenSSL command on a Linux or macOS system to generate a shared secret:
openssl rand -base64 24
On Linux or macOS, use
/dev/urandom as a pseudorandom source for generating a
- On Linux or macOS, you can send the random input to
head -c 24 /dev/urandom | base64
- You can pass the random input through a hashing function, like sha256:
- On Linux:
head -c 4096 /dev/urandom | sha256sum | cut -b1-32
- On macOS:
head -c 4096 /dev/urandom | openssl sha256 | cut -b1-32
- On Linux:
The code below will create an array of 24 random bytes, and then base64 encode those bytes to produce a random 32-character string.
var a = new Uint8Array(24); window.crypto.getRandomValues(a); console.log(btoa(String.fromCharCode.apply(null, a)));
- Learn about the basic concepts of Cloud VPN
- Create a custom Virtual Private Cloud network
- Set up different types of Cloud VPN
- Maintain VPN tunnels and gateways
- See Advanced Configurations for information on high-availability, high-throughput scenarios, or multiple subnet scenarios.
- Get troubleshooting help