{"id":16793483,"url":"https://github.com/mdp/gibberish","last_synced_at":"2025-05-16T00:09:06.551Z","repository":{"id":56874147,"uuid":"1521554","full_name":"mdp/gibberish","owner":"mdp","description":"Simple Ruby encryption module","archived":false,"fork":false,"pushed_at":"2019-06-18T15:59:14.000Z","size":197,"stargazers_count":372,"open_issues_count":0,"forks_count":37,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-14T10:46:02.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.rubydoc.info/github/mdp/gibberish","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/mdp.png","metadata":{"files":{"readme":"README.markdown","changelog":"CHANGELOG.mdown","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":"2011-03-24T16:06:25.000Z","updated_at":"2024-12-31T15:42:01.000Z","dependencies_parsed_at":"2022-08-20T22:30:22.892Z","dependency_job_id":null,"html_url":"https://github.com/mdp/gibberish","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fgibberish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fgibberish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fgibberish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdp%2Fgibberish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdp","download_url":"https://codeload.github.com/mdp/gibberish/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442855,"owners_count":22071878,"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":[],"created_at":"2024-10-13T08:49:26.389Z","updated_at":"2025-05-16T00:09:01.533Z","avatar_url":"https://github.com/mdp.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gibberish - A ruby encryption library\n[![Travis](https://travis-ci.org/mdp/gibberish.svg?branch=master)](https://travis-ci.org/mdp/gibberish)\n\n**Note: It's 2017 and if you're looking for a modern and actively maintained Ruby encryption library you should do yourself a favor and check out [RbNaCl](https://github.com/cryptosphere/rbnacl). Gibberish was started in 2011 when encryption on Ruby was not a trivial matter, however thanks to projects like [NaCl](https://nacl.cr.yp.to/) and [LibSodium](https://download.libsodium.org/doc/) that's no longer the case.**\n\n*NOTICE: Breaking Changes in 2.0*\n\nCheckout the [Changelog](CHANGELOG.mdown) for a full list of changes in 2.0\n\n## Goals\n- AES encryption should have sensible defaults\n- AES should be interoperable with SJCL for browser based decryption/encryption\n- Simple API for HMAC/Digests\n- Targets more recent versions of Ruby(\u003e=2.0) with better OpenSSL support\n\n## Requirements\n\nRuby 2.0 or later, compiled with OpenSSL support\n\n## Installation\n\n    gem install gibberish\n\n## AES\n\nAES encryption with sensible defaults:\n\n- 100,000 iterations of PBKDF2 password hardening\n- GCM mode with authentication\n- Ability to include authenticated data\n- Compatible with [SJCL](http://bitwiseshiftleft.github.io/sjcl/), meaning all ciphertext is decryptable in JS via [SJCL](http://bitwiseshiftleft.github.io/sjcl/)\n\n### Encrypting\n\n    cipher = Gibberish::AES.new('p4ssw0rd')\n    cipher.encrypt(\"some secret text\")\n    # =\u003e Outputs a JSON string containing everything that needs to be saved for future decryption\n    # Example:\n    # '{\"v\":1,\"adata\":\"\",\"ks\":256,\"ct\":\"ay2varjSFUMUmtvZeh9755GVyCkWHG0/BglJLQ==\",\"ts\":96,\"mode\":\"gcm\",\n    # \"cipher\":\"aes\",\"iter\":100000,\"iv\":\"K4ZShCQGL3UZr78y\",\"salt\":\"diDUzbc9Euo=\"}'\n\n### Decrypting\n\n    cipher = Gibberish::AES.new('p4ssw0rd')\n    cipher.decrypt('{\"v\":1,\"adata\":\"\",\"ks\":256,\"ct\":\"ay2varjSFUMUmtvZeh9755GVyCkWHG0/BglJLQ==\",\"ts\":96,\"mode\":\"gcm\",\"cipher\":\"aes\",\"iter\":100000,\"iv\":\"K4ZShCQGL3UZr78y\",\"salt\":\"diDUzbc9Euo=\"}')\n    # =\u003e \"some secret text\"\n\n### Interoperability with SJCL (JavaScript - Browser/Node.js)\n\nAES ciphertext from Gibberish is compatible with [SJCL](http://bitwiseshiftleft.github.io/sjcl/), a JavaScript library which\nworks in the browser and Node.js\n\n[See the full docs](http://www.rubydoc.info/github/mdp/gibberish/Gibberish/AES) for information on SJCL interoperability.\n\n### Gibberish 1.x Encryption (CBC)\n\nPrior to Gibberish 2.0, the default encryption mode was CBC. You can still access this\nby calling it explicitly:\n\n    cipher = Gibberish::AES::CBC.new('p4ssw0rd')\n    cipher.encrypt(\"Some secret text\")\n\n## HMAC\n\n    Gibberish::HMAC256(\"password\", \"data\")\n    # =\u003e \"cccf6f0334130a7010d62332c75b53e7d8cea715e52692b06e9cd41b05644be3\"\n\n[See the full docs](http://www.rubydoc.info/github/mdp/gibberish/Gibberish/HMAC)\n\n## Digests\n\n    Gibberish::MD5(\"somedata\")\n    #=\u003e aefaf7502d52994c3b01957636a3cdd2\n\n    Gibberish::SHA1(\"somedata\")\n    #=\u003e efaa311ae448a7374c122061bfed952d940e9e37\n\n    Gibberish::SHA224(\"somedata\")\n    #=\u003e a39b86d838273f5ff4879c26f85e3cb333bb44d73b24f275bad1a6c6\n\n    Gibberish::SHA256(\"somedata\")\n    #=\u003e 87d149cb424c0387656f211d2589fb5b1e16229921309e98588419ccca8a7362\n\n    Gibberish::SHA384(\"somedata\")\n    #=\u003e b6800736973cc061e3efb66a34f8bda8fa946804c6cc4f26a6b9b3950211078801709d0d82707c569a07c8f63c804c87\n\n    Gibberish::SHA512(\"somedata\")\n    #=\u003e a053441b6de662599ecb14c580d6637dcb856a66b2a40a952d39df772e47e98ea22f9e105b31463c5cf2472feae7649464fe89d99ceb6b0bc398a6926926f416\n\n[See the full docs](http://www.rubydoc.info/github/mdp/gibberish/Gibberish/Digest)\n\n## Run the tests\n\n    git clone https://github.com/mdp/gibberish.git\n    cd gibberish\n    make\n\n### Benchmarking AES with PBKDF2\n\n    make benchmark\n    # Change the PBKDF2 iterations\n    ITER=10000 make benchmark\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdp%2Fgibberish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdp%2Fgibberish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdp%2Fgibberish/lists"}