Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- __author__ = 'FierceFuzion'
- __license__ = 'BSD'
- __version__ = '0.1'
- __date__ = '17/7/13'
- import hashlib
- def main():
- print '''
- __ __ __ _____ ___
- / // /__ ____ / / / ___/__ ___ _ _< /
- / _ / _ `(_-</ _ \/ (_ / -_) _ \| |/ / /
- /_//_/\_,_/___/_//_/\___/\__/_//_/|___/_/
- Copyright (c) FierceFuzion 2013
- #############################
- # 1 = MD5 | 5 = SHA384 #
- # 2 = SHA1 | 6 = SHA512 #
- # 3 = SHA224 |-more to #
- # 4 = SHA256 | come. #
- #############################
- TYPE "EXIT" TO EXIT
- '''
- hashs = 0
- numlines = 0
- counter = 0
- read = input('Please enter fielname for input : ')
- output = input('Please enter filename for output : ' )
- hashs = input('Select a Hash to convert to : ')
- if (output != ''):
- fileObj = open(output,"a")
- if (read != ''):
- for line in open(read):
- numlines +=1
- print ('Found ', numlines, ' lines to convert\n')
- while (counter < numlines):
- fp = open(read)
- for i, line in enumerate(fp):
- if i == counter:
- print(line)
- if hashs == 1:
- line = line.encode('UTF-8')
- hashc = hashlib.md5(line).hexdigest()
- if hashs == 2:
- line = line.encode('UTF-8')
- hashc = hashlib.sha1(line).hexdigest()
- if hashs == 3:
- line = line.encode('UTF-8')
- hashc = hashlib.sha224(line).hexdigest()
- if hashs == 4:
- line = line.encode('UTF-8')
- hashc = hashlib.sha256(line).hexdigest()
- if hashs == 5:
- line = line.encode('UTF-8')
- hashc = hashlib.sha384(line).hexdigest()
- if hashs == 6:
- line.encode('UTF-8')
- hashc = hashlib.sha512(line).hexdigest()
- if (output != ''):
- fileObj.write(hashc)
- fileObj.write('\n')
- else:
- print(hashc)
- counter += 1
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement