cryptic 1.0.0.beta.1 → 1.0.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +30 -14
  2. data/cryptic.gemspec +1 -0
  3. data/lib/cryptic/version.rb +1 -1
  4. metadata +18 -2
data/README.md CHANGED
@@ -1,29 +1,45 @@
1
- # Public Key Encryption/Decryption
2
-
3
- TODO: Write a gem description
1
+ # Cryptic
2
+ A Ruby gem for public key encryption, private key decryption, and generating key pairs.
4
3
 
5
4
  ## Installation
5
+ Just run: `gem install cryptic` or add `gem 'cryptic'` to your Gemfile.
6
6
 
7
- Add this line to your application's Gemfile:
8
-
9
- gem 'cryptic'
7
+ ## Usage
8
+ ### Command line
10
9
 
11
- And then execute:
10
+ ```
11
+ [ecarey @ cryptic]$ cryptic
12
+ Commands:
13
+ cryptic decrypt [PRIVATE_KEY] [ENCRYPTED_FILE] [OPTIONS] # Decrypt a file with a private key
14
+ cryptic encrypt [PUBLIC_KEY] [TEXT_FILE] [OPTIONS] # Encrypt a file with a public key
15
+ cryptic generate [OPTIONS] # Generate a private/public keypair
16
+ cryptic help [COMMAND] # Describe available commands or one specific command
17
+ ```
12
18
 
13
- $ bundle
19
+ ### Ruby
14
20
 
15
- Or install it yourself as:
21
+ ```ruby
22
+ # Generate a keypair to use with a passphrase and the number of bits you'd like:
23
+ keypair = Cryptic::Keypair.new('P4$SpHr4z3', 2048)
24
+ keypair.save("#{ENV['HOME']}/.cryptic_keys")
16
25
 
17
- $ gem install cryptic
26
+ private_key = keypair.private_key
27
+ public_key = keypair.public_key
18
28
 
19
- ## Usage
29
+ # Encrypt a file:
30
+ data = File.read('foo.txt')
31
+ encrypted = Cryptic::EncryptedData.new(data, public_key)
20
32
 
21
- TODO: Write usage instructions here
33
+ # Returns an encrypted string you can save off to a file
34
+ encrypted.data
22
35
 
36
+ # To return the data call decrypt on the encrypted data object w/ the private key and passphrase
37
+ decrypted = encrypted.decrypt(private_key, 'P4$SpHr4z3')
38
+ ```
23
39
  ## Contributing
24
40
 
25
41
  1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
42
+ 2. Create your feature branch (`git checkout -b feature/my-awesome-feature`)
27
43
  3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
44
+ 4. Push to the branch (`git push origin feature/my-awesome-feature`)
29
45
  5. Create new Pull Request
data/cryptic.gemspec CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
+ spec.add_dependency 'colorize'
21
22
  spec.add_dependency 'redcarpet'
22
23
  spec.add_dependency 'thor'
23
24
  spec.add_dependency 'yard'
@@ -1,4 +1,4 @@
1
1
  module Cryptic
2
2
  # The version of the cryptic gem
3
- VERSION = '1.0.0.beta.1'
3
+ VERSION = '1.0.0.beta.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.1
4
+ version: 1.0.0.beta.2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -11,6 +11,22 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2013-07-06 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: colorize
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: redcarpet
16
32
  requirement: !ruby/object:Gem::Requirement
@@ -133,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
149
  version: '0'
134
150
  segments:
135
151
  - 0
136
- hash: 1237837409677303508
152
+ hash: 3581446643865298365
137
153
  required_rubygems_version: !ruby/object:Gem::Requirement
138
154
  none: false
139
155
  requirements: