diff options
author | mh <mh@immerda.ch> | 2011-08-05 13:11:28 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2011-08-05 13:11:28 +0200 |
commit | 3565f7550a1d604ed248ad0174af6cccd59f8131 (patch) | |
tree | 2873b990b651fa3ba7116de642d1185da0287b6a /lib/trocla | |
parent | d70593d2b0a5f19dd0b692dbb0a1e90808a079b6 (diff) |
add sha(256|512)crypt formats - increase version
Diffstat (limited to 'lib/trocla')
-rw-r--r-- | lib/trocla/formats/sha256crypt.rb | 6 | ||||
-rw-r--r-- | lib/trocla/formats/sha512crypt.rb | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/trocla/formats/sha256crypt.rb b/lib/trocla/formats/sha256crypt.rb new file mode 100644 index 0000000..fe6659c --- /dev/null +++ b/lib/trocla/formats/sha256crypt.rb @@ -0,0 +1,6 @@ +# salted crypt +class Trocla::Formats::Sha256crypt + def format(plain_password,options={}) + plain_password.crypt('$5$' << Trocla::Util.random_str(8) << '$') + end +end diff --git a/lib/trocla/formats/sha512crypt.rb b/lib/trocla/formats/sha512crypt.rb new file mode 100644 index 0000000..d57b93d --- /dev/null +++ b/lib/trocla/formats/sha512crypt.rb @@ -0,0 +1,6 @@ +# salted crypt +class Trocla::Formats::Sha512crypt + def format(plain_password,options={}) + plain_password.crypt('$6$' << Trocla::Util.random_str(8) << '$') + end +end |