{"id":15009846,"url":"https://github.com/py-zero/cryptozero","last_synced_at":"2026-01-15T22:31:33.615Z","repository":{"id":91311907,"uuid":"142664303","full_name":"py-zero/cryptozero","owner":"py-zero","description":"Simple, strong cryptography for beginners, in Python.","archived":false,"fork":false,"pushed_at":"2018-07-29T15:07:12.000Z","size":68,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T09:17:47.995Z","etag":null,"topics":["cryptography","education","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","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/py-zero.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":"2018-07-28T09:23:16.000Z","updated_at":"2018-08-10T21:00:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"40799ad8-cd58-4314-9212-6347d1b6b40a","html_url":"https://github.com/py-zero/cryptozero","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-zero%2Fcryptozero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-zero%2Fcryptozero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-zero%2Fcryptozero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/py-zero%2Fcryptozero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/py-zero","download_url":"https://codeload.github.com/py-zero/cryptozero/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246691291,"owners_count":20818483,"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":["cryptography","education","python3"],"created_at":"2024-09-24T19:28:51.024Z","updated_at":"2026-01-15T22:31:33.571Z","avatar_url":"https://github.com/py-zero.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CryptoZero\n\nMake it easy for learning groups to use simple cryptographic techniques in python\n\n\n- Docs: ...\n- Development: [https://github.com/py-zero/cryptozero](https://github.com/py-zero/cryptozero)\n- Tests: ...\n\n## API\n\n### Verification\n\\# TODO: expose signing and verifying methods\n\n\n### Secrecy\n\\# TODO: expose encryption and decryption methods\n\n\n## Examples\n\n### Verification\n\n\n### Secrecy\n\n### Key Stretching\nKey stretching is the process of taking a weak password, and making it longer in such a way\nthat it is slow to compute. This is also called `hashing`.\nAn example would be taking the password `passw0rd`, and turning it into a series of bytes.\n\n```python\nfrom cryptozero.key import stretch\nimport base64\nbase64.urlsafe_b64encode(stretch('passw0rd'))\nb'5ORsO6IvsHoxPXcaLRfe5Lx2Rt25apdJai9W7PGesBY='\n```\nWe've use base64 as a nice way of showing the output.\n\n#### Salting\n\nstretching on its own, however, is not going to be enough. Someone can still come along and\nbreak that password. What we need to do is mix in some `salt`.\nAs with a nice dish of Fish and Chips, the salt will compliment the password.\n\nThe salt will prevent an attacker from working out all the stretched keys ahead of time.\n\nYou can think of salting as adding some random characters onto your password.\n```python\npassword = 'passw0rd'\nsalt = 'aofjdnvoekqoubsdvib3g7wefb'\nsalted_password = password + salt\nsecret_key = hasher(salted_password)\n```\nWhile this method gets you quite far, we have given you an easy way to do it securely.\n```python\nfrom cryptozero.key import stretch\nimport base64, os\npassword = 'passw0rd'\nsalt = os.urandom(16)\nbase64.urlsafe_b64encode(stretch(password, salt=salt))\nb'd3sgGtHxsiESi0t4lkaXeep9j0ElfGeGMscpnfRz3vA='\n```\nYour output will be different. This is because we're getting a random salt using `os.urandom`.\n\nYou can safely give out the salt to people. In fact, it's very common to store the salt along side what you're encrypting.\n\n\n### With networking\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpy-zero%2Fcryptozero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpy-zero%2Fcryptozero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpy-zero%2Fcryptozero/lists"}