From 5a2bb422af3cd81e66ca37f99e6fd940bdfcdfa3 Mon Sep 17 00:00:00 2001 From: dean Date: Wed, 12 Oct 2016 15:47:13 +0100 Subject: [PATCH] added git ignore to remove any .pyc files -- created python script to loop through hash functions and test them --- .gitignore | 4 ++++ src/hash_serach/hash_search.py | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .gitignore create mode 100644 src/hash_serach/hash_search.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1d60f4e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + diff --git a/src/hash_serach/hash_search.py b/src/hash_serach/hash_search.py new file mode 100644 index 0000000..2f7cf67 --- /dev/null +++ b/src/hash_serach/hash_search.py @@ -0,0 +1,41 @@ +#!/usr/bin/python + +import hashlib as hb + +def print_all_hashes(): + for x in hb.algorithms_available: + print(x) + + +#print('The list of hash\'s I will test are here') +#print_all_hashes() + + +# uses +def find_hash_used(x, y): + + found = False + for hash in hb.algorithms_available: + h = hb.new(hash) + h.update(x) + s = h.hexdigest() + yy = int(s,16) + if y == yy: + print('hash found: ') + print(hash) + found = True + + if found == False: + print('hash not found') + + + + +# whirlpool hash for string: +# 'This is a test string to be used in explanation' + +x = 'This is a test string to be used in explanation' +y = int('1a22fb7cca7be8088333d7a656ff4d10887184ff7aa4184594d6970938efabe3bced5f82d184360fee173ff890b8c72ff149825616f49f2ebad08ed0b450365b',16) +find_hash_used(x,y) + +# It works, now just to find out how to extract data from card! using pcsc-lite \ No newline at end of file