require 'openssl' require 'sequel' require 'cobreak/version' class Decrypt def md4(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md4.db')) dbs = Sequel.sqlite dbs.create_table? :hashes do String :original String :hash end IO.foreach(wordlist) {|line| line.chomp! dbs[:hashes] << {original:line, hash:OpenSSL::Digest::MD4.hexdigest(line)} } print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: " puts dbs[:hashes].filter(hash:dato).map(:original) end def md5(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'md5.db')) dbs = Sequel.sqlite dbs.create_table? :hashes do String :original String :hash end IO.foreach(wordlist) {|line| line.chomp! dbs[:hashes] << {original:line, hash:OpenSSL::Digest::MD5.hexdigest(line)} } print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: " puts dbs[:hashes].filter(hash:dato).map(:original) end def sha1(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha1.db')) dbs = Sequel.sqlite dbs.create_table? :hashes do String :original String :hash end IO.foreach(wordlist) {|line| line.chomp! dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA1.hexdigest(line)} } print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: " puts dbs[:hashes].filter(hash:dato).map(:original) end def sha224(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha224.db')) dbs = Sequel.sqlite dbs.create_table? :hashes do String :original String :hash end IO.foreach(wordlist) {|line| line.chomp! dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA224.hexdigest(line)} } print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: " puts dbs[:hashes].filter(hash:dato).map(:original) end def sha256(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha256.db')) dbs = Sequel.sqlite dbs.create_table? :hashes do String :original String :hash end IO.foreach(wordlist) {|line| line.chomp! dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA256.hexdigest(line)} } print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: " puts dbs[:hashes].filter(hash:dato).map(:original) end def sha384(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha384.db')) dbs = Sequel.sqlite dbs.create_table? :hashes do String :original String :hash end IO.foreach(wordlist) {|line| line.chomp! dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA384.hexdigest(line)} } print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: " puts dbs[:hashes].filter(hash:dato).map(:original) end def sha512(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'sha512.db')) dbs = Sequel.sqlite dbs.create_table? :hashes do String :original String :hash end IO.foreach(wordlist) {|line| line.chomp! dbs[:hashes] << {original:line, hash:OpenSSL::Digest::SHA512.hexdigest(line)} } print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: " puts dbs[:hashes].filter(hash:dato).map(:original) end def ripemd160(dato, wordlist = File.join(Gem.path[1], "gems", "cobreak-#{CoBreak.version}", 'lib', 'cobreak', 'show', 'ripemd160.db')) dbs = Sequel.sqlite dbs.create_table? :hashes do String :original String :hash end IO.foreach(wordlist) {|line| line.chomp! dbs[:hashes] << {original:line, hash:OpenSSL::Digest::RIPEMD160.hexdigest(line)} } print "\e[1;32m[\e[0m+\e[1;32m]\e[0m Decrypted Text: " puts dbs[:hashes].filter(hash:dato).map(:original) end end DeCrypt = Decrypt.new