{"id":50308543,"url":"https://github.com/sorah/xaes_gcm","last_synced_at":"2026-05-28T18:30:49.703Z","repository":{"id":337916943,"uuid":"1155791325","full_name":"sorah/xaes_gcm","owner":"sorah","description":"Ruby implementation of XAES-256-GCM, an extended-nonce AEAD built on AES-256-GCM","archived":false,"fork":false,"pushed_at":"2026-02-12T01:01:33.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-13T17:08:22.297Z","etag":null,"topics":["cryptography","ruby","xaes-256-gcm"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sorah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2026-02-11T22:54:03.000Z","updated_at":"2026-02-24T08:11:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sorah/xaes_gcm","commit_stats":null,"previous_names":["sorah/xaes256gcm"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sorah/xaes_gcm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fxaes_gcm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fxaes_gcm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fxaes_gcm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fxaes_gcm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sorah","download_url":"https://codeload.github.com/sorah/xaes_gcm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fxaes_gcm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33622066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"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":["cryptography","ruby","xaes-256-gcm"],"created_at":"2026-05-28T18:30:46.013Z","updated_at":"2026-05-28T18:30:49.669Z","avatar_url":"https://github.com/sorah.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xaes_gcm\n\nRuby implementation of [XAES-256-GCM](https://c2sp.org/XAES-256-GCM), an extended-nonce AEAD built on AES-256-GCM.\n\nXAES-256-GCM uses 192-bit (24-byte) nonces instead of AES-256-GCM's 96-bit nonces. The longer nonce makes it safe to generate nonces randomly for a practically unlimited number of messages, without risking nonce reuse.\n\nThis gem implements the key and nonce derivation step of XAES-256-GCM. It derives a standard AES-256-GCM key and nonce from the extended inputs, which you then use with Ruby's built-in `OpenSSL::Cipher` for encryption and decryption.\n\n## Security Warning\n\n\u003e [!CAUTION]\n\u003e No security audits of this gem have ever been performed. USE AT YOUR OWN RISK!\n\n## Installation\n\n```bash\nbundle add xaes_gcm\n```\n\nOr install directly:\n\n```bash\ngem install xaes_gcm\n```\n\n## Usage\n\n```ruby\nrequire \"xaes_gcm\"\n\n# Create a reusable key (precomputes the AES key schedule and subkey)\nraw_key = OpenSSL::Random.random_bytes(XaesGcm::Xaes256gcm::KEY_SIZE) # 32 bytes\nkey = XaesGcm.key(256, raw_key)\n\n# Encrypt (generates a random 192-bit nonce by default)\ncipher = OpenSSL::Cipher.new(\"aes-256-gcm\")\ncipher.encrypt\nnonce = key.apply(cipher)\ncipher.auth_data = \"optional authenticated data\"\nciphertext = cipher.update(plaintext) + cipher.final\ntag = cipher.auth_tag\n\n# Decrypt (pass the same nonce used for encryption)\ndecipher = OpenSSL::Cipher.new(\"aes-256-gcm\")\ndecipher.decrypt\nkey.apply(decipher, nonce:)\ndecipher.auth_tag = tag\ndecipher.auth_data = \"optional authenticated data\"\nplaintext = decipher.update(ciphertext) + decipher.final\n```\n\n`Key#apply` generates a random nonce, derives the AES-256-GCM key and nonce, sets them on the cipher, and returns the 24-byte nonce. Pass the same nonce back for decryption. `Key` precomputes the AES key schedule and subkey, so reuse the same instance when encrypting multiple messages under the same key.\n\n## Alternative gems\n\nThere's alternative gem `xaes_256_gcm`: https://github.com/vcsjones/xaes-256-gcm-ruby\n\nKey differences:\n\n- Smaller code footprint\n  - Leaving OpenSSL::Cipher setup to the user\n- Accumulated randomized test vectors are included in the test suite\n- rbs signature\n\n## License\n\nThe gem is available as open source under the terms of the [BSD 1-Clause License](https://opensource.org/licenses/BSD-1-Clause).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorah%2Fxaes_gcm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsorah%2Fxaes_gcm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorah%2Fxaes_gcm/lists"}