{"id":13879801,"url":"https://github.com/jwt/ruby-jwe","last_synced_at":"2026-02-14T00:02:28.220Z","repository":{"id":56879732,"uuid":"49360484","full_name":"jwt/ruby-jwe","owner":"jwt","description":"JSON Web Encryption for Ruby","archived":false,"fork":false,"pushed_at":"2025-08-24T12:50:46.000Z","size":90,"stargazers_count":71,"open_issues_count":7,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-04T22:33:30.452Z","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/jwt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-01-10T09:12:27.000Z","updated_at":"2025-10-29T06:33:15.000Z","dependencies_parsed_at":"2024-06-18T18:14:32.126Z","dependency_job_id":"f859ff67-be14-4cc5-80d8-8df6cd50a606","html_url":"https://github.com/jwt/ruby-jwe","commit_stats":null,"previous_names":["aomega08/jwe"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jwt/ruby-jwe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwt%2Fruby-jwe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwt%2Fruby-jwe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwt%2Fruby-jwe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwt%2Fruby-jwe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwt","download_url":"https://codeload.github.com/jwt/ruby-jwe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwt%2Fruby-jwe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29363987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: 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":"2024-08-06T08:02:33.890Z","updated_at":"2026-02-14T00:02:28.176Z","avatar_url":"https://github.com/jwt.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# JWE\n\n[![Build Status](https://github.com/jwt/ruby-jwe/actions/workflows/test.yml/badge.svg)](https://github.com/jwt/ruby-jwe/actions/workflows/test.yml)\n[![Gem Version](https://badge.fury.io/rb/jwe.svg)](https://badge.fury.io/rb/jwe)\n\nA ruby implementation of the [RFC 7516 JSON Web Encryption (JWE)](https://tools.ietf.org/html/rfc7516) standard.\n\n## Installing\n\n```bash\ngem install jwe\n```\n## Usage\n\nThis example uses the default alg and enc methods (RSA-OAEP and A128GCM). It requires an RSA key.\n\n```ruby\nrequire 'jwe'\n\nkey = OpenSSL::PKey::RSA.generate(2048)\npayload = \"The quick brown fox jumps over the lazy dog.\"\n\nencrypted = JWE.encrypt(payload, key)\nputs encrypted\n\nplaintext = JWE.decrypt(encrypted, key)\nputs plaintext #\"The quick brown fox jumps over the lazy dog.\"\n```\n\nThis example uses a custom enc method:\n\n```ruby\nrequire 'jwe'\n\nkey = OpenSSL::PKey::RSA.generate(2048)\npayload = \"The quick brown fox jumps over the lazy dog.\"\n\nencrypted = JWE.encrypt(payload, key, enc: 'A192GCM')\nputs encrypted\n\nplaintext = JWE.decrypt(encrypted, key)\nputs plaintext #\"The quick brown fox jumps over the lazy dog.\"\n```\n\nThis example uses the 'dir' alg method. It requires an encryption key of the correct size for the enc method\n\n```ruby\nrequire 'jwe'\n\nkey = SecureRandom.random_bytes(32)\npayload = \"The quick brown fox jumps over the lazy dog.\"\n\nencrypted = JWE.encrypt(payload, key, alg: 'dir')\nputs encrypted\n\nplaintext = JWE.decrypt(encrypted, key)\nputs plaintext #\"The quick brown fox jumps over the lazy dog.\"\n```\n\nThis example uses the DEFLATE algorithm on the plaintext to reduce the result size.\n\n```ruby\nrequire 'jwe'\n\nkey = OpenSSL::PKey::RSA.generate(2048)\npayload = \"The quick brown fox jumps over the lazy dog.\"\n\nencrypted = JWE.encrypt(payload, key, zip: 'DEF')\nputs encrypted\n\nplaintext = JWE.decrypt(encrypted, key)\nputs plaintext #\"The quick brown fox jumps over the lazy dog.\"\n```\n\nThis example sets an extra **plaintext** custom header.\n\n```ruby\nrequire 'jwe'\n\nkey = OpenSSL::PKey::RSA.generate(2048)\npayload = \"The quick brown fox jumps over the lazy dog.\"\n\n# In this case we add a copyright line to the headers (it can be anything you like\n# just remember it is plaintext).\nencrypted = JWE.encrypt(payload, key, copyright: 'This is my stuff! All rights reserved')\nputs encrypted\n```\n\n## Available Algorithms\n\nThe RFC 7518 JSON Web Algorithms (JWA) spec defines the algorithms for [encryption](https://tools.ietf.org/html/rfc7518#section-5.1)\n and [key management](https://tools.ietf.org/html/rfc7518#section-4.1) to be supported by a JWE implementation.\n\nOnly a subset of these algorithms is implemented in this gem. Striked elements are not available:\n\nKey management:\n* RSA1_5\n* RSA-OAEP (default)\n* RSA-OAEP-256 (if OpenSSL::VERSION \u003e= '3.0')\n* A128KW\n* A192KW\n* A256KW\n* dir\n* ~~ECDH-ES~~\n* ~~ECDH-ES+A128KW~~\n* ~~ECDH-ES+A192KW~~\n* ~~ECDH-ES+A256KW~~\n* ~~A128GCMKW~~\n* ~~A192GCMKW~~\n* ~~A256GCMKW~~\n* ~~PBES2-HS256+A128KW~~\n* ~~PBES2-HS384+A192KW~~\n* ~~PBES2-HS512+A256KW~~\n\nEncryption:\n* A128CBC-HS256\n* A192CBC-HS384\n* A256CBC-HS512\n* A128GCM (default)\n* A192GCM\n* A256GCM\n\n## License\n\nThe MIT License\n\n* Copyright © 2016 Francesco Boffa\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwt%2Fruby-jwe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwt%2Fruby-jwe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwt%2Fruby-jwe/lists"}