Skip to content

fix:(feat): use random nonce for encryption key generation - #151

Open
odaysec wants to merge 1 commit into
EpicGames:mainfrom
odaysec:patch-1
Open

fix:(feat): use random nonce for encryption key generation#151
odaysec wants to merge 1 commit into
EpicGames:mainfrom
odaysec:patch-1

Conversation

@odaysec

@odaysec odaysec commented Jul 29, 2026

Copy link
Copy Markdown

Use a non-hard-coded nonce seed when building the encryption key+nonce bundle. fix generate_encryption_key_nonce() (around lines 1096–1102), generate 4 random bytes using the same SystemRandom, convert them into a u32 (e.g., little-endian), and pass that value to get_encryption_key_with_nonce(...) instead of literal 1. This keeps the existing data format and flow unchanged (still u32 nonce + key bytes), avoids introducing new dependencies, and resolves the hard-coded cryptographic value. Also handle rand.fill(...) result for nonce bytes the same way existing code handles key generation (without changing function signatures/behavior).

Use a non-hard-coded nonce seed when building the encryption key+nonce bundle.  
fix `generate_encryption_key_nonce()` (around lines 1096–1102), generate 4 random bytes using the same `SystemRandom`, convert them into a `u32` (e.g., little-endian), and pass that value to `get_encryption_key_with_nonce(...)` instead of literal `1`. This keeps the existing data format and flow unchanged (still `u32` nonce + key bytes), avoids introducing new dependencies, and resolves the hard-coded cryptographic value. Also handle `rand.fill(...)` result for nonce bytes the same way existing code handles key generation (without changing function signatures/behavior).
@ajcarberry ajcarberry added the area:server Server, provider integrations, telemetry label Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:server Server, provider integrations, telemetry

Development

Successfully merging this pull request may close these issues.

2 participants