{"id":28521683,"url":"https://github.com/dumitory-dev/wasm-xchacha20poly1305-wrapper","last_synced_at":"2025-06-25T09:06:15.119Z","repository":{"id":162720625,"uuid":"637145200","full_name":"dumitory-dev/wasm-xchacha20poly1305-wrapper","owner":"dumitory-dev","description":" WebAssembly wrapper for the XChaCha20Poly1305 encryption algorithm","archived":false,"fork":false,"pushed_at":"2023-05-08T13:37:20.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-09T08:15:01.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/wasm-xchacha20-poly","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dumitory-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-05-06T16:40:39.000Z","updated_at":"2023-05-15T14:36:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"971e2b06-f941-4dbb-b411-321a923bbea7","html_url":"https://github.com/dumitory-dev/wasm-xchacha20poly1305-wrapper","commit_stats":null,"previous_names":["dumitory-dev/wasm-xchacha20poly1305-wrapper"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dumitory-dev/wasm-xchacha20poly1305-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumitory-dev%2Fwasm-xchacha20poly1305-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumitory-dev%2Fwasm-xchacha20poly1305-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumitory-dev%2Fwasm-xchacha20poly1305-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumitory-dev%2Fwasm-xchacha20poly1305-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dumitory-dev","download_url":"https://codeload.github.com/dumitory-dev/wasm-xchacha20poly1305-wrapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumitory-dev%2Fwasm-xchacha20poly1305-wrapper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261841956,"owners_count":23217913,"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":"2025-06-09T08:13:24.359Z","updated_at":"2025-06-25T09:06:15.106Z","avatar_url":"https://github.com/dumitory-dev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wasm-xchacha20poly1305-wrapper\n\n`wasm-xchacha20poly1305-wrapper` is a WebAssembly wrapper for the XChaCha20Poly1305 encryption algorithm. This library enables developers to use the powerful encryption capabilities of the Chacha20Poly1305 cryptographic algorithm in web applications.\n\n## Features\n\n- WebAssembly wrapper for XChacha20Poly1305 encryption algorithm\n- Functions directly callable from JavaScript\n- Input validation for data and keys\n- Designed for web applications that require strong encryption and decryption\n\n## Getting Started\n\n### Prerequisites\n\nEnsure the following tools are installed on your system:\n\n- Rust (latest stable version)\n- wasm-pack\n\n### Installation\n\n1. Clone the repository:\n```\ngit clone https://github.com/dumitory-dev/wasm-xchacha20poly1305-wrapper.git\n```\n\n2. Build the WebAssembly package:\n```\ncd wasm-xchacha20poly1305-wrapper\nwasm-pack build --target web\n```\n\n3. The compiled WebAssembly module will be available in the `pkg` directory.\n\n## Usage\n\nInclude the generated JavaScript and WebAssembly files in your web application:\n\n```html\n\u003cscript type=\"module\"\u003e\nimport { encrypt, decrypt, encrypt_async, decrypt_async } from './pkg/wasm_xchacha20poly1305_wrapper.js';\n\nasync function run() {\n const plaintext = new Uint8Array([72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100]); // Hello, World\n const key = new Uint8Array(32); // Use a properly generated 256-bit key for real-world applications\n\n // Synchronous encryption\n const ciphertext = encrypt(plaintext, key);\n console.log('Ciphertext:', ciphertext);\n\n // Synchronous decryption\n const decrypted = decrypt(ciphertext, key);\n console.log('Decrypted:', decrypted);\n\n // Asynchronous encryption\n const asyncCiphertext = await encrypt_async(plaintext, key);\n console.log('Async Ciphertext:', asyncCiphertext);\n\n // Asynchronous decryption\n const asyncDecrypted = await decrypt_async(asyncCiphertext, key);\n console.log('Async Decrypted:', asyncDecrypted);\n}\n\nrun();\n\u003c/script\u003e\n\n```\n## Running Tests\n\nTo run the tests for the library, execute the following command in the project's root directory:\n```\ncargo test\n```\nThis command will run all the unit tests defined in the Rust source code.\n\n## Running Benchmarks\n\nTo run benchmarks for the library, you need to install the criterion crate:\n\n```\ncargo install cargo-criterion\n```\nAfter installing cargo-criterion, you can run the benchmarks with the following command:\n\n```\ncargo criterion\n```\n\nThis command will run all the benchmark tests and generate an HTML report in the target/criterion/report directory.\n\n## License\n\nThis project is licensed under the terms of the MIT license. \nFor a copy, see https://opensource.org/licenses/MIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdumitory-dev%2Fwasm-xchacha20poly1305-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdumitory-dev%2Fwasm-xchacha20poly1305-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdumitory-dev%2Fwasm-xchacha20poly1305-wrapper/lists"}