{"id":30743283,"url":"https://github.com/dsacms/npd_cicadence","last_synced_at":"2025-09-04T02:05:49.458Z","repository":{"id":311997333,"uuid":"1024489522","full_name":"DSACMS/npd_cicadence","owner":"DSACMS","description":"Cicadence for Primeval Privacy Math","archived":false,"fork":false,"pushed_at":"2025-08-27T23:20:12.000Z","size":21,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-28T07:18:30.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DSACMS.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,"zenodo":null}},"created_at":"2025-07-22T19:27:46.000Z","updated_at":"2025-08-01T17:08:17.000Z","dependencies_parsed_at":"2025-08-28T07:21:26.048Z","dependency_job_id":"5da93770-8031-40a2-bc78-0cb3daf7f65a","html_url":"https://github.com/DSACMS/npd_cicadence","commit_stats":null,"previous_names":["dsacms/npd_cicadence"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/DSACMS/npd_cicadence","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSACMS%2Fnpd_cicadence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSACMS%2Fnpd_cicadence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSACMS%2Fnpd_cicadence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSACMS%2Fnpd_cicadence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DSACMS","download_url":"https://codeload.github.com/DSACMS/npd_cicadence/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSACMS%2Fnpd_cicadence/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273539317,"owners_count":25123499,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-04T02:05:46.245Z","updated_at":"2025-09-04T02:05:49.448Z","avatar_url":"https://github.com/DSACMS.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Cicadence for Primeval Privacy Math\n=============================\nPrime Lookback Picker i.e. Cicada Number Picker\n\nOften, we want to pick a time period for analysis of patient data that intentionally does not line up with common time periods for analysis. \nThis way, even if the same underlying patient data is used for a report, it is difficult to conduct a subtraction attack where one report can be used in \nconjunction with another report to provide precise details about one or small number of patients. \n\nThe inspiration for this project comes from Cicadas which have (apparently) evolved an incubation period that is difficult for predators to sync with.\n[https://en.wikipedia.org/wiki/Periodical_cicadas](https://en.wikipedia.org/wiki/Periodical_cicadas)\n\n\nGoal\n----\nPick a prime-number “look-back window” (in days) that collides *least often*\nwith a set of common analytics windows **within the next decade** (3 650 days).\n\nA *collision* means:               day  %  LCM(p, base) == 0\nwhere  p     = candidate prime look-back\n       base  = one of the base windows\n\nWe *weight* collisions by density:\nIf a day is a multiple of *three* base windows, it contributes 3 to the score.\n\nThe script:\n\n1.  Lists every prime `p` such that 10 \u003c p \u003c 90.\n2.  Counts the *weighted* collisions for each `p` versus the base windows  \n    [7, 10, 30, 60, 90, 365, 730, 1095, 1825, 3650].\n3.  Prints the full table and highlights the prime with the **lowest score**.\n\nOutput example\n--------------\n    Prime with the lowest weighted collision score = 89 (score=10)\n\n    Prime : Weighted collision score (lower is better)\n     11 : 99\n     13 : 84\n     ...\n     89 : 10\n\nInterpretation\n--------------\n• Lower score → fewer “overlap events” where analytic windows\n  hit the same day.\n\n• `89` wins because its first overlaps with the densest windows\n  (7 × 89, 10 × 89, 30 × 89) are so far out that only a handful\n  fit inside 10 years.\n\nCustomization\n-------------\n* Change `BASE_WINDOWS` to suit your organisation’s standard KPI windows.\n* Change `HORIZON_DAYS` (default 3650, 10 years) if you care about a shorter/longer\n  planning horizon.\n\n\ncode runs on command line: \n```bash\n\u003e  python prime_lookback_picker.py\n```\n\nResults\n--------------------\nWith the default parameters, the script produces: \n\n```\nPrime : Weighted collision score (lower is better)\n\n11 : 99\n13 : 84\n17 : 63\n19 : 57\n23 : 45\n29 : 36\n31 : 32\n37 : 28\n41 : 23\n43 : 23\n47 : 21\n53 : 18\n59 : 17\n61 : 14\n67 : 13\n71 : 13\n73 : 34\n79 : 11\n83 : 11\n89 : 10\n97 : 9\n101 : 9\n103 : 9\n107 : 8\n109 : 8\n113 : 8\n127 : 6\n131 : 5\n137 : 5\n139 : 5\n149 : 5\n151 : 5\n157 : 5\n163 : 5\n167 : 5\n173 : 5\n179 : 4\n181 : 4\n191 : 3\n193 : 3\n197 : 3\n199 : 3\n211 : 3\n223 : 3\n227 : 3\n229 : 3\n233 : 3\n239 : 3\n241 : 3\n251 : 3\n257 : 3\n263 : 2\n269 : 2\n271 : 2\n277 : 2\n281 : 2\n283 : 2\n293 : 2\n307 : 2\n311 : 2\n313 : 2\n317 : 2\n331 : 2\n337 : 2\n347 : 2\n349 : 2\n353 : 2\n359 : 2\n367 : 1\n373 : 1\n379 : 1\n383 : 1\n389 : 1\n397 : 1\n401 : 1\n409 : 1\n419 : 1\n421 : 1\n431 : 1\n433 : 1\n439 : 1\n443 : 1\n449 : 1\n457 : 1\n461 : 1\n463 : 1\n467 : 1\n479 : 1\n487 : 1\n491 : 1\n499 : 1\n503 : 1\n509 : 1\n521 : 1\n523 : 0\n541 : 0\n547 : 0\n557 : 0\n563 : 0\n569 : 0\n571 : 0\n577 : 0\n587 : 0\n593 : 0\n599 : 0\n601 : 0\n607 : 0\n613 : 0\n617 : 0\n619 : 0\n631 : 0\n641 : 0\n643 : 0\n647 : 0\n653 : 0\n659 : 0\n661 : 0\n673 : 0\n677 : 0\n683 : 0\n691 : 0\n701 : 0\n709 : 0\n719 : 0\n727 : 0\n733 : 0\n739 : 0\n743 : 0\n751 : 0\n757 : 0\n761 : 0\n769 : 0\n773 : 0\n787 : 0\n797 : 0\n809 : 0\n811 : 0\n821 : 0\n823 : 0\n827 : 0\n829 : 0\n839 : 0\n853 : 0\n857 : 0\n859 : 0\n863 : 0\n877 : 0\n881 : 0\n883 : 0\n887 : 0\n907 : 0\n911 : 0\n919 : 0\n929 : 0\n937 : 0\n941 : 0\n947 : 0\n953 : 0\n967 : 0\n971 : 0\n977 : 0\n983 : 0\n991 : 0\n997 : 0\n1009 : 0\n1013 : 0\n1019 : 0\n1021 : 0\n1031 : 0\n1033 : 0\n1039 : 0\n1049 : 0\n1051 : 0\n1061 : 0\n1063 : 0\n1069 : 0\n1087 : 0\n1091 : 0\n1093 : 0\n1097 : 0\n\n```\n\nDiscussion\n----------------\nFor numbers under 100 days, 89 \"wins\" from a collision perspective, but time periods of 29 or 31 days might be the most useful... \n\nThe next number to note is 523, which is less than two years, and is the first number with no collisions in a 10 year time-span. \n\nymmv.\n\n-ft\n\n## Policies\n\n### Open Source Policy\n\nWe adhere to the [CMS Open Source Policy](https://github.com/CMSGov/cms-open-source-policy). If you have any questions, just [shoot us an email](mailto:opensource@cms.hhs.gov).\n\n### Security and Responsible Disclosure Policy\n\n_Submit a vulnerability:_ Vulnerability reports can be submitted through [Bugcrowd](https://bugcrowd.com/cms-vdp). Reports may be submitted anonymously. If you share contact information, we will acknowledge receipt of your report within 3 business days.\n\n### Software Bill of Materials (SBOM)\n\nA Software Bill of Materials (SBOM) is a formal record containing the details and supply chain relationships of various components used in building software.\n\nIn the spirit of [Executive Order 14028 - Improving the Nation's Cyber Security](https://www.gsa.gov/technology/it-contract-vehicles-and-purchasing-programs/information-technology-category/it-security/executive-order-14028), a SBOM for this repository is provided here: https://github.com/{{ cookiecutter.project_org }}/{{ cookiecutter.project_repo_name }}/network/dependencies.\n\nFor more information and resources about SBOMs, visit: https://www.cisa.gov/sbom.\n\n## Public domain\n\nThis project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/) as indicated in [LICENSE](LICENSE).\n\nAll contributions to this project will be released under the CC0 dedication. By submitting a pull request or issue, you are agreeing to comply with this waiver of copyright interest.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsacms%2Fnpd_cicadence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsacms%2Fnpd_cicadence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsacms%2Fnpd_cicadence/lists"}