README.md in symmetric-encryption-0.8.0 vs README.md in symmetric-encryption-0.9.0
- old
+ new
@@ -127,11 +127,23 @@
file.write "Hello World\n"
file.write "Compress this\n"
file.write "Keep this safe and secure\n"
end
+### Standalone test
+Before generating keys we can use SymmetricEncryption in a standalone test environment:
+
+ # Use test encryption keys
+ SymmetricEncryption.cipher = SymmetricEncryption::Cipher.new(
+ :key => '1234567890ABCDEF1234567890ABCDEF',
+ :iv => '1234567890ABCDEF',
+ :cipher => 'aes-128-cbc'
+ )
+ encrypted = SymmetricEncryption.encrypt('hello world')
+ puts SymmetricEncryption.decrypt(encrypted)
+
### Generating encrypted passwords
The following rake task can be used to generate encrypted passwords for the
specified environment
@@ -141,15 +153,15 @@
## Installation
### Add to an existing Rails project
Add the following line to Gemfile
- gem 'symmetric-encryption'
+ gem 'symmetric-encryption'
Install the Gem with bundler
- bundle install
+ bundle install
## Rails Configuration
### Creating the configuration file
@@ -158,11 +170,11 @@
to these files in production. Once the config file has been generated it can be
modified as needed.
Generate the configuration file:
- rails generate symmetric_encryption:config /etc/rails/keys
+ rails generate symmetric_encryption:config /etc/rails/keys
Note: Ignore the warning about "Symmetric Encryption config not found" since it is
being generated
#### Save to version control
@@ -222,10 +234,10 @@
SymmetricEncryption can also be used in non-Rails environment.
Install SymmetricEncryption
- gem install symmetric-encryption
+ gem install symmetric-encryption
Manually create a symmetric-encryption.yml configuration file based on the
one supplied in examples/symmetric-encryption.yml.
At application startup, run the code below to initialize symmetric-encryption prior to