Description
The application crashes with a low_entropy error when calling crypto:strong_rand_bytes/1 during HTTP signature generation, particularly in containerized or virtualized environments.
Error Details
Error: low_entropy
Stack trace:
crypto:strong_rand_bytes/1 [crypto.erl:1992]
rsa_pss:sign/3 [/home/hb/HyperBEAM_SGLang/src/rsa_pss.erl:44]
dev_codec_httpsig:commit/3 [/home/hb/HyperBEAM_SGLang/src/dev_codec_httpsig.erl:168]
dev_message:commit/3 [/home/hb/HyperBEAM_SGLang/src/dev_message.erl:269]
hb_message:commit/3 [/home/hb/HyperBEAM_SGLang/src/hb_message.erl:341]
Environment
- OS: Ubuntu
- Erlang/OTP Version: 27
- branch:
edge
Root Cause
The system's entropy pool is insufficient for crypto:strong_rand_bytes/1, which requires high-quality randomness from /dev/random. This commonly occurs in:
- Virtual machines with limited entropy sources
- Container environments without hardware RNG access
- Systems under high cryptographic load