encoders/hash/scrypt

This commit is contained in:
thomashaw
2018-11-05 12:41:48 +00:00
committed by ts
parent 0d3cdedc19
commit b04724c19f
6 changed files with 46 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ gem 'smbhash'
gem 'digest-sha3'
gem 'digest-whirlpool'
gem 'digest-siphash'
gem 'scrypt'
#development only gems go here
group :test, :development do

View File

@@ -27,6 +27,10 @@ GEM
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
fast_gettext (1.1.2)
ffi (1.9.25)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
forgery (0.7.0)
gettext (3.2.9)
locale (>= 2.0.5)
@@ -88,6 +92,8 @@ GEM
chunky_png (~> 1.0)
rsync (1.0.9)
rubyzip (1.2.2)
scrypt (3.0.6)
ffi-compiler (>= 1.0, < 2.0)
semantic_puppet (1.0.2)
smbhash (1.0.2)
spidr (0.6.0)
@@ -130,6 +136,7 @@ DEPENDENCIES
redcarpet
rmagick
rqrcode
scrypt
smbhash
sshkey
wordlist

View File

View File

@@ -0,0 +1,16 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_hash_encoder.rb'
class SCryptEncoder < HashEncoder
def initialize
super
self.module_name = 'SCrypt Encoder'
end
def hash_function(string)
require 'scrypt'
SCrypt::Password.create(string)
end
end
SCryptEncoder.new.run

View File

@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<encoder xmlns="http://www.github/cliffe/SecGen/encoder"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.github/cliffe/SecGen/encoder">
<name>SCrypt Encoder</name>
<author>Thomas Shaw</author>
<module_license>MIT</module_license>
<description>Generates an SCrypt hash for each of the strings.</description>
<type>hash</type>
<type>scrypt</type>
<platform>linux</platform>
<platform>windows</platform>
<read_fact>strings_to_encode</read_fact>
<read_fact>salt</read_fact>
<read_fact>return_salts</read_fact>
<output_type>string</output_type>
</encoder>