Cryptography guides

Choose an encoding for the API keys your service accepts

·

Check how your API accepts credentials before selecting their text format. An opaque 32-byte token has several representations. Choose the one your service can parse and store without changing the value.

API Key Generator

Compare two encodings at 32 random bytes

Set Random bytes per key to 32 and Key count to 2. Enter inventory as the application label and keep Base64URL without padding. Generate, then choose Reveal keys. Each of the two lines begins with app_inventory_ followed by 43 characters.

Select Lowercase hexadecimal and regenerate. Each line now has 64 hexadecimal characters after the same prefix. Generation makes a fresh random draw at each click. The underlying random byte count remains 32.

Compare two encodings at 32 random bytes
EncodingRandom bytesCharacters after prefix
Base64URL without padding3243
Standard Base643244 including the final =
Lowercase hexadecimal3264

Web Cryptography API random valuesRFC 4648 base encodings

Register the entire token with your service

When your service accepts the app_inventory_ label, register the complete text line with your credential issuer. If it expects an unprefixed encoded value, clear the label and generate again. Choose Base64URL for an input grammar that allows hyphens and underscores and excludes the plus, slash or padding characters from standard Base64.

Copy from the tool directly into your own credential-management workflow. Keep token values out of URLs and logs. Use an HTTPS transport that matches your service’s authentication contract.

RFC 4648 base encodingsRFC 6750 bearer-token handling

Common questions

How can I check the output without using a credential in a request?

Use a disposable batch. Verify the prefix, count the encoded characters after it and check the decoded length against the selected byte count.

When should I rotate a copied key?

Follow the issuing service’s rotation policy. If someone else may have obtained a bearer credential, replace it with a new registered value and revoke the old value through that service.

Sources

Put it into practice.

Related guides