{"id":15681071,"url":"https://github.com/lmangani/rtptool-wasm","last_synced_at":"2025-05-07T11:42:18.987Z","repository":{"id":57355784,"uuid":"307222354","full_name":"lmangani/rtptool-wasm","owner":"lmangani","description":"Experimental WASM PCAP RTP Extraction and SRTP Decryption","archived":false,"fork":false,"pushed_at":"2022-05-21T10:39:45.000Z","size":520,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-31T09:41:11.517Z","etag":null,"topics":["c","ecmascript","libpcap","nodejs","pcap","rtp","srtp","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://lmangani.github.io/rtptool-wasm/","language":"C","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/lmangani.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":"2020-10-26T00:33:23.000Z","updated_at":"2022-12-01T06:46:21.000Z","dependencies_parsed_at":"2022-09-05T22:12:40.151Z","dependency_job_id":null,"html_url":"https://github.com/lmangani/rtptool-wasm","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmangani%2Frtptool-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmangani%2Frtptool-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmangani%2Frtptool-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmangani%2Frtptool-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmangani","download_url":"https://codeload.github.com/lmangani/rtptool-wasm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252873478,"owners_count":21817704,"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":["c","ecmascript","libpcap","nodejs","pcap","rtp","srtp","wasm","webassembly"],"created_at":"2024-10-03T16:49:08.957Z","updated_at":"2025-05-07T11:42:18.965Z","avatar_url":"https://github.com/lmangani.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n┬─┐┌┬┐┌─┐┌┬┐┌─┐┌─┐┬    ┬ ┬┌─┐┌─┐┌┬┐\n├┬┘ │ ├─┘ │ │ ││ ││    │││├─┤└─┐│││\n┴└─ ┴ ┴   ┴ └─┘└─┘┴─┘  └┴┘┴ ┴└─┘┴ ┴\n```\n\nExtract RTP and Decrypt SRTP Audio streams from .PCAP files in the browser using WASM\n\n### Status\n- [x] WASM code is working, but experimental!\n- [x] PCAP-\u003e RTP-\u003e SSRC Extraction \n- [x] PCMA/PCMU native decoder\n- [ ] Raw decoding with [FFMPEG-WASM](https://github.com/lmangani/ffmpeg-wasm-voip)\n\n### Build Native\n###### x86_64\n`./build.sh` \n\n###### WASM using Docker\n`./build-wasm-docker.sh`\n\n\n-------------------\n### WASM Module Usage\nCheck out the included [example](wasm/dist/api.js) for API usage.\n```\nnpm run test\n```\n\nIn a nutshell:\n```javascript\n  // Write or fetch binary PCAP data from JS to the virtual FS\n  Module.FS.writeFile('tmp.pcap', raw_pcap_data);\n  // Analyze the virtual PCAP file in wasm\n  Module.api.analyze('tmp.pcap', 'report.json');\n  // Read the analysis output back into JS\n  Module.FS.readFile('report.json', {encoding: 'utf8'});\n```\n\n```\nnpm run test\n```\n\n##### Functions\n- [x] analyze_pcap\n- [x] extract_pcap\n- [x] decrypt_pcap\n\n##### API\n```javascript\nconst api = {\n  version: Module.cwrap('version', 'string', []), // null\n  analyze: Module.cwrap('analyze_pcap', 'string', ['string']), // filename\n  extract: Module.cwrap('extract_pcap', 'string', ['string', 'string']), // ssrc, filename\n  decrypt: Module.cwrap('decrypt_pcap', 'string', ['string', 'string', 'string']), // ssrc, key, filename\n};\n```\n\n### Command-Line Usage\n```\n./dist/rtptool analyze \u003cinput file\u003e\n```\n\nExtract RTP streams by ssrc prefixed by `0x`\n```\n./dist/rtptool extract \u003cssrc\u003e \u003cinput file\u003e\n```\n\nDecrypt SRTP streams by ssrc using the RFC4568 key\n\n```\n./dist/rtptool decrypt \u003cssrc\u003e \u003ckey\u003e \u003cinput file\u003e\n```\nExample Key: `AES_CM_128_HMAC_SHA1_80 inline:fCaLYx1IEhD62eKqFIGOk1qykNikYcamkFVkde1b|2^31|1:1`\n\n\n### Credits\nBased on [srtpdecrypt](jacquy@posteo.de)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmangani%2Frtptool-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmangani%2Frtptool-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmangani%2Frtptool-wasm/lists"}