uberpass 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = Über password
2
2
 
3
+ == Install
4
+
5
+ $ gem install uberpass
6
+
3
7
  == Create keypair
4
8
 
5
9
  $ openssl genrsa -des3 -out ~/.uberpass/private.pem 2048
@@ -11,6 +15,6 @@ You personal passwords:
11
15
 
12
16
  $ uberpass
13
17
 
14
- or you work related passwords:
18
+ or your work related passwords:
15
19
 
16
20
  $ uberpass happy_place
data/lib/uberpass.rb CHANGED
@@ -103,6 +103,17 @@ module Uberpass
103
103
  passwords[key]["password"]
104
104
  end
105
105
 
106
+ def store(key, password)
107
+ passwords = decrypted_passwords
108
+ passwords[key] = {
109
+ "password" => password,
110
+ "created_at" => Time.now
111
+ }
112
+ encryptor = Encrypt.new(File.read(public_key_file), passwords.to_yaml)
113
+ write(encryptor)
114
+ passwords[key]["password"]
115
+ end
116
+
106
117
  def destroy_password(key)
107
118
  passwords = decrypted_passwords
108
119
  entry = passwords.delete key
@@ -110,7 +121,7 @@ module Uberpass
110
121
  write(encryptor)
111
122
  entry
112
123
  end
113
-
124
+
114
125
  def write(encryptor)
115
126
  File.open(passwords_file, "w") { |file|
116
127
  file.write(encryptor.encrypted_data)
@@ -135,6 +146,7 @@ module Uberpass
135
146
  print " destroy\n"
136
147
  print " reveal\n"
137
148
  print " list\n"
149
+ print " encrypt\n"
138
150
  print " exit\n"
139
151
  actions
140
152
  end
@@ -154,6 +166,10 @@ module Uberpass
154
166
  end
155
167
  end
156
168
 
169
+ def do_two_step
170
+
171
+ end
172
+
157
173
  def do_action(action, argument)
158
174
  case action
159
175
  when "generate", "g"
@@ -180,6 +196,20 @@ module Uberpass
180
196
  password = FileHandler.show_password(argument)
181
197
  print "password for #{argument}: #{password}\n"
182
198
  end
199
+ when "encrypt", "e"
200
+ if argument.to_s.strip == ""
201
+ print "choose a name ie. encrypt router"
202
+ else
203
+ print "\nenter item"
204
+ print "\n> "
205
+ value = $stdin.gets.chomp
206
+ if value == ""
207
+ print "nothing encrypted"
208
+ else
209
+ password = FileHandler.store(argument, value)
210
+ print "password encrypted"
211
+ end
212
+ end
183
213
  when "list", "l"
184
214
  keys = FileHandler.list_keys
185
215
  print "\n"
@@ -1,3 +1,3 @@
1
1
  module Uberpass
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uberpass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-05 00:00:00.000000000 Z
12
+ date: 2012-01-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70271985916320 !ruby/object:Gem::Requirement
16
+ requirement: &70237106182980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70271985916320
24
+ version_requirements: *70237106182980
25
25
  description: uses open ssl and a cli to generate and retrieve passwords
26
26
  email:
27
27
  - rufuspost@gmail.com
@@ -52,7 +52,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
52
  version: '0'
53
53
  segments:
54
54
  - 0
55
- hash: 3622611926086671674
55
+ hash: 3087924462459114461
56
56
  required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  version: '0'
62
62
  segments:
63
63
  - 0
64
- hash: 3622611926086671674
64
+ hash: 3087924462459114461
65
65
  requirements: []
66
66
  rubyforge_project: uberpass
67
67
  rubygems_version: 1.8.11