sixarm_ruby_password_salt 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ �xy�LĈE�ȧs9��[*߰Jo�� ��
2
+ � k'� � @У����W'��#��+6,P5��.pfȠ•<�*�*Jwy�M��M�
@@ -0,0 +1,12 @@
1
+ LICENSE
2
+
3
+ You may choose any of these licenses:
4
+
5
+ - CreativeCommons License, Non-commercial Share Alike
6
+ - LGPL, GNU Lesser General Public License
7
+ - MIT License
8
+ - Ruby License
9
+
10
+ THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
11
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@@ -0,0 +1,25 @@
1
+
2
+ = SixArm Ruby Gem: Password Salt
3
+
4
+ Author:: Joel Parker Henderson, joelparkerhenderson@gmail.com
5
+ Copyright:: Copyright (c) 2006-2010 Joel Parker Henderson
6
+ License:: CreativeCommons License, Non-commercial Share Alike
7
+ License:: LGPL, GNU Lesser General Public License
8
+
9
+ Password tool to create strong user-friendly salt for hashes,
10
+ using Ruby's secure random cryptographic functions.
11
+
12
+ Example:
13
+ require 'sixarm_ruby_password_salt'
14
+ PasswordSalt.new => "ezkabtsu"
15
+
16
+ This generates a secure random 8 character salt
17
+ of all lowercase letters with 26^8 combinations.
18
+ This can easily be sent via web URIs, email, etc.
19
+
20
+ ==SecureRandom
21
+
22
+ Ruby 1.8.6 and older does not have a secure random number method,
23
+ so this gem checks to see if the SecureRandom class is defined;
24
+ if it is not, then we require our sixarm_ruby_secure_random gem.
25
+
@@ -0,0 +1,42 @@
1
+ =begin rdoc
2
+
3
+ = SixArm Ruby Gem: Password Salt
4
+
5
+ Author:: Joel Parker Henderson, joelparkerhenderson@gmail.com
6
+ Copyright:: Copyright (c) 2006-2010 Joel Parker Henderson
7
+ License:: CreativeCommons License, Non-commercial Share Alike
8
+ License:: LGPL, GNU Lesser General Public License
9
+
10
+ Password tool to create strong user-friendly salt for hashes,
11
+ using Ruby's secure random cryptographic functions.
12
+
13
+ Example:
14
+ require 'sixarm_ruby_password_salt'
15
+ PasswordSalt.new => "ezkabtsu"
16
+
17
+ This generates a secure random 8 character salt
18
+ of all lowercase letters with 26^8 combinations.
19
+ This can easily be sent via web URIs, email, etc.
20
+
21
+ ==SecureRandom
22
+
23
+ Ruby 1.8.6 and older does not have a secure random number method,
24
+ so this gem checks to see if the SecureRandom class is defined;
25
+ if it is not, then we require our sixarm_ruby_secure_random gem.
26
+
27
+ =end
28
+
29
+
30
+ if !defined?(SecureRandom) then require 'sixarm_ruby_secure_random' end
31
+
32
+
33
+ class PasswordSalt < String
34
+
35
+ COUNT = 8
36
+ CHARS = ('a'..'z').to_a
37
+
38
+ def initialize
39
+ super(Array.new(COUNT){CHARS[SecureRandom.random_number(CHARS.size)]}.join)
40
+ end
41
+
42
+ end
@@ -0,0 +1,15 @@
1
+ require 'test/unit'
2
+ require 'sixarm_ruby_password_salt'
3
+
4
+ class Testing < Test::Unit::TestCase
5
+
6
+ def test_all
7
+ 20.times{
8
+ x=PasswordSalt.new
9
+ assert(x.is_a?(String))
10
+ assert_equal(x.length,PasswordSalt::COUNT)
11
+ assert(x=~/^[a-z]+$/,"lowercase letters:#{x}")
12
+ }
13
+ end
14
+
15
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sixarm_ruby_password_salt
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 2
8
+ - 1
9
+ version: 1.2.1
10
+ platform: ruby
11
+ authors:
12
+ - SixArm
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain:
16
+ - |
17
+ -----BEGIN CERTIFICATE-----
18
+ MIIDBDCCAm2gAwIBAgIJAKPwEETU5bHoMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV
19
+ BAYTAlVTMRMwEQYDVQ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 -08:00
38
+ default_executable:
39
+ dependencies: []
40
+
41
+ description:
42
+ email: sixarm@sixarm.com
43
+ executables: []
44
+
45
+ extensions: []
46
+
47
+ extra_rdoc_files: []
48
+
49
+ files:
50
+ - README.rdoc
51
+ - LICENSE.txt
52
+ - lib/sixarm_ruby_password_salt.rb
53
+ - test/sixarm_ruby_password_salt_test.rb
54
+ has_rdoc: true
55
+ homepage: http://sixarm.com/
56
+ licenses: []
57
+
58
+ post_install_message:
59
+ rdoc_options: []
60
+
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ segments:
69
+ - 0
70
+ version: "0"
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ segments:
77
+ - 0
78
+ version: "0"
79
+ requirements: []
80
+
81
+ rubyforge_project:
82
+ rubygems_version: 1.3.7
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: "SixArm Ruby Gem: PasswordSalt class to generate secure websafe strings using random cryptography"
86
+ test_files:
87
+ - test/sixarm_ruby_password_salt_test.rb
@@ -0,0 +1 @@
1
+ �v˦k�<���* ��r�[tk�oc �*p�I���3�;Kh�;��w�N�&j���L�Ƀ��s�����-��P[�u��-��}�Q�MP��fx�6�‰xۛiE:e%f죆u��z���Iw?��)�tZ�