Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What Error?!
#5
Yep, I'm familiar with those modules; in fact, I've made a program with just those modules:
Code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

import hashlib
import datetime
import base64
import os
import time

#simple massege to demonstrate syntax

os.system('clear')
print('PyHashing, by: Interface')
print('---------------------------------------------------')
time.sleep(2)
print('    Syntax = [TYPE] [STRING] [HEX: 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!')
Do what thou wilt shall be the whole of the Law. Love is the law, love under will.
.::The Rights of Man::.
Reply


Messages In This Thread
What Error?! - by Canoris - 02-10-2010, 05:15 AM
RE: What Error?! - by uber1337 - 02-10-2010, 08:22 AM
RE: What Error?! - by Canoris - 02-10-2010, 02:52 PM
RE: What Error?! - by uber1337 - 02-10-2010, 03:09 PM
RE: What Error?! - by Canoris - 02-10-2010, 03:19 PM
RE: What Error?! - by uber1337 - 02-10-2010, 08:19 PM
RE: What Error?! - by Canoris - 02-11-2010, 05:29 AM
RE: What Error?! - by uber1337 - 02-11-2010, 08:30 AM
RE: What Error?! - by Canoris - 02-11-2010, 07:28 PM
RE: What Error?! - by uber1337 - 02-11-2010, 08:27 PM
RE: What Error?! - by Canoris - 02-12-2010, 01:46 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)