cryptic 1.0.0.beta.1 → 1.0.0.beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +30 -14
- data/cryptic.gemspec +1 -0
- data/lib/cryptic/version.rb +1 -1
- metadata +18 -2
data/README.md
CHANGED
@@ -1,29 +1,45 @@
|
|
1
|
-
#
|
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
|
-
|
8
|
-
|
9
|
-
gem 'cryptic'
|
7
|
+
## Usage
|
8
|
+
### Command line
|
10
9
|
|
11
|
-
|
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
|
-
|
19
|
+
### Ruby
|
14
20
|
|
15
|
-
|
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
|
-
|
26
|
+
private_key = keypair.private_key
|
27
|
+
public_key = keypair.public_key
|
18
28
|
|
19
|
-
|
29
|
+
# Encrypt a file:
|
30
|
+
data = File.read('foo.txt')
|
31
|
+
encrypted = Cryptic::EncryptedData.new(data, public_key)
|
20
32
|
|
21
|
-
|
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-
|
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-
|
44
|
+
4. Push to the branch (`git push origin feature/my-awesome-feature`)
|
29
45
|
5. Create new Pull Request
|
data/cryptic.gemspec
CHANGED
data/lib/cryptic/version.rb
CHANGED
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.
|
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:
|
152
|
+
hash: 3581446643865298365
|
137
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
154
|
none: false
|
139
155
|
requirements:
|