encoders/hash/whirlpool

This commit is contained in:
thomashaw
2018-11-05 12:26:39 +00:00
committed by ts
parent e54b9ac2c9
commit 4dbf064f48
6 changed files with 40 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ gem 'ovirt-engine-sdk'
gem 'duplicate'
gem 'smbhash'
gem 'digest-sha3'
gem 'digest-whirlpool'
#development only gems go here
group :test, :development do

View File

@@ -14,6 +14,7 @@ GEM
credy (0.2.1)
thor (~> 0.19.1)
digest-sha3 (1.1.0)
digest-whirlpool (1.0.3)
duplicate (1.1.1)
facter (2.5.1)
faker (1.9.1)
@@ -106,6 +107,7 @@ DEPENDENCIES
cinch
credy
digest-sha3
digest-whirlpool
duplicate
faker
forgery

View File

@@ -0,0 +1,15 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_hash_encoder.rb'
class WhirlpoolEncoder < HashEncoder
def initialize
super
self.module_name = 'Whirlpool Hash Encoder'
end
def hash_function(string)
Digest::Whirlpool.hexdigest(string)
end
end
WhirlpoolEncoder.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>Whirlpool Hash Encoder</name>
<author>Thomas Shaw</author>
<module_license>MIT</module_license>
<description>Generates a Whirlpool hash for each of the strings.</description>
<type>hash</type>
<type>whirlpool</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>