Skip to content

Commit

Permalink
added git ignore to remove any .pyc files -- created python script to…
Browse files Browse the repository at this point in the history
… loop through hash functions and test them
  • Loading branch information
nsaadouni committed Oct 12, 2016
1 parent f3fb1b5 commit 5a2bb42
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

41 changes: 41 additions & 0 deletions src/hash_serach/hash_search.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5a2bb42

Please sign in to comment.