{"id":29507247,"url":"https://github.com/antonmeep/system_random","last_synced_at":"2026-02-23T02:37:34.001Z","repository":{"id":304772631,"uuid":"469179298","full_name":"AntonMeep/system_random","owner":"AntonMeep","description":"Minimal Ada library to retrieve random data from system sources","archived":false,"fork":false,"pushed_at":"2022-03-13T14:50:53.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T19:48:16.935Z","etag":null,"topics":["cryptography","random","security"],"latest_commit_sha":null,"homepage":"","language":"Ada","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AntonMeep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2022-03-12T19:22:32.000Z","updated_at":"2025-09-19T09:15:17.000Z","dependencies_parsed_at":"2025-07-15T09:43:34.956Z","dependency_job_id":"c2831361-061f-44a0-8a48-434d27156e20","html_url":"https://github.com/AntonMeep/system_random","commit_stats":null,"previous_names":["antonmeep/system_random"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/AntonMeep/system_random","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonMeep%2Fsystem_random","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonMeep%2Fsystem_random/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonMeep%2Fsystem_random/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonMeep%2Fsystem_random/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AntonMeep","download_url":"https://codeload.github.com/AntonMeep/system_random/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonMeep%2Fsystem_random/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29735759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T02:24:00.660Z","status":"ssl_error","status_checked_at":"2026-02-23T02:22:56.087Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cryptography","random","security"],"created_at":"2025-07-16T03:30:39.209Z","updated_at":"2026-02-23T02:37:33.977Z","avatar_url":"https://github.com/AntonMeep.png","language":"Ada","funding_links":[],"categories":[],"sub_categories":[],"readme":"System_Random\n[![License](https://img.shields.io/github/license/AntonMeep/system_random.svg?color=blue)](https://github.com/AntonMeep/system_random/blob/master/LICENSE.txt)\n[![Alire crate](https://img.shields.io/endpoint?url=https://alire.ada.dev/badges/system_random.json)](https://alire.ada.dev/crates/system_random.html)\n[![GitHub release](https://img.shields.io/github/release/AntonMeep/system_random.svg)](https://github.com/AntonMeep/system_random/releases/latest)\n=======\n\nSystem_Random provides portable interface to system's sources of randomness,\nwhich are assumed to be cryptographically secure. This crate features rather\nlow-level implementation and is intended to be used to seed some high-quality\nPRNG which would be adequate for your specific use case.\n\nThis crate was inspired by a similar [getrandom](https://github.com/rust-random/getrandom)\ncrate for Rust, but is a completely original project.\n\n# Sources of randomness\n\nSystem_Random utilizes different system facilities under the hood, based on\nwhat OS is being used. Unlike other similar projects, no fall-back is provided\nfor the situations when, say, program is being run on an outdated version of OS.\nInstead, latest and greatest system sources of randomness are used.\n\n| Environment | Source |\n|----|--------|\n| Windows | [BCryptGenRandom](https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom) |\n| Linux | [getentropy](https://man7.org/linux/man-pages/man3/getentropy.3.html) |\n| MacOS | [getentropy](https://opensource.apple.com/source/xnu/xnu-6153.41.3/bsd/man/man2/getentropy.2.auto.html) |\n| Anything else | getentropy if available |\n\n# Explanation\n\n## Windows\n\n[BCryptGenRandom](https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom)\nis a part of [Cryptography API: Next Generation](https://docs.microsoft.com/en-us/windows/win32/seccng/cng-portal),\nand is the new preferred source of randomness on this platform. Requires\nlinking to `bcrypt` system library.\n\n\u003e Availability: CNG is supported since Windows Server 2008 and Windows Vista,\nhowever due to the flags System_Random is using, Windows Vista is not supported.\n\u003e Good thing it reached its end-of-life in 2017.\n\n## Linux\n\n[getentropy](https://man7.org/linux/man-pages/man3/getentropy.3.html) is used,\nwhich is not necessarily a system call, but rather a function of Glibc built\non top of `getrandom` system call.\n\nMost common way of getting random data on Linux is reading from `/dev/(u)random`,\nhowever this method has quite a few cons:\n\n- To read from file, a file descriptor must be stored somewhere, which means\nthat now there's a global state introduced into the program. This is never a\ngood thing\n\n- Synchronizing this global state between multiple threads can be cumbersome\n\n- This method is susceptible to file-descriptor attacks\n\nBecause of that, `getentropy` is used.\n\n\u003e Availability: Introduced in Glibc v2.25 (February 5, 2017), depends on\n`getrandom` syscall, introduced in Linux v3.17 (October 5, 2014).\n\n## MacOS\n\n[getentropy](https://opensource.apple.com/source/xnu/xnu-6153.41.3/bsd/man/man2/getentropy.2.auto.html) is also used on MacOS, however it is a system function on this platform.\n\n\u003e Availability: Introduced in MacOS v10.12 (June 13, 2016).\n\n## Other platforms\n\nWhile not proven to work on other platforms, System_Random should work just\nfine on any system that provides `getentropy`.\n\nFor example, OpenBSD since v5.6 (November 1, 2015)\n[provides](https://man.openbsd.org/getentropy.2) such function, therefore this\ncrate can be used without any problem.\n\nOn the contrary, Solaris also provides a function with the same name, and\nit should also be possible to use System_Random on this system, however\n`getentropy` has [different](https://web.archive.org/web/20170802164413/https://blogs.oracle.com/darren/solaris-new-system-calls:-getentropy2-and-getrandom2)\nmeaning on this platform, and therefore its usage will be different.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonmeep%2Fsystem_random","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonmeep%2Fsystem_random","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonmeep%2Fsystem_random/lists"}