{"id":13519165,"url":"https://github.com/paragonie/seedspring","last_synced_at":"2025-05-05T20:21:57.268Z","repository":{"id":52800460,"uuid":"48448304","full_name":"paragonie/seedspring","owner":"paragonie","description":"Seeded, Deterministic PRNG (based on AES-CTR instead of LCG)","archived":false,"fork":false,"pushed_at":"2024-05-08T16:50:03.000Z","size":29,"stargazers_count":39,"open_issues_count":0,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-13T06:52:35.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paragonie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-22T18:47:16.000Z","updated_at":"2024-05-08T16:50:06.000Z","dependencies_parsed_at":"2024-06-21T14:24:02.722Z","dependency_job_id":"92bfa56a-56d7-4c31-8ab1-5a5c6b621bd9","html_url":"https://github.com/paragonie/seedspring","commit_stats":{"total_commits":30,"total_committers":2,"mean_commits":15.0,"dds":"0.33333333333333337","last_synced_commit":"6ad078440c119bea61670d7aecc4e8cf0d2d39e3"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fseedspring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fseedspring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fseedspring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fseedspring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paragonie","download_url":"https://codeload.github.com/paragonie/seedspring/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225057662,"owners_count":17414372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T05:01:54.881Z","updated_at":"2024-11-17T15:34:31.116Z","avatar_url":"https://github.com/paragonie.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# seedspring\n\n[![Build Status](https://github.com/paragonie/seedspring/actions/workflows/ci.yml/badge.svg)](https://github.com/paragonie/seedspring/actions)\n\nSeeded, Deterministic PRNG (based on AES-CTR instead of LCG) (**Requires PHP 7 or [random_compat](https://github.com/paragonie/random_compat)**)\n\n## Security Warning\n\nThis is not meant to replace `random_bytes()`. Think of this as an improvement\nto `srand()` + `rand()`. **Do not use this for security purposes.**\n\n## Installing\n\n```sh\ncomposer require paragonie/seedspring\n```\n\n### Usage\n\n```php\nuse \\ParagonIE\\SeedSpring\\SeedSpring;\n\n// For example\n$sharedSeed = str_repeat(\"\\x80\", 16);\n\n$rng = new SeedSpring($sharedSeed);\n\n$data = $rng-\u003egetBytes(1024);\n$int = $rng-\u003egetInt(1, 100);\n```\n\n### Motivation\n\nA cryptographically secure pseudorandom number generator, such as `random_int()`,\nis wonderful for security purposes. However, there are situations where you need\nto generate a deterministic, pseudorandom byte stream on two devices from a\nshared seed. (e.g. something like Minecraft's world generator).\n\nPHP's native seedable (and insecure) RNGs, `rand()` and `mt_rand()`, only \nsupport a 32-bit integer seed, which severely limits the possible outputs. Our\ndeterministic RNG supports up to 2^128 possible outputs, since it's based on a\n128-bit block cipher.\n\nOur implementation uses AES-128-CTR to turn a finite, 128-bit key into an\npractically endless stream of random bytes. \n\nIt will repeat after 2^132 bytes of output. You should consider rekeying after \n2^66 bytes.\n\nFor anything security-sensitive, you should rekey after 2^39 bytes. This is\nbecause the probability of predicting successive blocks becomes unacceptably\nhigh for security operations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagonie%2Fseedspring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparagonie%2Fseedspring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagonie%2Fseedspring/lists"}