From 4dbf064f48f6cc8246bd1b146b4a016b2e01e3cb Mon Sep 17 00:00:00 2001 From: thomashaw Date: Mon, 5 Nov 2018 12:26:39 +0000 Subject: [PATCH] encoders/hash/whirlpool --- Gemfile | 1 + Gemfile.lock | 2 ++ .../hash/whirlpool/manifests/.no_puppet | 0 .../hash/whirlpool/secgen_local/local.rb | 15 +++++++++++++ .../hash/whirlpool/secgen_metadata.xml | 22 +++++++++++++++++++ modules/encoders/hash/whirlpool/whirlpool.pp | 0 6 files changed, 40 insertions(+) create mode 100644 modules/encoders/hash/whirlpool/manifests/.no_puppet create mode 100644 modules/encoders/hash/whirlpool/secgen_local/local.rb create mode 100644 modules/encoders/hash/whirlpool/secgen_metadata.xml create mode 100644 modules/encoders/hash/whirlpool/whirlpool.pp diff --git a/Gemfile b/Gemfile index 078448c7b..f3567d961 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 789227a3a..28615fa47 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/modules/encoders/hash/whirlpool/manifests/.no_puppet b/modules/encoders/hash/whirlpool/manifests/.no_puppet new file mode 100644 index 000000000..e69de29bb diff --git a/modules/encoders/hash/whirlpool/secgen_local/local.rb b/modules/encoders/hash/whirlpool/secgen_local/local.rb new file mode 100644 index 000000000..ba1c37eb1 --- /dev/null +++ b/modules/encoders/hash/whirlpool/secgen_local/local.rb @@ -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 diff --git a/modules/encoders/hash/whirlpool/secgen_metadata.xml b/modules/encoders/hash/whirlpool/secgen_metadata.xml new file mode 100644 index 000000000..f37a21bf3 --- /dev/null +++ b/modules/encoders/hash/whirlpool/secgen_metadata.xml @@ -0,0 +1,22 @@ + + + + Whirlpool Hash Encoder + Thomas Shaw + MIT + Generates a Whirlpool hash for each of the strings. + + hash + whirlpool + linux + windows + + strings_to_encode + salt + return_salts + + string + + \ No newline at end of file diff --git a/modules/encoders/hash/whirlpool/whirlpool.pp b/modules/encoders/hash/whirlpool/whirlpool.pp new file mode 100644 index 000000000..e69de29bb