ssoper-acts_as_encryptable 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +6 -0
- data/README.rdoc +12 -4
- data/acts_as_encryptable.gemspec +1 -1
- metadata +1 -1
data/Changelog
CHANGED
data/README.rdoc
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
= Acts As Encryptable
|
2
2
|
|
3
|
-
|
3
|
+
While other encryption libraries require a separate column for each encrypted field, ActsAsEncryptable requires only one extra column per table. It works by mashing the fields to be encrypted into a YAML string and then breaking that into bite-sized chunks which are individually encrypted and munged together into an undecipherable string that is then stored in the database.
|
4
|
+
|
5
|
+
Encryption and decryption is done with asymmetric keys using Ruby's OpenSSL libraries. While sample keys are provided for testing and development, it is highly recommended that you provide your own key pair for production use. The cryptographic library that comes with the gem can be used to generate them. Be sure to store your private key in a secure place as your data is only safe so long as your private key remains so.
|
4
6
|
|
5
7
|
|
6
8
|
== Installation
|
@@ -28,7 +30,7 @@ After installing be sure to add a column to any tables that need to be encrypted
|
|
28
30
|
Or you can use the migration helper to generate the migration for the model
|
29
31
|
./script/generate acts_as_encryptable_migration credit_cards
|
30
32
|
|
31
|
-
|
33
|
+
In your model you will setup the virtual attributes to be encrypted and pass them to acts_as_encryptable
|
32
34
|
class CreditCard < ActiveRecord::Base
|
33
35
|
attr_accessor :first_name, :last_name, :number
|
34
36
|
acts_as_encryptable :first_name, :last_name, :number
|
@@ -52,10 +54,16 @@ Decrypt your data
|
|
52
54
|
|
53
55
|
== Tests
|
54
56
|
|
55
|
-
|
57
|
+
The gem comes with unit tests that use SQLite files stored in /tmp. You can run them with the test task.
|
58
|
+
rake test
|
56
59
|
|
57
60
|
|
58
61
|
== Acknowledgements
|
59
62
|
|
60
|
-
* Tobias Lütke for his blog post on asymmetric encryption using Ruby's native SSL libraries
|
61
63
|
* Paul Barry for helping simplify the functionality
|
64
|
+
* Tobias Lütke for his blog post[link:http://blog.leetsoft.com/2006/03/14/simple-encryption] on asymmetric encryption using Ruby's native SSL libraries
|
65
|
+
|
66
|
+
== Contact
|
67
|
+
|
68
|
+
Feel free to contact me at sean.soper@gmail.com[link:mailto:sean.soper@gmail.com]
|
69
|
+
|
data/acts_as_encryptable.gemspec
CHANGED