Skip to content
OddsockLocal
Local
Source text
Key size in bytes32
Encodinghex
How many1
ReadyRuns in this browser. Nothing is uploaded.

How to use

  1. Leave the size at 32 bytes unless the spec asks for something else.
  2. Pick hex, Base64, or Base64URL to match the config format.
  3. Copy the key into a secret store. Do not commit it.
  4. Close the tab. The page will not have the key later.

What is Secret key generator?

A config file asks for a 256-bit key and someone types a sentence. This page draws real random bytes and writes them as hex, Base64, or Base64URL. The size opens at 32 bytes, which is 256 bits, and the encoding opens at hex, so the result is 64 hex digits. One test draw is 6ae7d632ac089cdf9b7414e41c1768247356bd2eb21a46f4688a52ba90e73044. Treat every generated key as a secret the moment it appears. The page does not store it, and a screenshot of it is a copy.

Read more

Hex is easy to diff and awkward in URLs. Base64 is shorter and uses plus, slash, and padding. Base64URL is the one that survives a query string. The random-bytes page is the same draw with Base64 as the opening encoding. The random-hex page counts characters, not bytes, so a length of 32 there is only 128 bits.

Size can run up to 4096 bytes, which is far more than a symmetric key needs. 32 bytes is the right default for AES-256 and for an HMAC key.

Use cases

  • A local .env gets an AES-256 key that was not a proverb.
  • An HMAC setup wants 32 random bytes as hex.
  • A service token is issued as Base64URL for a header.
  • A rotation drill generates the next key before the old one is revoked.
  • A reviewer checks that a sample config is 64 hex digits and not 32.

A 32-byte hex key

Key size 32 bytes, encoding hex, one key.

6ae7d632ac089cdf9b7414e41c1768247356bd2eb21a46f4688a52ba90e73044. Sixty-four hex digits, 256 bits. Generate a new one for any real system. This example is public.

Why use Oddsock

Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.

Related tools

Using this tool

No. It exists on screen until you leave or generate another. Put it in a vault or an environment variable that is not checked in.