Title: doc: crypto.randomBytes, randomInt, randomUUID and getRandomValues continue from the saved state after a snapshot or checkpoint restore · Issue #66880 · nodejs/node · GitHub
Open Graph Title: doc: crypto.randomBytes, randomInt, randomUUID and getRandomValues continue from the saved state after a snapshot or checkpoint restore · Issue #66880 · nodejs/node
X Title: doc: crypto.randomBytes, randomInt, randomUUID and getRandomValues continue from the saved state after a snapshot or checkpoint restore · Issue #66880 · nodejs/node
Description: Affected URL(s) https://nodejs.org/api/crypto.html#cryptorandombytessize-callback (also crypto.randomInt, crypto.randomFill, crypto.randomUUID, and crypto.getRandomValues of the Web Crypto API) Description of the problem We measure how u...
Open Graph Description: Affected URL(s) https://nodejs.org/api/crypto.html#cryptorandombytessize-callback (also crypto.randomInt, crypto.randomFill, crypto.randomUUID, and crypto.getRandomValues of the Web Crypto API) Des...
X Description: Affected URL(s) https://nodejs.org/api/crypto.html#cryptorandombytessize-callback (also crypto.randomInt, crypto.randomFill, crypto.randomUUID, and crypto.getRandomValues of the Web Crypto API) Des...
Opengraph URL: https://github.com/nodejs/node/issues/66880
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"doc: crypto.randomBytes, randomInt, randomUUID and getRandomValues continue from the saved state after a snapshot or checkpoint restore","articleBody":"### Affected URL(s)\n\nhttps://nodejs.org/api/crypto.html#cryptorandombytessize-callback (also `crypto.randomInt`, `crypto.randomFill`, `crypto.randomUUID`, and `crypto.getRandomValues` of the Web Crypto API)\n\n### Description of the problem\n\nWe measure how userspace random generators behave when a process or a machine is duplicated.\nFor Node 24.18.0 linked against the system OpenSSL 3.5.9 (Fedora 44, Linux 7.2.11) the picture is\nthis; the harness and every log are available.\n\nOne guest or process saved and restored twice from the same image, the two continuations'\noutputs compared block by block at equal sequence numbers: `Math.random`, `crypto.randomBytes`,\n`crypto.randomInt` and `crypto.getRandomValues` are 32 of 32 blocks identical under QEMU with and\nwithout a vmgenid device and under Firecracker with VMGenID and VMClock attached, and 14 of 14\nunder CRIU; a read of `/dev/urandom` beside them is distinct from the first block wherever the\nguest kernel's vmgenid driver is present. The three `crypto` calls repeat because OpenSSL's\nDRBG does; `Math.random` repeats because V8's generator is seeded once per isolate. We asked\nthe OpenSSL project where it places the case; its answer (2026-10-20) is that reseeding after a\nrestore \"is currently a non-goal\", not yet documented, that a documentation pull request will\nbe accepted and backported, and that a check-and-reseed on the VMClock generation counter would\nbe considered as a new feature for a future release.\n\nWhat we would like to know is whether the `crypto` documentation should say that these calls\ninherit OpenSSL's behaviour across a snapshot or checkpoint restore, so that applications\nresumed from one image (SnapStart-style platforms, CRIU) know to arrange a reseed, and whether\nNode would want to call `RAND_poll` itself on a restore signal (its own startup snapshot\nfeature, `--build-snapshot`, resumes an isolate from an image in the same way, and\n`crypto.randomUUID` serves identifiers from a cache of 128 filled in one draw,\nlib/internal/crypto/random.js).\n\nThe repeated blocks are the generators' own output; we have not looked at anything downstream.\n\nConcretely, a sentence in the `crypto` documentation of the kind \"these functions draw from OpenSSL's DRBG inside the process; after a snapshot or checkpoint restore the DRBG continues from the saved state until its next scheduled reseed, so an application resumed from a saved image should reseed after its own restore signal\" would tell such applications what to do, and `crypto.randomUUID` could note its cache of 128 identifiers (`lib/internal/crypto/random.js`, `disableEntropyCache` turns it off). We can send a documentation pull request if that is welcome. The harness, the logs and the OpenSSL exchange are available on request.\n","author":{"url":"https://github.com/KurathSec","@type":"Person","name":"KurathSec"},"datePublished":"2026-10-20T15:34:48Z","url":"https://github.com/nodejs/node/issues/66880"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a102b137-893f-5d53-abec-79d7089b8eff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA4E:170985:1DC2C1:28DDD3:6AFBFF70 |
| html-safe-nonce | bae2ef2f400e2fd1ace482b7fc36b624d210ff7bf221d84b984bcbdb6fd3ebfb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTRFOjE3MDk4NToxREMyQzE6MjhEREQzOjZBRkJGRjcwIiwidmlzaXRvcl9pZCI6Ijg4OTE0MjAyMzExNTk1MTI5NDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 037836146b79b712834ba6036ec216b28f798d1dafe8b7f81315a08227ef4ca9 |
| hovercard-subject-tag | issue:5944611325 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66880/issue_layout |
| twitter:image | https://opengraph.githubassets.com/270a91551f853c8c33f4134d22f61d778d8a7308408cca8a01dfab976baedb7e/nodejs/node/issues/66880 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/270a91551f853c8c33f4134d22f61d778d8a7308408cca8a01dfab976baedb7e/nodejs/node/issues/66880 |
| og:image:alt | Affected URL(s) https://nodejs.org/api/crypto.html#cryptorandombytessize-callback (also crypto.randomInt, crypto.randomFill, crypto.randomUUID, and crypto.getRandomValues of the Web Crypto API) Des... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | KurathSec |
| hostname | github.com |
| expected-hostname | github.com |
| None | fa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b3b5633a74535d9c23385512d534c66c8fde1907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width