{"id":18053035,"url":"https://github.com/myomikron/rcp","last_synced_at":"2025-04-05T07:44:23.763Z","repository":{"id":53398131,"uuid":"344204581","full_name":"myOmikron/rcp","owner":"myOmikron","description":"Random checksum protocol","archived":false,"fork":false,"pushed_at":"2022-08-05T13:00:43.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T09:24:52.547Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/myOmikron.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}},"created_at":"2021-03-03T17:16:03.000Z","updated_at":"2021-12-27T09:32:25.000Z","dependencies_parsed_at":"2022-08-23T16:10:42.004Z","dependency_job_id":null,"html_url":"https://github.com/myOmikron/rcp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myOmikron%2Frcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myOmikron%2Frcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myOmikron%2Frcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myOmikron%2Frcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myOmikron","download_url":"https://codeload.github.com/myOmikron/rcp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305901,"owners_count":20917203,"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-10-30T23:14:15.275Z","updated_at":"2025-04-05T07:44:23.747Z","avatar_url":"https://github.com/myOmikron.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RCP - Random Checksum Protocol\n\nRCP's main use case is providing a checksum to validate requests between HTTP Servers, \ntherefore each server has a shared secret to which all the others have to have access to.\n\n## How to implement\n- Put all your data from your POST or GET Request in a dictionary \n- Sort the dictionary alphanumerical by its keys.\n- Concat its values to the respective key and join them: `key1value1key2value2...`\n  - Note: When using non str values:\n    - bool is represented as \"true\" or \"false\"\n- Append the shared secret of your target\n- Append current utc timestamp (unix epoch - just seconds)\n- Optional: Add a salt (this may be the method's endpoint): `saltkey1value1...`\n- Hash with SHA512\n- Represent the hash as hex string (lowercase)\n- The endpoint you're trying to reach should have the position stated, where the checksum should be put. \nThis may be as a key in a POST request, or via Authentication Header.\n\n\n**Watch out**\nAs this protocol heavily depends on retrieving the correct time, \nit may be required to enable NTP on your servers.\n\n## How to use the reference implementation\n\n**Get checksum**\n\n```python\nfrom rc_protocol import get_checksum\n\nSHARED_SECRET = \"s3cr3t_p@ssw0rd\"\n\nmy_dict = {\n    \"key1\": \"value1\",\n    \"key2\": \"value2\"\n}\n\nchecksum = get_checksum(my_dict, SHARED_SECRET)\n```\n\n**Validate checksum**\n\n```python\nfrom rc_protocol import validate_checksum\n\nSHARED_SECRET = \"s3cr3t_p@ssw0rd\"\n\nmy_dict = {\n    \"key1\": \"value1\",\n    \"key2\": \"value2\",\n}\nchecksum = \"d0690e3c924e18bad866e2867698be75f64bdc6e809b76ffedb5c5095c9fbe15d36636b2df1fc47d2a3f348aea272ffc2fed4dc8ee08e0d13631ef646e1648c4\"\n\nif validate_checksum(my_dict, checksum, SHARED_SECRET):\n    do_random_things()\nelse:\n    print(\"You shall not pass.\")\n```\n\n## Implementations\n- Python [rc-protocol](https://pypi.org/project/rc-protocol/)\n- Go [gorcp](https://github.com/myOmikron/gorcp)\n- Rust [rc_protocol](https://crates.io/crates/rc_protocol)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyomikron%2Frcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyomikron%2Frcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyomikron%2Frcp/lists"}