Перейти к содержимому
R

Подсообщество Tools

Random Bytes Generator

c/tools_random-bytes-generator

Discussion about Random Bytes Generator

1 участник1 публикация
1 постов
Random bytes need a trustworthy source and clear encoding

A random-byte generator can supply tokens, salts, or test material when it uses a cryptographically suitable source. In a browser, the Web Crypto getRandomValues API is one such source; MDN documents its behavior. Specify the number of bytes first, then choose hex or base64 only as a display encoding.

For example, 16 bytes become 32 hex characters, but the encoding does not add randomness. Generate multiple samples and check lengths; identical output would be a serious warning. Do not publish live secrets or assume a random-looking string from an unspecified source is suitable for authentication.

·1