Giter Site home page Giter Site logo

coreymartella / lucifer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jmckible/lucifer

2.0 2.0 0.0 88 KB

Rails plugin to transparently encrypt attributes

Home Page: http://tuples.us/2008/06/17/the-prince-of-darkness-and-database-encryption/

License: Other

Ruby 100.00%

lucifer's Introduction

lucifer

Lucifer is Rails plugin which utilizes the ezcrypto gem to encrypt/decrypt database columns transparently.

Why is it called Lucifer? en.wikipedia.org/wiki/Lucifer_(cipher)

This is a fork of Jordan McKible’s implementation (github.com/jmckible/lucifer) that uses base64 encoding instead of binary.

Installation

./script/plugin install git://github.com/coreymartella/lucifer.git

Lucifer looks for a key and salt in config/key.yml. See key.yml.example

Usage

Add Lucifer to a class like so:

class Person < ActiveRecord::Base
  # Database columns - id(integer), ssn_encrypted(string)
  encrypt_attributes
end

Lucifer will treat any binary column that ends in _encrypted as encryptable.

person = Person.new :ssn=>'000-00-0000'
=> Person...
person.save
=> true
Person.first.ssn
=> '000-00-0000'

If you check out the database, you’ll see

> select * from people;
 -----------------------------------------
| id         | ssn_encrypted             |
 -----------------------------------------
| 1          | VY+7NpM3ZiUohaDNH7TDFA==  |
 -----------------------------------------

Configuration

You can customize Lucifer by passing options like so:

class Person < ActiveRecord::Base
  encrypt_attributes :suffix=>'_obfuscated', :key_file=>'lucifer.yml'
end
  • :suffix - You can override the _encrypted selector with this option

  • :key_file - If you’d like to use a different file in your config/ directory, pass the name here

Author

lucifer's People

Contributors

coreymartella avatar jmckible avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.