New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ore-rs

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ore-rs

  • 0.7.0
  • Rubygems
  • Socket score

Version published
Maintainers
3
Created
Source

Ruby bindings for the ore.rs Order-Revealing Encryption Rust library.

Installation

For the most common platforms, we provide "native" gems (which have the shared object that provides the cryptographic primitives pre-compiled). At present, we provide native gems for:

  • Linux x86_64 and aarch64
  • macOS x86_64 and arm64

On these platforms, you can just install the ore-rs gem via your preferred method, and it should "just work". If it doesn't, please report that as a bug.

For other platforms, you will need to install the source gem, which requires that you have Rust 1.57.0 or later installed. On ARM-based platforms, you must use Rust nightly, for SIMD intrinsics support.

Installing from Git

If you have a burning need to install directly from a checkout of the git repository, you can do so by running bundle install && rake install. As this is a source-based installation, you will need to have Rust installed, as described above.

Usage

First off, load the library:

require "ore-rs"

Then create a new encryptor:

enc = ORE::AES128.new(key1, key2, 64, 8)

Encrypt a couple of ciphertexts:

ct1 = enc.encrypt(42)
ct2 = enc.encrypt(420)

Finally, compare them:

ct1 < ct2   # => true
ct1 > ct2   # => false

If you need to store a ciphertext, you can turn it into a binary string:

File.write("/tmp/ciphertext", ct1.to_s)

To turn a binary string back into a ciphertext, just create a new ciphertext with it:

ct3 = ORE::AES128::Ciphertext.new(File.binread("/tmp/ciphertext"), 8)

Contributing

Please see CONTRIBUTING.md.

FAQs

Package last updated on 05 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc