{"id":13879841,"url":"https://github.com/RubyCrypto/rbnacl","last_synced_at":"2025-07-16T16:30:24.574Z","repository":{"id":6483606,"uuid":"7723866","full_name":"RubyCrypto/rbnacl","owner":"RubyCrypto","description":"Ruby FFI binding to the Networking and Cryptography (NaCl) library (a.k.a. libsodium)","archived":false,"fork":false,"pushed_at":"2025-05-19T12:23:44.000Z","size":1091,"stargazers_count":983,"open_issues_count":6,"forks_count":88,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-07-06T20:03:49.213Z","etag":null,"topics":["chacha20","cryptography","ed25519","libsodium","nacl","ruby","salsa20","x25519"],"latest_commit_sha":null,"homepage":"","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/RubyCrypto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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}},"created_at":"2013-01-21T00:17:11.000Z","updated_at":"2025-06-29T18:30:00.000Z","dependencies_parsed_at":"2023-01-13T14:00:55.444Z","dependency_job_id":"d6ad58e3-8e4e-4cc5-803c-f84a8f689892","html_url":"https://github.com/RubyCrypto/rbnacl","commit_stats":{"total_commits":536,"total_committers":45,"mean_commits":"11.911111111111111","dds":0.6026119402985075,"last_synced_commit":"3e8d8f8822e2b8eeba215e6be027e8ee210edfb9"},"previous_names":["cryptosphere/rbnacl","crypto-rb/rbnacl"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/RubyCrypto/rbnacl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyCrypto%2Frbnacl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyCrypto%2Frbnacl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyCrypto%2Frbnacl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyCrypto%2Frbnacl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyCrypto","download_url":"https://codeload.github.com/RubyCrypto/rbnacl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyCrypto%2Frbnacl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264158820,"owners_count":23565989,"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":["chacha20","cryptography","ed25519","libsodium","nacl","ruby","salsa20","x25519"],"created_at":"2024-08-06T08:02:35.417Z","updated_at":"2025-07-16T16:30:24.542Z","avatar_url":"https://github.com/RubyCrypto.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"![RbNaCl](https://raw.github.com/RubyCrypto/rbnacl/master/images/logo.png)\n======\n[![Gem Version](https://badge.fury.io/rb/rbnacl.svg)](http://badge.fury.io/rb/rbnacl)\n[![Build Status](https://github.com/RubyCrypto/rbnacl/actions/workflows/ci.yml/badge.svg)](https://github.com/RubyCrypto/rbnacl/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/RubyCrypto/rbnacl/badge.svg?branch=master)](https://coveralls.io/r/RubyCrypto/rbnacl)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/RubyCrypto/rbnacl/blob/master/LICENSE.txt)\n\nRuby binding for [libsodium], a fork of the [Networking and Cryptography][NaCl]\nlibrary.\n\n[libsodium]: https://libsodium.org\n[NaCl]:  http://nacl.cr.yp.to/\n\n## Why libsodium/NaCl?\n\nNaCl is a different kind of cryptographic library. In the past crypto\nlibraries were kitchen sinks of little bits and pieces, like ciphers,\nMACs, signature algorithms, and hash functions. To accomplish anything\nyou had to make a lot of decisions about which specific pieces to use,\nand if any of your decisions were wrong, the result was an insecure\nsystem. The choices are also not easy: EAX? GCM? CCM? AES-CTR? CMAC?\nOMAC1? AEAD? NIST? CBC? CFB? CTR? ECB? OMGWTFBBQ!\n\nNaCl puts cryptography on Rails! Instead of making you choose which\ncryptographic primitives to use, NaCl provides convention over configuration\nin the form of expertly-assembled high-level cryptographic APIs that ensure\nnot only the confidentiality of your data, but also detect tampering.\nThese high-level, easy-to-use APIs are designed to be hard to attack by\ndefault in ways primitives exposed by libraries like OpenSSL are not.\n\nThis approach makes NaCl a lot closer to a system like GPG than it is\nto the cryptographic primitive APIs in a library like OpenSSL. In addition,\nNaCl also uses state-of-the-art encryption, including Curve25519 elliptic\ncurves and the XSalsa20 stream cipher. This means with NaCl you not only get\na system which is designed to be secure-by-default, you also get one which\nis extremely fast with comparatively small cryptographic keys.\n\n### Is it any good?\n\n[Yes.](http://news.ycombinator.com/item?id=3067434)\n\n## Supported platforms\n\nYou can use RbNaCl on platforms libsodium is supported (see below).\n\nThis library aims to support and is [tested against][github-action] the following Ruby\nversions:\n\n* Ruby 2.6\n* Ruby 2.7\n* Ruby 3.0\n* Ruby 3.1\n* Ruby 3.2\n* Ruby 3.3\n* Ruby 3.4\n* JRuby 9.4\n* JRuby 10.0\n\nIf something doesn't work on one of these versions, it's a bug.\n\n[github-action]: https://github.com/RubyCrypto/rbnacl/actions\n\n## Installation\n\nNote: [Windows installation instructions are available](https://github.com/RubyCrypto/rbnacl/wiki/Installing-libsodium#windows).\n\n### libsodium\n\nTo use RbNaCl, you will need to install libsodium:\n\nhttps://github.com/jedisct1/libsodium\n\nAt least version `1.0.0` is required.\n\nFor OS X users, libsodium is available via homebrew and can be installed with:\n\n    brew install libsodium\n\nFor FreeBSD users, libsodium is available both via pkgng and ports.  To install\na binary package:\n\n    pkg install libsodium\n\nTo install from ports on FreeBSD, use your favorite ports front end (e.g.\nportmaster or portupgrade), or use make as follows:\n\n    cd /usr/ports/security/libsodium; make install clean\n\n### RbNaCl gem\n\nOnce you have libsodium installed, add this line to your application's Gemfile:\n\n    gem 'rbnacl'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rbnacl\n\nInside of your Ruby program do:\n\n    require 'rbnacl'\n\n...to pull it in as a dependency.\n\n## Documentation\n\nRbNaCl's documentation can be found [in the Wiki][wiki]. The following features\nare supported:\n\n* [SimpleBox]: easy-to-use public-key or secret-key encryption \"on Rails\"\n* [Secret-key Encryption][secretkey]: authenticated symmetric encryption using a\n  single key shared among parties\n* [Public-key Encryption][publickey]: securely send messages to a given public\n  key which can only be decrypted by a secret key\n* [Digital Signatures][signatures]: sign messages with a private key which can\n  be verified by a public one\n* [Authenticators][macs]: create codes which can be used to check the\n  authenticity of messages\n* [Hash Functions][hashes]: compute a secure, fixed-length code from a message\n  which does not reveal the contents of the message\n\nAdditional power-user features are available. Please see the Wiki for further\ninformation.\n\n[YARD API documentation][yard] is also available.\n\n[wiki]: https://github.com/RubyCrypto/rbnacl/wiki\n[simplebox]: https://github.com/RubyCrypto/rbnacl/wiki/SimpleBox\n[secretkey]: https://github.com/RubyCrypto/rbnacl/wiki/Secret-Key-Encryption\n[publickey]: https://github.com/RubyCrypto/rbnacl/wiki/Public-Key-Encryption\n[signatures]: https://github.com/RubyCrypto/rbnacl/wiki/Digital-Signatures\n[macs]: https://github.com/RubyCrypto/rbnacl/wiki/HMAC\n[hashes]: https://github.com/RubyCrypto/rbnacl/wiki/Hash-Functions\n[yard]: http://www.rubydoc.info/gems/rbnacl\n\n## Learn More\n\nWhile NaCl has designed to be easier-than-usual to use for a crypto\nlibrary, cryptography is an incredibly difficult subject and it's\nalways helpful to know as much as you can about it before applying\nit to a particular use case. That said, the creator of NaCl, Dan\nBernstein, has published a number of papers about NaCl. If you are\ninterested in learning more about how NaCl works, it's recommended\nthat you read them:\n\n* [Cryptography in NaCl](http://cr.yp.to/highspeed/naclcrypto-20090310.pdf)\n* [Salsa20 Design](https://cr.yp.to/snuffle/design.pdf)\n* [Curve25519: new Diffie-Hellman speed records](http://cr.yp.to/ecdh/curve25519-20060209.pdf)\n* [Ed25519: High-speed high-security signatures](http://ed25519.cr.yp.to/ed25519-20110926.pdf)\n\nFor more information on libsodium, please check out the\n[Introducing Sodium blog post](http://labs.umbrella.com/2013/03/06/announcing-sodium-a-new-cryptographic-library/)\n\nHave a general interest in cryptography? Check out the free course\nCoursera offers from Stanford University Professor Dan Boneh:\n\n[http://crypto-class.org](http://crypto-class.org)\n\n## Important Questions\n\n### Is it \"Military Grade™\"?\n\nOnly if your military understands twisted Edwards curves\n\n### Is it \"Bank Grade™\"?\n\nNo, that means 3DES, which this library doesn't support, sorry\n\n### Does it have a lock with a checkmark?\n\nSure, here you go:\n\n![Checkmarked Lock](http://i.imgur.com/dwA0Ffi.png)\n\n## Contributing\n\n* Fork this repository on Github\n* Make your changes and send a pull request\n* If your changes look good, we'll merge 'em\n\n## License\n\nCopyright (c) 2012-2018 Tony Arcieri, Jonathan Stott. Distributed under the MIT License.\nSee [LICENSE.txt] for further details.\n\n[LICENSE.txt]: https://github.com/RubyCrypto/rbnacl/blob/master/LICENSE.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRubyCrypto%2Frbnacl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRubyCrypto%2Frbnacl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRubyCrypto%2Frbnacl/lists"}