{"id":15022031,"url":"https://github.com/hazae41/zepar","last_synced_at":"2025-04-12T06:06:59.873Z","repository":{"id":61722770,"uuid":"554417227","full_name":"hazae41/zepar","owner":"hazae41","description":"WebAssembly port of Aes128Ctr128Be and ChaCha20Poly1305 encryption algorithms","archived":false,"fork":false,"pushed_at":"2023-10-12T11:59:32.000Z","size":466,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T06:06:50.903Z","etag":null,"topics":["aes","browser","ctr","deno","encryption","javascript","rust","typescript","wasm","web","webassembly","webcrypto"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hazae41.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-19T19:26:48.000Z","updated_at":"2023-09-11T18:00:32.000Z","dependencies_parsed_at":"2024-09-24T21:18:43.639Z","dependency_job_id":null,"html_url":"https://github.com/hazae41/zepar","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":0.03389830508474578,"last_synced_commit":"6fa43a6bbb71419cf88f73d82bc7b9910ee67466"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fzepar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fzepar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fzepar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazae41%2Fzepar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hazae41","download_url":"https://codeload.github.com/hazae41/zepar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525144,"owners_count":21118618,"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":["aes","browser","ctr","deno","encryption","javascript","rust","typescript","wasm","web","webassembly","webcrypto"],"created_at":"2024-09-24T19:57:21.145Z","updated_at":"2025-04-12T06:06:59.844Z","avatar_url":"https://github.com/hazae41.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv\u003e\n  \u003cimg align=\"right\" width=\"128\" src=\"https://user-images.githubusercontent.com/4405263/216624555-216ea1a1-34bb-4406-a979-48a20b97d1a0.png\"/\u003e\n  \u003cp\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n# Zepar\n\nWebAssembly port of Aes128Ctr128Be and ChaCha20Poly1305 encryption algorithms\n\n```bash\nnpm i @hazae41/zepar\n```\n\n[**Node Package 📦**](https://www.npmjs.com/package/@hazae41/zepar) • [**Deno Module 🦖**](https://deno.land/x/zepar) • [**Next.js CodeSandbox 🪣**](https://codesandbox.io/p/github/hazae41/zepar-example-next)\n\n## Algorithms\n- Aes128Ctr128Be from RustCrypto (aes, ctr) (audited)\n- ChaCha20Poly1305 from RustCrypto (chacha20poly1305)\n\n## Features\n- Reproducible building\n- Pre-bundled and streamed\n- Zero-copy memory slices\n\n## Usage\n\n```ts\nimport { Zepar, Aes128Ctr128BEKey } from \"@hazae41/zepar\";\nimport { randomBytes } from \"crypto\";\n\n// Wait for WASM to load\nawait Zepar.initBundledOnce()\n\n// Random key\nconst key = randomBytes(16)\n\n// Random IV\nconst iv = randomBytes(16)\n\n// Build a cipher from key and IV\nconst cipher = new Aes128Ctr128BEKey(key, iv)\n\n// Byte arrays to encrypt\nconst hello = new TextEncoder().encode(\"Hello World\")\n\n// Encrypt with counter = 0\nconst encrypted0 = cipher.apply_keystream(hello).copyAndDispose()\n\n// Encrypt with counter = 1\nconst encrypted1 = cipher.apply_keystream(hello).copyAndDispose()\n\n// encrypted0 !== encrypted1\nconsole.log(encrypted0, encrypted1)\n\ncipher.free()\n```\n\n## Building\n\n### Unreproducible building\n\nYou need to install [Rust](https://www.rust-lang.org/tools/install)\n\nThen, install [wasm-pack](https://github.com/rustwasm/wasm-pack)\n\n```bash\ncargo install wasm-pack\n```\n\nFinally, do a clean install and build\n\n```bash\nnpm ci \u0026\u0026 npm run build\n```\n\n### Reproducible building\n\nYou can build the exact same bytecode using Docker, just be sure you're on a `linux/amd64` host\n\n```bash\ndocker compose up --build\n```\n\nThen check that all the files are the same using `git status`\n\n```bash\ngit status --porcelain\n```\n\nIf the output is empty then the bytecode is the same as the one I commited\n\n### Automated checks\n\nEach time I commit to the repository, the GitHub's CI does the following:\n- Clone the repository\n- Reproduce the build using `docker compose up --build`\n- Throw an error if the `git status --porcelain` output is not empty\n\nEach time I release a new version tag on GitHub, the GitHub's CI does the following:\n- Clone the repository\n- Do not reproduce the build, as it's already checked by the task above\n- Throw an error if there is a `npm diff` between the cloned repository and the same version tag on NPM\n\nIf a version is present on NPM but not on GitHub, do not use!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazae41%2Fzepar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhazae41%2Fzepar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazae41%2Fzepar/lists"}