passw3rd 0.0.10 → 0.0.11
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/EXAMPLES.md +80 -0
- data/History.txt +9 -3
- data/lib/passw3rd/version.rb +1 -1
- data/test/password_service_test.rb +6 -3
- metadata +2 -2
- data/EXAMPLES +0 -79
data/EXAMPLES.md
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
------------------------------------------------------------------------------
|
2
|
+
Command line use
|
3
|
+
|
4
|
+
Generate key/iv in ~/ by default
|
5
|
+
|
6
|
+
$ passw3rd -g
|
7
|
+
generated keys in /Users/user
|
8
|
+
|
9
|
+
$ passw3rd -g ~/Desktop/
|
10
|
+
generated keys in /Users/user/Desktop/
|
11
|
+
|
12
|
+
Create a password file
|
13
|
+
|
14
|
+
$ passw3rd -e foobar_app
|
15
|
+
Enter the password:
|
16
|
+
Wrote password to /Users/neilmatatall/foobar_app
|
17
|
+
$ passw3rd -e foobar_app -p ~/Desktop/
|
18
|
+
Enter the password:
|
19
|
+
Wrote password to /Users/neilmatatall/Desktop/foobar_app
|
20
|
+
|
21
|
+
Read a password file
|
22
|
+
|
23
|
+
$ passw3rd -d foobar_app
|
24
|
+
The password is: asdf
|
25
|
+
$ passw3rd -d foobar_app -p ~/Desktop/
|
26
|
+
The password is: asdf
|
27
|
+
|
28
|
+
|
29
|
+
------------------------------------------------------------------------------
|
30
|
+
Manual JDBC Connection
|
31
|
+
|
32
|
+
Before:
|
33
|
+
|
34
|
+
Datasource ds = new Datasource();
|
35
|
+
ds.setPassword("suparSekret");
|
36
|
+
|
37
|
+
After:
|
38
|
+
|
39
|
+
Datasource ds = new Datasource();
|
40
|
+
ds.setPassword(PasswordService.getPassword(USER);
|
41
|
+
|
42
|
+
------------------------------------------------------------------------------
|
43
|
+
Java properties file
|
44
|
+
|
45
|
+
Before:
|
46
|
+
|
47
|
+
password=suparSekret
|
48
|
+
|
49
|
+
After:
|
50
|
+
|
51
|
+
password=${password}
|
52
|
+
|
53
|
+
------------------------------------------------------------------------------
|
54
|
+
Ruby on Rails config/database.yml
|
55
|
+
|
56
|
+
initializer:
|
57
|
+
Passw3rd::PasswordService.password_file_dir = "passwords"
|
58
|
+
|
59
|
+
Before:
|
60
|
+
|
61
|
+
development:
|
62
|
+
adapter: mysql
|
63
|
+
database: rails_development
|
64
|
+
username: root
|
65
|
+
password: my super secret password
|
66
|
+
|
67
|
+
|
68
|
+
After:
|
69
|
+
|
70
|
+
development:
|
71
|
+
adapter: mysql
|
72
|
+
database: rails_development
|
73
|
+
username: root
|
74
|
+
password: <%= PasswordService.get_password('foobar_app') -%>
|
75
|
+
|
76
|
+
------------------------------------------------------------------------------
|
77
|
+
OpenSSL command line
|
78
|
+
|
79
|
+
$ openssl enc -e -aes-256-cbc -K `cat ~/.passw3rd-encryptionKey` -iv `cat ~/.passw3rd-encryptionIV` -in README.md -out test.out
|
80
|
+
$ openssl enc -d -aes-256-cbc -K `cat ~/.passw3rd-encryptionKey` -iv `cat ~/.passw3rd-encryptionIV` -out README.md -in test.out
|
data/History.txt
CHANGED
@@ -1,12 +1,18 @@
|
|
1
|
-
=== 0.
|
1
|
+
=== 0.0.11 / 2011-10-12
|
2
|
+
|
3
|
+
Keys/ivs were being written as arrays, broke openssl command line compatibility:
|
4
|
+
$ openssl enc -e -aes-256-cbc -K `cat ~/.passw3rd-encryptionKey` -iv `cat ~/.passw3rd-encryptionIV` -in README.md -out test.out
|
5
|
+
$ openssl enc -d -aes-256-cbc -K `cat ~/.passw3rd-encryptionKey` -iv `cat ~/.passw3rd-encryptionIV` -out README.md -in test.out
|
6
|
+
|
7
|
+
=== 0.0.8 / 2011-10-02
|
2
8
|
|
3
9
|
Custom key directories
|
4
10
|
|
5
|
-
=== 0.6
|
11
|
+
=== 0.0.6 / 2011-10-02
|
6
12
|
|
7
13
|
Added custom password directories, more tests. Some code cleanup. Java version maven site generation.
|
8
14
|
|
9
|
-
=== 0.1
|
15
|
+
=== 0.0.1 / 2010-06-07
|
10
16
|
|
11
17
|
* 1 major enhancement
|
12
18
|
|
data/lib/passw3rd/version.rb
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'test/unit'
|
3
3
|
require 'tmpdir'
|
4
|
-
require 'SecureRandom'
|
5
4
|
|
6
5
|
require File.expand_path('../../lib/passw3rd.rb', __FILE__)
|
7
6
|
|
8
7
|
class PasswordServiceTest < Test::Unit::TestCase
|
9
8
|
def setup
|
10
|
-
random_num =
|
11
|
-
@random_string =
|
9
|
+
random_num = sudorandumb
|
10
|
+
@random_string = sudorandumb
|
12
11
|
|
13
12
|
::Passw3rd::KeyLoader.create_key_iv_file(Dir.tmpdir)
|
14
13
|
::Passw3rd::PasswordService.key_file_dir = Dir.tmpdir
|
@@ -41,4 +40,8 @@ class PasswordServiceTest < Test::Unit::TestCase
|
|
41
40
|
|
42
41
|
assert_equal(@random_string, dec)
|
43
42
|
end
|
43
|
+
|
44
|
+
def sudorandumb
|
45
|
+
Digest::SHA1.hexdigest(Time.now.to_s.split(//).sort_by{rand}.join)
|
46
|
+
end
|
44
47
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passw3rd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -22,7 +22,7 @@ extra_rdoc_files: []
|
|
22
22
|
files:
|
23
23
|
- README.md
|
24
24
|
- LICENSE
|
25
|
-
- EXAMPLES
|
25
|
+
- EXAMPLES.md
|
26
26
|
- History.txt
|
27
27
|
- lib/passw3rd/key_loader.rb
|
28
28
|
- lib/passw3rd/password_client.rb
|
data/EXAMPLES
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
------------------------------------------------------------------------------
|
2
|
-
Command line use
|
3
|
-
------------------------------------------------------------------------------
|
4
|
-
|
5
|
-
Generate key/iv in ~/ by default
|
6
|
-
|
7
|
-
$ passw3rd -g
|
8
|
-
generated keys in /Users/user
|
9
|
-
|
10
|
-
$ passw3rd -g ~/Desktop/
|
11
|
-
generated keys in /Users/user/Desktop/
|
12
|
-
|
13
|
-
Create a password file
|
14
|
-
|
15
|
-
$ passw3rd -e foobar_app
|
16
|
-
Enter the password:
|
17
|
-
Wrote password to /Users/neilmatatall/foobar_app
|
18
|
-
$ passw3rd -e foobar_app -p ~/Desktop/
|
19
|
-
Enter the password:
|
20
|
-
Wrote password to /Users/neilmatatall/Desktop/foobar_app
|
21
|
-
|
22
|
-
Read a password file
|
23
|
-
|
24
|
-
$ passw3rd -d foobar_app
|
25
|
-
The password is: asdf
|
26
|
-
$ passw3rd -d foobar_app -p ~/Desktop/
|
27
|
-
The password is: asdf
|
28
|
-
|
29
|
-
|
30
|
-
------------------------------------------------------------------------------
|
31
|
-
Manual JDBC Connection
|
32
|
-
------------------------------------------------------------------------------
|
33
|
-
|
34
|
-
Before:
|
35
|
-
|
36
|
-
Datasource ds = new Datasource();
|
37
|
-
ds.setPassword("suparSekret");
|
38
|
-
|
39
|
-
After:
|
40
|
-
|
41
|
-
Datasource ds = new Datasource();
|
42
|
-
ds.setPassword(PasswordService.getPassword(USER);
|
43
|
-
|
44
|
-
------------------------------------------------------------------------------
|
45
|
-
Java properties file
|
46
|
-
------------------------------------------------------------------------------
|
47
|
-
|
48
|
-
Before:
|
49
|
-
|
50
|
-
password=suparSekret
|
51
|
-
|
52
|
-
After:
|
53
|
-
|
54
|
-
password=${password}
|
55
|
-
|
56
|
-
------------------------------------------------------------------------------
|
57
|
-
Ruby on Rails config/database.yml
|
58
|
-
------------------------------------------------------------------------------
|
59
|
-
|
60
|
-
initializer:
|
61
|
-
Passw3rd::PasswordService.password_file_dir = "passwords"
|
62
|
-
|
63
|
-
Before:
|
64
|
-
|
65
|
-
development:
|
66
|
-
adapter: mysql
|
67
|
-
database: rails_development
|
68
|
-
username: root
|
69
|
-
password: my super secret password
|
70
|
-
|
71
|
-
|
72
|
-
After:
|
73
|
-
|
74
|
-
development:
|
75
|
-
adapter: mysql
|
76
|
-
database: rails_development
|
77
|
-
username: root
|
78
|
-
password: <%= PasswordService.get_password('foobar_app') -%>
|
79
|
-
|