Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rot-13 Encrypter/Decrypter
#1
Code:
def rot(a):
    e = list(a)
    q = len(e)
    z = 0
    w = []
    while z < q:
        b = ord(a[z:z+1])
        z = z + 1
        c = b+13
        d = chr(c)
        r = chr(b-13)
        if c <= 122 and c > 96:
            w.append(d)
        elif c > 122:
            w.append(r)
        else: w.append(' ')
    print "".join(w)
    raw_input("Press Enter To Continue")
    menu()




def unrot(a):
    e = list(a)
    q = len(e)
    z = 0
    w = []
    while z < q:
        b = ord(a[z:z+1])
        z = z + 1
        c = b-13
        d = chr(c)
        r = chr(b+13)
        if c <= 122 and c > 96:
            w.append(d)
        elif c > 122:
            w.append(r)
        else: w.append(' ')
    print "".join(w)
    raw_input("Press Enter To Continue")
    menu()
def menu():
    print "1) Encrypt"
    print "2) Decrypt"
    u = (raw_input("What do you want to do?: "))
    if u == '1': rot(raw_input("What do you want to encrypt?: "))
    elif u == '2': unrot(raw_input("What do you want to encrypt?: "))
    else:
        print "Invalid"
        raw_input("Press Enter To Continue")
        menu()
menu()
Reply


Messages In This Thread
Rot-13 Encrypter/Decrypter - by nevets04 - 11-28-2009, 12:39 AM
RE: Rot-13 Encrypter/Decrypter - by Fallen - 11-28-2009, 12:55 AM
RE: Rot-13 Encrypter/Decrypter - by nevets04 - 11-28-2009, 01:12 AM
RE: Rot-13 Encrypter/Decrypter - by nevets04 - 11-28-2009, 10:30 PM
RE: Rot-13 Encrypter/Decrypter - by J4P4NM4N - 11-28-2009, 10:56 PM
RE: Rot-13 Encrypter/Decrypter - by nevets04 - 11-28-2009, 11:12 PM
RE: Rot-13 Encrypter/Decrypter - by manipulate - 12-03-2009, 03:50 AM
RE: Rot-13 Encrypter/Decrypter - by nevets04 - 12-03-2009, 05:47 PM
RE: Rot-13 Encrypter/Decrypter - by J4P4NM4N - 12-05-2009, 11:49 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)