database64128 / swgp-go

🐉 Simple WireGuard proxy with minimal overhead for WireGuard traffic.
GNU Affero General Public License v3.0
224 stars 23 forks source link

document issue: proxyPSK is 32 random bytes in base64? #17

Closed busylog closed 1 year ago

busylog commented 2 years ago
func NewZeroOverheadHandler(psk []byte) (Handler, error) {
    cb, err := aes.NewCipher(psk)
    if err != nil {
        return nil, err
    }

    aead, err := chacha20poly1305.NewX(psk)
    if err != nil {
        return nil, err
    }

so seems psk is 32 bytes, AES-256 is selected.

simple generator:

python3 -c 'import os,base64; print(base64.b64encode(os.urandom(32)).decode("ascii"))'
database64128 commented 2 years ago

You can simply do wg genpsk, or openssl rand -base64 32. No need to use Python.

database64128 commented 1 year ago

It's now documented in README.