From e54b9ac2c91e21535ccba002d04b7471e0b6c729 Mon Sep 17 00:00:00 2001 From: thomashaw Date: Mon, 5 Nov 2018 12:17:55 +0000 Subject: [PATCH] encoders/hash/bcrypt --- modules/encoders/hash/bcrypt/bcrypt.pp | 0 .../encoders/hash/bcrypt/manifests/.no_puppet | 0 .../hash/bcrypt/secgen_local/local.rb | 16 ++++++++++++++ .../encoders/hash/bcrypt/secgen_metadata.xml | 22 +++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 modules/encoders/hash/bcrypt/bcrypt.pp create mode 100644 modules/encoders/hash/bcrypt/manifests/.no_puppet create mode 100644 modules/encoders/hash/bcrypt/secgen_local/local.rb create mode 100644 modules/encoders/hash/bcrypt/secgen_metadata.xml diff --git a/modules/encoders/hash/bcrypt/bcrypt.pp b/modules/encoders/hash/bcrypt/bcrypt.pp new file mode 100644 index 000000000..e69de29bb diff --git a/modules/encoders/hash/bcrypt/manifests/.no_puppet b/modules/encoders/hash/bcrypt/manifests/.no_puppet new file mode 100644 index 000000000..e69de29bb diff --git a/modules/encoders/hash/bcrypt/secgen_local/local.rb b/modules/encoders/hash/bcrypt/secgen_local/local.rb new file mode 100644 index 000000000..d4335c8c8 --- /dev/null +++ b/modules/encoders/hash/bcrypt/secgen_local/local.rb @@ -0,0 +1,16 @@ +#!/usr/bin/ruby +require_relative '../../../../../lib/objects/local_hash_encoder.rb' + +class BCryptEncoder < HashEncoder + def initialize + super + self.module_name = 'BCrypt Hash Encoder' + end + + def hash_function(string) + require 'bcrypt' + BCrypt::Password.create(string) + end +end + +BCryptEncoder.new.run diff --git a/modules/encoders/hash/bcrypt/secgen_metadata.xml b/modules/encoders/hash/bcrypt/secgen_metadata.xml new file mode 100644 index 000000000..e4c42d44b --- /dev/null +++ b/modules/encoders/hash/bcrypt/secgen_metadata.xml @@ -0,0 +1,22 @@ + + + + Bcrypt Hash Encoder + Thomas Shaw + MIT + Generates an bcrypt hash for each of the strings. + + hash + bcrypt + linux + windows + + strings_to_encode + salt + return_salts + + string + + \ No newline at end of file