inline_encryption

A simple encryption tool based on common convention


License
MIT
Install
gem install inline_encryption -v 1.0.4

Documentation

inline_encryption Build StatusCode Climate

Simple encryption relying on convention and designed to be used inline as string replacements.

PLEASE upgrade to version 2.0 - previous versions lend themselves to making human errors which could lead to exploitation.

Upgrading from 1.0 to 2.0

  1. Recommended, but optional - generate a new RSA key pair
  2. For a properly configured production environment, simply configure with a private key
  3. Pass along the public key to any developers on the team that will need to encrypt new values

Usage

Imagine you have a file named database.yml that contains passwords.

Before:

password: '123456'

After:

password: <%= InlineEncryption.decrypt(encrypted stuff goes here) %>

To set up:

InlineEncryption.config[:key] = '/some/rsa_key'

An example of different keys per environment:

InlineEncryption.config[:key] = ENV['INLINE_ENCRYPTION_KEY']

If you've configured with a private key, you can both encrypt and decrypt. If you've configured with a public key, you can only encrypt.