encoders/hash/bcrypt

This commit is contained in:
thomashaw
2018-11-05 12:17:55 +00:00
committed by ts
parent 91a0cda109
commit e54b9ac2c9
4 changed files with 38 additions and 0 deletions

View File

View File

@@ -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

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>Bcrypt Hash Encoder</name>
<author>Thomas Shaw</author>
<module_license>MIT</module_license>
<description>Generates an bcrypt hash for each of the strings.</description>
<type>hash</type>
<type>bcrypt</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>