cerebus 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +27 -7
  2. data/lib/cerebus.rb +1 -1
  3. metadata +1 -1
data/README.md CHANGED
@@ -2,12 +2,23 @@
2
2
 
3
3
  ## Summary
4
4
 
5
- This is a simple library which wraps openssl to provide a (hopefully)
6
- secure encryption system for arbitrary strings. The aim was to remove
7
- all the hard stuff and make it blindingly easy to encrypt and decrypt
8
- strings. Of course, this doesn't mean you can ignore basic crypographic
9
- best practices. If you store all your keys insecurely then you might as
10
- well use rot13.
5
+ Cerebus was the many headed guardian at the entrance of hell. So... he
6
+ guards things of little value, kind of like this library. This is a simple
7
+ library which wraps openssl to provide a (hopefully) secure encryption
8
+ system for arbitrary strings. The aim was to remove all the hard stuff and
9
+ make it blindingly easy to encrypt and decrypt strings. Of course, this
10
+ doesn't mean you can ignore basic crypographic best practices. Play safe,
11
+ this is serious stuff.
12
+
13
+ It uses an RSA public key to encryt a Blowfish key which is used to
14
+ encrypt the data. Decryption uses the RSA private key to decrypt the
15
+ Blowfish key and then the data. Which is a fairly common pattern. It
16
+ would be easy to adapt to use AES-256, IDEA or any of the other popular
17
+ block cyphers.
18
+
19
+ The main value of this library is hiding the implementation internals of
20
+ such a common operation. I couldn't find anything off-the-shelf that
21
+ made this easy.
11
22
 
12
23
  ## Examples
13
24
 
@@ -19,7 +30,16 @@ cleartext = 'It is a secret to everybody!'
19
30
  encrypted = Cerebus.encrypt cleartext, 'test/keys/public.pem'
20
31
  ```
21
32
 
22
- For rails it's the same, just first add it to the Gemfile and bundle install to get openssl.
33
+ Decryption is similarly simple.
34
+
35
+ ```
36
+ require 'cerebus'
37
+ cleartext = Cerebus.decrypt encrypted_text, 'test/keys/private.pem',
38
+ 'pass phrase'
39
+ ```
40
+
41
+ Passphrase can be optionally left off and you will be prompted for it on
42
+ the terminal. For rails just add it to the Gemfile and bundle install.
23
43
 
24
44
  ## Making Keys
25
45
 
data/lib/cerebus.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'openssl'
4
4
 
5
5
  module Cerebus
6
- VERSION = "0.0.2"
6
+ VERSION = "0.0.3"
7
7
 
8
8
  def Cerebus.make_key
9
9
  OpenSSL::Random.random_bytes(56)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cerebus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: