{"id":28136717,"url":"https://github.com/grunka/fortuna","last_synced_at":"2025-05-14T16:20:11.422Z","repository":{"id":4978478,"uuid":"6136401","full_name":"grunka/fortuna","owner":"grunka","description":"An implementation of the Fortuna RNG","archived":false,"fork":false,"pushed_at":"2025-05-12T09:14:30.000Z","size":278,"stargazers_count":36,"open_issues_count":0,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-12T10:30:15.164Z","etag":null,"topics":["fortuna","java","prng","random","rng"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"rkh/almost-sinatra","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grunka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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,"zenodo":null},"funding":{"github":"grunka","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null}},"created_at":"2012-10-09T06:37:33.000Z","updated_at":"2025-05-12T09:14:35.000Z","dependencies_parsed_at":"2024-04-22T16:02:55.977Z","dependency_job_id":"2d514044-ee46-4a93-badc-c37899d5d776","html_url":"https://github.com/grunka/fortuna","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grunka%2Ffortuna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grunka%2Ffortuna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grunka%2Ffortuna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grunka%2Ffortuna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grunka","download_url":"https://codeload.github.com/grunka/fortuna/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254179894,"owners_count":22027884,"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":["fortuna","java","prng","random","rng"],"created_at":"2025-05-14T16:19:58.871Z","updated_at":"2025-05-14T16:20:11.406Z","avatar_url":"https://github.com/grunka.png","language":"Java","funding_links":["https://github.com/sponsors/grunka"],"categories":[],"sub_categories":[],"readme":"# Fortuna\n\nThis is an implementation of the Fortuna PRNG, read more at [wikipedia][fortuna] or in the book [Cryptographic Engineering][ce] by Bruce Schneier.\n\n## Usage\n\nAdd it as a maven dependency\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.grunka.random.fortuna\u003c/groupId\u003e\n    \u003cartifactId\u003efortuna\u003c/artifactId\u003e\n    \u003cversion\u003e2.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nor clone and build (nothing more than `mvn install` is needed) and add to classpath.\n\nDue to reasons there are a couple of ways to create an instance. Either the constructor or the methods `createInstance` on [com.grunka.random.fortuna.Fortuna][fortuna_class]. Both of these ways create a subclass of Javas own Random class so this can be used wherever that would be used. The instance created should be reused. It is thread safe, creation time is noticeable, and you do not gain anything by recreating it. Due to the background threads collecting entropy running continuously you should call `shutdown` on the instance if you will actually not use the instance anymore.\n\nThere is an included runnable class for outputting random data for testing purposes. [com.grunka.random.fortuna.Dump][dump_class]. Dump outputs a specified number of megabytes of random data that can be used in other tools that analyze random data.\n\n## Details\n\nFor specifics either read the book referenced above and have a look at the code. Below are some descriptions of the specific choices taken for this implementation.\n\n### Block cipher\n\nThe block cipher used is a public domain implementation of [AES-256][aes256], in the code it uses the original name Rijndael. The reason for not using Javas own implementation is to avoid the system configuration changes needed to be allowed to use it since Java in its default configuration only allows up to 128-bit keys.\n\n### Entropy sources\n\nFor entropy sources I've selected several system dependant sources that are available to the Java runtime. In the current version there are [nine sources][entropy_sources]. For most of the values only the two least significant bytes are used which ensures that the values are fairly unpredictable even though they are polled often.\n\n[fortuna]: http://en.wikipedia.org/wiki/Fortuna_(PRNG)\n[ce]: http://www.schneier.com/book-ce.html\n[aes256]: http://en.wikipedia.org/wiki/Advanced_Encryption_Standard\n[entropy_sources]: https://github.com/grunka/fortuna/tree/master/src/main/java/com/grunka/random/fortuna/entropy\n[dump_class]: https://github.com/grunka/fortuna/blob/master/src/main/java/com/grunka/random/fortuna/tests/Dump.java\n[fortuna_class]: https://github.com/grunka/fortuna/blob/master/src/main/java/com/grunka/random/fortuna/Fortuna.java\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrunka%2Ffortuna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrunka%2Ffortuna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrunka%2Ffortuna/lists"}