Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Python Hashing Program by: Interface

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!')
No one likes my program? Well fuck it then, last program I share with HF.
Obviously not.
ayyyy lmao.
(Oct 11, 2009 11:43 AM)thedankestmeme Wrote:  Obviously not.
Asswipe.
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!')

l2whitespace .
is this Perl or PHP?
(Oct 12, 2009 11:26 AM)z3r0c00l Wrote:  is this Perl or PHP?

Is this a joke? It's Python...
(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
Is this a bad attempt at obfuscation?
Is this just using MD5 and a few of the SHA's ?
(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.
(Oct 13, 2009 09:38 AM)Psycho Wrote:  Is this a bad attempt at obfuscation?

NO, IT'S A GOOD ATTEMPT!
Most people wont even know how to use a python script, show them how maybe.
Its okay man ..dont be rude. They are just to lazy to comment lol


Possibly Related Threads...
Thread / Author Replies Views Last Post
by nucleo_type09Apr 15, 2024 08:30 AM 4 199 Apr 15, 2024 08:30 AM
Last Post: nucleo_type09
[Python] by Bass_ReevesAug 20, 2023 01:44 AM 9 632 Aug 20, 2023 01:44 AM
Last Post: Lucky4L
[Python] by - CancerJan 9, 2021 06:30 AM 10 251 Jan 9, 2021 06:30 AM
Last Post: FogFox