{"id":30873534,"url":"https://github.com/sdaubert/packetgen-plugin-ipsec","last_synced_at":"2025-09-15T12:44:56.572Z","repository":{"id":56887215,"uuid":"151827884","full_name":"sdaubert/packetgen-plugin-ipsec","owner":"sdaubert","description":"IPsec plugin for packetgen","archived":false,"fork":false,"pushed_at":"2025-04-21T13:58:29.000Z","size":142,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-07T23:20:34.388Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdaubert.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":"2018-10-06T10:12:52.000Z","updated_at":"2025-04-21T13:56:25.000Z","dependencies_parsed_at":"2023-02-02T20:02:52.010Z","dependency_job_id":null,"html_url":"https://github.com/sdaubert/packetgen-plugin-ipsec","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sdaubert/packetgen-plugin-ipsec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdaubert%2Fpacketgen-plugin-ipsec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdaubert%2Fpacketgen-plugin-ipsec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdaubert%2Fpacketgen-plugin-ipsec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdaubert%2Fpacketgen-plugin-ipsec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdaubert","download_url":"https://codeload.github.com/sdaubert/packetgen-plugin-ipsec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdaubert%2Fpacketgen-plugin-ipsec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275260468,"owners_count":25433379,"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","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-09-07T23:11:26.725Z","updated_at":"2025-09-15T12:44:56.539Z","avatar_url":"https://github.com/sdaubert.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/packetgen-plugin-ipsec.svg)](https://badge.fury.io/rb/packetgen-plugin-ipsec)\n[![Build Status](https://travis-ci.com/sdaubert/packetgen-plugin-ipsec.svg?branch=master)](https://travis-ci.com/sdaubert/packetgen-plugin-ipsec)\n\n# packetgen-plugin-ipsec\n\nThis is a plugin for [PacketGen gem](https://github.com/sdaubert/packetgen). It adds two protocols:\n\n* `PacketGen::Plugin::ESP`: IP Encapsulating Security Payload ([RFC 4303](https://tools.ietf.org/html/rfc4303)),\n* `PacketGen::Plugin::IKE`: Internet Key Exchange v2 ([RFC 7296](https://tools.ietf.org/html/rfc7296)).\n\nVersions 1.0.x are compatible with PacketGen 3.x.\n\nVersions 1.1.x are compatible with PacketGen 4.x.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'packetgen-plugin-ipsec'\n```\n\nAnd then execute:\n\n```bash\nbundle\n```\n\nOr install it yourself as:\n\n```bash\ngem install packetgen-plugin-ipsec\n```\n\n## Usage\n\nFirst, you have to require packetgen-plugin-ipsec:\n\n```ruby\nrequire 'packetgen-plugin-ipsec'\n```\n\n### Parse an ESP or IKE packet\n\n```ruby\npkt = PacketGen.parse(str)\n```\n\n### Read a PcapNG file containing ESP and/or IKE packets\n\n```ruby\npkts = PacketGen.read('ipsec.pcapng')\n```\n\n### Access to ESP and IKE headers\n\n```ruby\npkt.esp   #=\u003e PacketGen::Plugin::ESP\npkt.ike   #=\u003e PacketGen::Plugin::IKE\n```\n\n### Forge packets\n\n#### ESP (transport mode)\n\n```ruby\npkt = PacketGen.gen('IP', src: '1.1.1.1', dst: '2.2.2.2').\n                add('ESP', spi: 0xff456e01, sn: 12345678).\n                add('UDP', dport: 4567, sport: 45362, body 'abcdef')\ncipher = OpenSSL::Cipher.new('aes-128-cbc')\ncipher.encrypt\ncipher.key = 16bytes_key\niv = 16bytes_iv\npkt.esp.esp.encrypt! cipher, iv\npkt.to_w\n```\n\n#### IKE (IKE_SA_INIT)\n\n```ruby\npkt = PacketGen.gen('IP', src: '1.1.1.1', dst: '2.2.2.2').\n                add('UDP').\n                add('IKE', init_spi: spi, flags: 8).\n                add('IKE::SA').\n                add('IKE::KE', group: 'ECP256', content: key_ex_data).\n                add('IKE::Nonce', content: nonce_data)\npkt.ike_sa.proposals \u003c\u003c { num: 1, protocol: 'IKE' }\npkt.ike_sa.proposals.first.transforms \u003c\u003c { type: 'ENCR', id: 'AES_CTR' }\npkt.ike_sa.proposals[0].transforms[0].attributes \u003c\u003c { type: 0x800e, value: 128 }\npkt.to_w\n```\n\n## See also\n\nAPI documentation: \u003chttp://www.rubydoc.info/gems/packetgen-plugin-ipsec\u003e\n\n## License\n\nMIT License (see [LICENSE](https://github.com/sdaubert/packetgen-plugin-ipsec/blob/master/LICENSE))\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at \u003chttps://github.com/sdaubert/packetgen-plugin-ipsec\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdaubert%2Fpacketgen-plugin-ipsec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdaubert%2Fpacketgen-plugin-ipsec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdaubert%2Fpacketgen-plugin-ipsec/lists"}