clearance_crypto 0.1.0 → 0.1.1

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/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.1.1 2009-02-17
2
+
3
+ * Add salt to bcrypt
4
+
1
5
  == 0.1.0 2009-02-12
2
6
 
3
7
  * 1 major enhancement:
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module ClearanceCrypto
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
@@ -14,12 +14,12 @@ module ClearanceCrypto
14
14
 
15
15
  # Creates a BCrypt hash for the password passed.
16
16
  def encrypt(string)
17
- ::BCrypt::Password.create(string)
17
+ ::BCrypt::Password.create("--#{salt}--#{string}--")
18
18
  end
19
19
 
20
20
  # Does the hash match the tokens? Uses the same tokens that were used to encrypt.
21
21
  def authenticated?(string)
22
- ::BCrypt::Password.new(self.encrypted_password) == string rescue false
22
+ ::BCrypt::Password.new(self.encrypted_password) == "--#{salt}--#{string}--" rescue false
23
23
  end
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clearance_crypto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Moen
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-13 00:00:00 -06:00
12
+ date: 2009-02-17 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency