{"id":30584998,"url":"https://github.com/finitelabs/lua-noiseprotocol","last_synced_at":"2026-01-28T04:54:28.333Z","repository":{"id":312155128,"uuid":"1013904287","full_name":"finitelabs/lua-noiseprotocol","owner":"finitelabs","description":"Pure Lua implementation of the Noise Protocol Framework for building secure communication channels with modern cryptography. No C   dependencies, supports Lua 5.1+ and LuaJIT.","archived":false,"fork":false,"pushed_at":"2026-01-23T21:27:15.000Z","size":805,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-24T11:21:03.526Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/finitelabs.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-04T17:02:22.000Z","updated_at":"2026-01-23T21:27:01.000Z","dependencies_parsed_at":"2025-08-29T02:30:48.314Z","dependency_job_id":"63a6401c-f268-4671-a63f-e1858a0fb85e","html_url":"https://github.com/finitelabs/lua-noiseprotocol","commit_stats":null,"previous_names":["finitelabs/lua-noiseprotocol"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/finitelabs/lua-noiseprotocol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finitelabs%2Flua-noiseprotocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finitelabs%2Flua-noiseprotocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finitelabs%2Flua-noiseprotocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finitelabs%2Flua-noiseprotocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/finitelabs","download_url":"https://codeload.github.com/finitelabs/lua-noiseprotocol/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finitelabs%2Flua-noiseprotocol/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28839257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T02:10:51.810Z","status":"ssl_error","status_checked_at":"2026-01-28T02:10:50.806Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-08-29T10:36:47.402Z","updated_at":"2026-01-28T04:54:28.327Z","avatar_url":"https://github.com/finitelabs.png","language":"Lua","funding_links":["https://www.buymeacoffee.com/derek.miller"],"categories":[],"sub_categories":[],"readme":"# lua-noiseprotocol\n\nA pure Lua implementation of the\n[Noise Protocol Framework](https://noiseprotocol.org) with **zero external\ndependencies**. This library provides a complete, portable implementation that\nruns on Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT.\n\n## Features\n\n- **Zero Dependencies**: Pure Lua implementation, no C extensions or external\n  libraries required\n- **Portable**: Runs on any Lua interpreter (5.1+)\n- **Complete**: Full implementation of the Noise Protocol Framework\n- **Cryptographic Primitives**: Includes all Diffie-Hellman (DH), AEAD encryption, and hashing\n  algorithms listed in the specification\n- **Well-tested**: Comprehensive test suite with RFC test vectors\n\n## Installation\n\n### Option 1: Single-file Distribution (Recommended)\n\nDownload a pre-built single-file module from the\n[Releases](https://github.com/finitelabs/lua-noiseprotocol/releases) page:\n\n- **`noiseprotocol.lua`** - Complete bundle with all dependencies included (zero\n  external dependencies)\n- **`noiseprotocol-core.lua`** - Core library only, requires `vendor.bitn` to be\n  installed separately\n\n### Option 2: From Source\n\nClone this repository:\n\n```bash\ngit clone https://github.com/finitelabs/lua-noiseprotocol.git\ncd lua-noiseprotocol\n```\n\nAdd the `src` and `vendor` directories to your Lua path, or copy the files to\nyour project.\n\n## Usage\n\n### Basic Example\n\nHere's a complete example of the Noise XX pattern from the specification:\n\n```lua\nlocal noise = require(\"noiseprotocol\")\n\n-- Optionally enable OpenSSL support if available\n-- noise.use_openssl(true)\n\n-- Generate static keys for both parties\nlocal alice_static_key = noise.DH[\"25519\"].generate_keypair()\nlocal bob_static_key = noise.DH[\"25519\"].generate_keypair()\n\n-- Create initiator (Alice) and responder (Bob)\nlocal alice = noise.NoiseConnection:new({\n  protocol_name = \"Noise_XX_25519_ChaChaPoly_SHA256\",\n  initiator = true,\n  static_key = alice_static_key\n})\n\nlocal bob = noise.NoiseConnection:new({\n  protocol_name = \"Noise_XX_25519_ChaChaPoly_SHA256\",\n  initiator = false,\n  static_key = bob_static_key\n})\n\n-- Start handshake with optional prologue\nlocal prologue = \"MyAppv1.0\"\nalice:start_handshake(prologue)\nbob:start_handshake(prologue)\n\n-- XX Handshake:\n-- -\u003e e\nlocal msg1 = alice:write_handshake_message(\"\")\nbob:read_handshake_message(msg1)\n\n-- \u003c- e, ee, s, es\nlocal msg2 = bob:write_handshake_message(\"\")\nalice:read_handshake_message(msg2)\n\n-- -\u003e s, se\nlocal msg3 = alice:write_handshake_message(\"\")\nbob:read_handshake_message(msg3)\n\n-- Handshake complete!\n-- Both parties now have authenticated each other's static keys\nprint(\"Handshake complete!\")\n-- Print first 16 bytes of handshake hash as hex\nlocal utils = require(\"noiseprotocol.utils\")\nlocal hash = alice:get_handshake_hash()\nprint(\"Alice handshake hash:\", bytes.to_hex(hash):sub(1, 32)) -- 32 hex chars = 16 bytes\n\n-- Transport phase - send encrypted messages\nlocal ciphertext1 = alice:send_message(\"Hello Bob!\")\nlocal plaintext1 = bob:receive_message(ciphertext1)\nprint(\"Bob received:\", plaintext1)\n\nlocal ciphertext2 = bob:send_message(\"Hello Alice!\")\nlocal plaintext2 = alice:receive_message(ciphertext2)\nprint(\"Alice received:\", plaintext2)\n```\n\n### Supported Patterns\n\nAll one-way and interactive patterns from the Noise specification are supported:\n\n- One-way: N, K, X\n- Interactive: NN, NK, NX, KN, KK, KX, XN, XK, XX\n- Interactive + initiator auth: IN, IK, IX\n- PSK patterns: NNpsk0, NNpsk2, etc.\n\n### Supported Algorithms\n\n- **DH**: 25519, 448\n- **AEAD**: ChaChaPoly, AESGCM\n- **Hash**: SHA256, SHA512, BLAKE2s, BLAKE2b\n\n## Testing\n\nRun the test suite:\n\n```bash\n# Run all tests with default Lua interpreter\n./run_tests.sh\n\n# Run with specific Lua version\nLUA_BINARY=lua5.1 ./run_tests.sh\n\n# Run specific modules\n./run_tests.sh chacha20 poly1305\n\n# Run test matrix across all Lua versions\n./run_tests_matrix.sh\n```\n\n## Current Limitations\n\n- Pure Lua performance is slower than native implementations\n- No constant-time guarantees (not suitable for production use without\n  additional hardening)\n\n## Future Plans\n\n- Performance optimizations for the pure Lua implementation\n\n## Security Warning\n\nThis is a pure Lua implementation intended for portability and ease of use.\nWhile we implement the algorithms correctly and pass all test vectors, the\nimplementation:\n\n- Cannot guarantee constant-time operations\n- Has not been independently audited\n- Is significantly slower than native implementations\n\nFor production use, especially in security-critical applications, consider using\nnative cryptographic libraries.\n\n## License\n\nGNU Affero General Public License v3.0 - see LICENSE file for details\n\n## Contributing\n\nContributions are welcome! Please ensure all tests pass and add new tests for\nany new functionality.\n\n---\n\n\u003ca href=\"https://www.buymeacoffee.com/derek.miller\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinitelabs%2Flua-noiseprotocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinitelabs%2Flua-noiseprotocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinitelabs%2Flua-noiseprotocol/lists"}