This commit is contained in:
Z. Cliffe Schreuders
2023-01-10 14:03:10 +00:00
11 changed files with 14 additions and 60 deletions

View File

@@ -1,4 +1,5 @@
source 'https://rubygems.org'
#production gems go here
gem 'nokogiri'
gem 'puppet'
@@ -23,7 +24,6 @@ gem 'process_helper'
gem 'ovirt-engine-sdk'
gem 'duplicate'
gem 'smbhash'
gem 'digest-whirlpool', :git => "https://github.com/fgosew/ruby-digest-whirlpool"
gem 'digest-siphash'
gem 'scrypt'
gem 'braille', :git => "http://github.com/nicanor/braille.git"
@@ -33,7 +33,7 @@ gem 'huffman', :git => "https://github.com/fgosew/huffman"
gem 'ruby-graphviz'
gem 'rsa'
gem 'gpgmeh'
gem 'digest-sha3', :git => "http://github.com/izetex/digest-sha3-ruby"
gem 'sha3'
gem 'packetfu'
gem 'net-ntp'
gem 'CFPropertyList'
@@ -45,6 +45,5 @@ gem 'retryable'
group :test, :development do
gem 'minitest'
gem 'rake'
gem 'rdoc'
gem 'yard'
end

View File

@@ -25,7 +25,7 @@ class EncodingFunctions
utf8 = []
value.map {|element|
if element.is_a? String
utf8 << element.force_encoding('UTF-8')
utf8 << element.dup.force_encoding('UTF-8')
elsif element.is_a? Hash
utf8 << EncodingFunctions::hash_to_utf8(element)
elsif element.is_a? Array

View File

@@ -1,6 +1,6 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_hash_encoder.rb'
require 'digest/sha3'
require 'sha3'
class SHA3_224_Encoder < HashEncoder
def initialize
@@ -9,7 +9,7 @@ class SHA3_224_Encoder < HashEncoder
end
def hash_function(string)
Digest::SHA3.hexdigest(string, 224)
SHA3::Digest.hexdigest(:sha224, string)
end
end

View File

@@ -1,6 +1,6 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_hash_encoder.rb'
require 'digest/sha3'
require 'sha3'
class SHA3_256_Encoder < HashEncoder
def initialize
@@ -9,7 +9,7 @@ class SHA3_256_Encoder < HashEncoder
end
def hash_function(string)
Digest::SHA3.hexdigest(string, 256)
SHA3::Digest.hexdigest(:sha256, string)
end
end

View File

@@ -1,6 +1,6 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_hash_encoder.rb'
require 'digest/sha3'
require 'sha3'
class SHA3_384_Encoder < HashEncoder
def initialize
@@ -9,7 +9,7 @@ class SHA3_384_Encoder < HashEncoder
end
def hash_function(string)
Digest::SHA3.hexdigest(string, 384)
SHA3::Digest.hexdigest(:sha384, string)
end
end

View File

@@ -1,6 +1,6 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_hash_encoder.rb'
require 'digest/sha3'
require 'sha3'
class SHA3_512_Encoder < HashEncoder
def initialize
@@ -9,7 +9,7 @@ class SHA3_512_Encoder < HashEncoder
end
def hash_function(string)
Digest::SHA3.hexdigest(string, 512)
SHA3::Digest.hexdigest(:sha512, string)
end
end

View File

@@ -1,15 +1,15 @@
#!/usr/bin/ruby
require_relative '../../../../../lib/objects/local_hash_encoder.rb'
require 'digest/sha3'
require 'openssl'
class SHA3Encoder < HashEncoder
def initialize
super
self.module_name = 'SHA1 Encoder'
self.module_name = 'SHA1 Encoder' # ??
end
def hash_function(string)
Digest::SHA1.hexdigest(string)
OpenSSL::Digest::SHA1.new.hexdigest(string) # ??
end
end

View File

@@ -1,15 +0,0 @@
#!/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

@@ -1,30 +0,0 @@
<?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>
<difficulty>medium</difficulty>
<read_fact>strings_to_encode</read_fact>
<read_fact>salt</read_fact>
<read_fact>return_salts</read_fact>
<output_type>string</output_type>
<CyBOK KA="AAA" topic="Authentication">
<keyword>Cryptography and authentication (hashes and attacks against authentication schemes / passwords)</keyword>
</CyBOK>
<CyBOK KA="F" topic="Artifact Analysis">
<keyword>cryptographic hashing</keyword>
</CyBOK>
</encoder>