{"id":17491768,"url":"https://github.com/membraneframework/ex_libsrtp","last_synced_at":"2025-07-04T21:32:26.532Z","repository":{"id":39996000,"uuid":"285533210","full_name":"membraneframework/ex_libsrtp","owner":"membraneframework","description":"Elixir bindings for libsrtp","archived":false,"fork":false,"pushed_at":"2023-12-14T10:19:04.000Z","size":96,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-24T11:51:33.452Z","etag":null,"topics":["elixir","libsrtp","multimedia","rtp","srtp","streaming"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/membraneframework.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":"2020-08-06T09:46:38.000Z","updated_at":"2024-10-31T08:15:54.000Z","dependencies_parsed_at":"2022-09-02T13:31:05.116Z","dependency_job_id":"d00ad7f1-16e3-47ef-9f69-ea91ae9a7a57","html_url":"https://github.com/membraneframework/ex_libsrtp","commit_stats":{"total_commits":45,"total_committers":5,"mean_commits":9.0,"dds":0.4444444444444444,"last_synced_commit":"a19be2960797c03b5dd2d2ed50772b61d478001a"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/membraneframework/ex_libsrtp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fex_libsrtp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fex_libsrtp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fex_libsrtp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fex_libsrtp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/membraneframework","download_url":"https://codeload.github.com/membraneframework/ex_libsrtp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fex_libsrtp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262886907,"owners_count":23379747,"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":["elixir","libsrtp","multimedia","rtp","srtp","streaming"],"created_at":"2024-10-19T08:04:52.378Z","updated_at":"2025-07-04T21:32:26.482Z","avatar_url":"https://github.com/membraneframework.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elixir bindings for [libsrtp]\n\n[![Hex.pm](https://img.shields.io/hexpm/v/ex_libsrtp.svg)](https://hex.pm/packages/ex_libsrtp)\n[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/ex_libsrtp/)\n[![CircleCI](https://circleci.com/gh/membraneframework/ex_libsrtp.svg?style=svg)](https://circleci.com/gh/membraneframework/ex_libsrtp)\n\n## Installation\n\nThe package can be installed by adding `:ex_libsrtp` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ex_libsrtp, \"~\u003e 0.7.2\"}\n  ]\nend\n```\n\nThis package is based on [libsrtp](https://github.com/cisco/libsrtp). The precompiled builds will be pulled and linked automatically. However, should there be any problems, consider installing it manually.\n\n### Manual instalation of dependencies\n\n#### macOS\n\n```shell\nbrew install srtp\n```\n\n#### Ubuntu\n\n```shell\napt install libsrtp2-dev\n```\n\n#### Arch/Manjaro\n\n```shell\npacman -S libsrtp\n```\n\n## Usage\n\nThis library allows to convert RTP to SRTP and the other way round. The following snippet shows how to encrypt and decrypt a packet:\n\n```elixir\niex\u003e in_srtp = ExLibSRTP.new()\niex\u003e ExLibSRTP.add_stream(in_srtp, %ExLibSRTP.Policy{ssrc: :any_inbound, key: \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"})\n:ok\niex\u003e packet = \u003c\u003c128, 14, 15, 143, 98, 145, 127, 247, 233, 164, 145, 140, 1, 2, 3, 4\u003e\u003e\niex\u003e {:ok, protected_packet} = ExLibSRTP.protect(in_srtp, packet)\n{:ok,\n \u003c\u003c128, 14, 15, 143, 98, 145, 127, 247, 233, 164, 145, 140, 112, 112, 222, 241, 148, 205, 10, 185, 78, 20, 27, 103, 2, 207\u003e\u003e}\niex\u003e out_srtp = ExLibSRTP.new()\niex\u003e ExLibSRTP.add_stream(out_srtp, %ExLibSRTP.Policy{ssrc: :any_outbound, key: \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"})\n:ok\niex\u003e {:ok, unprotected_packet} = ExLibSRTP.unprotect(out_srtp, protected_packet)\n{:ok, \u003c\u003c128, 14, 15, 143, 98, 145, 127, 247, 233, 164, 145, 140, 1, 2, 3, 4\u003e\u003e}\niex\u003e unprotected_packet == packet\ntrue\n```\n\n## Copyright and License\n\nCopyright 2020, [Software Mansion](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=ex_libsrtp)\n\n[![Software Mansion](https://logo.swmansion.com/logo?color=white\u0026variant=desktop\u0026width=200\u0026tag=membrane-github)](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=ex_libsrtp)\n\nLicensed under the [Apache License, Version 2.0](LICENSE)\n\n[libsrtp]: https://github.com/cisco/libsrtp\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fex_libsrtp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmembraneframework%2Fex_libsrtp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fex_libsrtp/lists"}