Python Hashing Program by: Interface - Ξпέvδ - Oct 11, 2009
My first program in python. Feel free to modify and fix it. Credits are in the code.
Code import hashlib
import datetime
#simple massege to demonstrate syntax
print('PyHashing, by: Interface')
print('Syntax = [TYPE] [STRING] [HEX: Y/N]')
print('TYPE = type of encryption needed. Supported: md5 , sha224 , sha256 , sha384 , sha512')
print('HEX = whether or not hexidecimal encryption is need or not; otherwise set to default')
print('STRING = the specified string to encrypt')
#difining variables
strgz = raw_input('Type: ')
strgt = raw_input('String: ')
strgh = raw_input('Hex?: ')
m = 'md5'
s0 = 'sha224'
s1 = 'sha256'
s2 = 'sha384'
s3 = 'sha512'
#user input
(strgz)
(strgt)
(strgh)
#processing of data
if ((strgz) == (s0) and (strgh) == ('n')):
print(datetime.date.today())
print(hashlib.sha224(strgt).digest())
if ((strgz) == (s1) and (strgh) == ('n')):
print(datetime.date.today())
print(hashlib.sha256(strgt).digest())
if ((strgz) == (s2) and (strgh) == ('n')):
print(datetime.date.today())
print(hashlib.sha384(strgt).digest())
if ((strgz) == (s3) and (strgh) == ('n')):
print(datetime.date.today())
print(hashlib.sha512(strgt).digest())
if ((strgz) == (m) and (strgh) == ('n')):
print(datetime.date.today())
print(hashlib.md5(strgt).digest())
if ((strgz) == (s0) and (strgh) == ('y')):
print(datetime.date.today())
print(hashlib.sha224(strgt).hexdigest())
if ((strgz) == (s1) and (strgh) == ('y')):
print(datetime.date.today())
print(hashlib.sha256(strgt).hexdigest())
if ((strgz) == (s2) and (strgh) == ('y')):
print(datetime.date.today())
print(hashlib.sha384(strgt).hexdigest())
if ((strgz) == (s3) and (strgh) == ('y')):
print(datetime.date.today())
print(hashlib.sha512(strgt).hexdigest())
if ((strgz) == (m) and (strgh) == ('y')):
print(datetime.date.today())
print(hashlib.md5(strgt).hexdigest())
if ((strgz) is not (m) and (s0) and (s1) and (s2) and (s3) and (strgh) == ('')):
print('SYNTAX ERROR!')
UPDATE:
Code import hashlib
import datetime
import base64
#simple massege to demonstrate syntax
print('PyHashing, by: Interface')
print('Syntax = [TYPE] [STRING] [HEX: Y/N] [DEBASE: Y/N]')
print('TYPE = type of encryption needed. Supported: md5 , sha224 , sha256 , sha384 , sha512 , base16 , base32 , base64')
print('HEX = whether or not hexidecimal encryption is need or not; otherwise set to default')
print('STRING = the specified string to encrypt')
print('DEBASE = whether you need to decrypt a base16 , base32 , or base64 hash. *NOTE* The HEX option is not supported with this command; type: n')
#difining variables
strgz = raw_input('Type: ')
strgt = raw_input('String: ')
strgh = raw_input('Hex?: ')
strgd = raw_input('DeBase?: ')
m = 'md5'
s0 = 'sha224'
s1 = 'sha256'
s2 = 'sha384'
s3 = 'sha512'
b0 = 'base16'
b1 = 'base32'
b2 = 'base64'
#user input
(strgz)
(strgt)
(strgh)
(strgd)
#processing of data
if ((strgz) == (s0) and (strgh) == ('n')):
print(datetime.date.today())
print(hashlib.sha224(strgt).digest())
if ((strgz) == (s1) and (strgh) == ('n')):
print(datetime.date.today())
print(hashlib.sha256(strgt).digest())
if ((strgz) == (s2) and (strgh) == ('n')):
print(datetime.date.today())
print(hashlib.sha384(strgt).digest())
if ((strgz) == (s3) and (strgh) == ('n')):
print(datetime.date.today())
print(hashlib.sha512(strgt).digest())
if ((strgz) == (m) and (strgh) == ('n')):
print(datetime.date.today())
print(hashlib.md5(strgt).digest())
if ((strgz) == (s0) and (strgh) == ('y')):
print(datetime.date.today())
print(hashlib.sha224(strgt).hexdigest())
if ((strgz) == (s1) and (strgh) == ('y')):
print(datetime.date.today())
print(hashlib.sha256(strgt).hexdigest())
if ((strgz) == (s2) and (strgh) == ('y')):
print(datetime.date.today())
print(hashlib.sha384(strgt).hexdigest())
if ((strgz) == (s3) and (strgh) == ('y')):
print(datetime.date.today())
print(hashlib.sha512(strgt).hexdigest())
if ((strgz) == (m) and (strgh) == ('y')):
print(datetime.date.today())
print(hashlib.md5(strgt).hexdigest())
if ((strgz) == (b0) and (strgh) == ('n') and (strgd) == ('y')):
print(datetime.date.today())
print(base16.decode(strgt))
if ((strgz) == (b1) and (strgh) == ('n') and (strgd) == ('y')):
print(datetime.date.today())
print(base32.decode(strgt))
if ((strgz) == (b2) and (strgh) == ('n') and (strgd) == ('y')):
print(datetime.date.today())
print(base64.decode(strgt))
if ((strgz) == (b0) and (strgh) == ('n') and (strgd) == ('n')):
print(datetime.date.today())
print(base16.encode(strgt)
if ((strgz) == (b1) and (strgh) == ('n') and (strgd) == ('n')):
print(datetime.date.today())
print(base32.encode(strgt))
if ((strgz) == (b2) and (strgh) == ('n') and (strgd) == ('n')):
print(datetime.date.today())
print(base64.encode(strgt))
if ((strgz) is not (m) and (s0) and (s1) and (s2) and (s3) and (b0) and (b1) and (b2) or (strgh) == ('') or (strgd) == ('')):
print('SYNTAX ERROR!')
Only problem is that I get a weird syntax error on line 85.
UPDATE
Code import hashlib
import datetime
import base64
#simple massege to demonstrate syntax
print('PyHashing, by: Interface')
print('Syntax = [TYPE] [STRING] [HEX: Y/N] [DEBASE: Y/N]')
print('TYPE = type of encryption needed. Supported: md5 , sha224 , sha256 , sha384 , sha512 , base16 , base32 , base64')
print('HEX = whether or not hexidecimal encryption is need or not; otherwise set to default')
print('STRING = the specified string to encrypt')
#difining variables
strgz = raw_input('Type: ')
strgt = raw_input('String: ')
strgh = raw_input('Hex?: ')
m = 'md5'
s0 = 'sha224'
s1 = 'sha256'
s2 = 'sha384'
s3 = 'sha512'
b0 = 'base16'
b1 = 'base32'
b2 = 'base64'
no = 'n'
yes = 'y'
#user input
(strgz)
(strgt)
(strgh)
#processing of data
if ((strgz) == (s0) and (strgh) == (no)):
print(datetime.date.today())
print(hashlib.sha224(strgt).digest())
if ((strgz) == (s1) and (strgh) == (no)):
print(datetime.date.today())
print(hashlib.sha256(strgt).digest())
if ((strgz) == (s2) and (strgh) == (no)):
print(datetime.date.today())
print(hashlib.sha384(strgt).digest())
if ((strgz) == (s3) and (strgh) == (no)):
print(datetime.date.today())
print(hashlib.sha512(strgt).digest())
if ((strgz) == (m) and (strgh) == (no)):
print(datetime.date.today())
print(hashlib.md5(strgt).digest())
if ((strgz) == (s0) and (strgh) == (yes)):
print(datetime.date.today())
print(hashlib.sha224(strgt).hexdigest())
if ((strgz) == (s1) and (strgh) == (yes)):
print(datetime.date.today())
print(hashlib.sha256(strgt).hexdigest())
if ((strgz) == (s2) and (strgh) == (yes)):
print(datetime.date.today())
print(hashlib.sha384(strgt).hexdigest())
if ((strgz) == (s3) and (strgh) == (yes)):
print(datetime.date.today())
print(hashlib.sha512(strgt).hexdigest())
if ((strgz) == (m) and (strgh) == (yes)):
print(datetime.date.today())
print(hashlib.md5(strgt).hexdigest())
if ((strgz) == (b0) and (strgh) == (no)):
print(datetime.date.today())
print(base64.b16encode(strgt))
if ((strgz) == (b1) and (strgh) == (no)):
print(datetime.date.today())
print(base64.b32encode(strgt))
if ((strgz) == (b2) and (strgh) == (no)):
print(datetime.date.today())
print(base64.b64encode(strgt))
if ((strgz) is not (m) and (s0) and (s1) and (s2) and (s3) and (b0) and (b1) and (b2) and (strgh) == ('')):
print('SYNTAX ERROR!')
* - Ξпέvδ - Oct 11, 2009
No one likes my program? Well fuck it then, last program I share with HF.
* - thedankestmeme - Oct 11, 2009
Obviously not.
* - Ξпέvδ - Oct 11, 2009
(Oct 11, 2009 11:43 AM)iintens Wrote: Obviously not. Asswipe.
* - Ξпέvδ - Oct 11, 2009
UPDATE:
Quote:import hashlib
import datetime
import base64
import os
import time
#simple massege to demonstrate syntax
print('PyHashing, by: Interface')
time.sleep(2)
print('Syntax = [TYPE] [STRING] [HEX: Y/N] [DEBASE: Y/N]')
print('')
print(' TYPE = type of encryption needed. Supported: md5 , sha224 , sha256 , sha384 , sha512 , base16 , base32 , base64')
print('')
print(' HEX = whether or not hexidecimal encryption is need or not; otherwise set to default')
print('')
print(' STRING = the specified string to encrypt')
#difining variables
strgz = raw_input(' Type: ')
strgt = raw_input('String: ')
strgh = raw_input(' Hex?: ')
m = 'md5'
s0 = 'sha224'
s1 = 'sha256'
s2 = 'sha384'
s3 = 'sha512'
b0 = 'base16'
b1 = 'base32'
b2 = 'base64'
no = 'n'
yes = 'y'
#user input
(strgz)
(strgt)
(strgh)
#processing of data
if ((strgz) == (s0) and (strgh) == (no)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(hashlib.sha224(strgt).digest())
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (s1) and (strgh) == (no)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(hashlib.sha256(strgt).digest())
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (s2) and (strgh) == (no)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(hashlib.sha384(strgt).digest())
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (s3) and (strgh) == (no)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(hashlib.sha512(strgt).digest())
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (m) and (strgh) == (no)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(hashlib.md5(strgt).digest())
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (s0) and (strgh) == (yes)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(hashlib.sha224(strgt).hexdigest())
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (s1) and (strgh) == (yes)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(hashlib.sha256(strgt).hexdigest())
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (s2) and (strgh) == (yes)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(hashlib.sha384(strgt).hexdigest())
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (s3) and (strgh) == (yes)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(hashlib.sha512(strgt).hexdigest())
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (m) and (strgh) == (yes)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(hashlib.md5(strgt).hexdigest())
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (b0) and (strgh) == (no)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(base64.b16encode(strgt))
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (b1) and (strgh) == (no)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(base64.b32encode(strgt))
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) == (b2) and (strgh) == (no)):
os.system('clear')
print(datetime.date.today())
from time import gmtime, strftime
print(strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime()))
print('---------------------------------------------------')
print(base64.b64encode(strgt))
time.sleep(5)
raw_input('. . .Press Enter')
os.system('clear')
if ((strgz) is not (m) and (s0) and (s1) and (s2) and (s3) and (b0) and (b1) and (b2) and (strgh) == ('')):
os.system('clear')
print('SYNTAX ERROR!')
* - scaryblackguy - Oct 11, 2009
l2whitespace .
* - z3r0c00l - Oct 12, 2009
is this Perl or PHP?
* - ManDy5 - Oct 12, 2009
(Oct 12, 2009 11:26 AM)z3r0c00l Wrote: is this Perl or PHP?
Is this a joke? It's Python...
* - Ξпέvδ - Oct 12, 2009
(Oct 12, 2009 11:28 AM)ManDy5 Wrote: (Oct 12, 2009 11:26 AM)z3r0c00l Wrote: is this Perl or PHP?
Is this a joke? It's Python... LOL, OMG! lol
* - Psycho - Oct 13, 2009
Is this a bad attempt at obfuscation?
* - Mackem Jitler - Oct 13, 2009
Is this just using MD5 and a few of the SHA's ?
* - Ξпέvδ - Oct 13, 2009
(Oct 13, 2009 09:47 AM)Mackem Jitler Wrote: Is this just using MD5 and a few of the SHA's ? No, there is base16, base32, and base64. I would like to implement others, but I am too lazy right now.
* - scaryblackguy - Oct 14, 2009
(Oct 13, 2009 09:38 AM)Psycho Wrote: Is this a bad attempt at obfuscation?
NO, IT'S A GOOD ATTEMPT!
* - Conspiracy - Oct 14, 2009
Most people wont even know how to use a python script, show them how maybe.
* - Soul Collector - Oct 14, 2009
Its okay man ..dont be rude. They are just to lazy to comment lol
|