-d33k40 De/Crypter-

Iniciado por d33k40, Marzo 30, 2010, 11:27:46 AM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Marzo 30, 2010, 11:27:46 AM Ultima modificación: Octubre 26, 2013, 09:33:28 AM por Expermicid
Buenas, aquí os dejo este cifrador/descifrador de texto que he hecho en python.

Quien quiera puede usar el codigo cómo base pero siempre poniendo en el cual se basó.

Código: PYTHON
#!/usr/bin/env python
print "###############################################"
print "# -d33k40 De/crypter- Coded by: d33k40"
print "# www[dot]infiernohacker[dot]com"
print "# Este es un modelo de De/Crypter, no es el final."
print "###############################################"
print "# Agradecimientos:"
print "# -Principalmente a [Bacardi]:"
print "#   Por su ayuda en python, gracias."
print "# -Infierno Hacker:"
print "#   Por ser una magnifica comunidad en la que todos aprendemos, gracias."
print "###############################################"
print "###############################################"
print "# Bienvenido al menu de -d33k40 De/crypter-"
print "###############################################"
print "# 1-Encriptar un texto."
print "# 2-Desencriptar un texto"
print "###############################################"

v1 = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
v2 = ["1-", "2-", "3-", "4-", "5-", "6-", "7-", "8-", "9-", "10-", "11-", "12-", "13-", "14-", "15-", "16-", "17-", "18-", "19-", "20-", "21-", "22-", "23-", "24-", "25-",  "26-"]
def prog(elec):
    if elec == 1:
        crypt(raw_input("Ingresa el texto: "))
    elif elec == 2:
        decrypt(raw_input("Ingresa el texto: "))
    else:
        print "Error, no has elegido ninguna posible eleccion."
        print "###############################################"
        print "# Bienvenido al menu de -d33k40 De/crypter-"
        print "###############################################"
        print "# 1-Encriptar un texto."
        print "# 2-Desencriptar un texto"
        print "###############################################"
        prog(raw_input("Ingresa 1 o 2 segun sea tu eleccion: "))

def seguir(seguir):
    if seguir == "si":
        print "###############################################"
        print "# Bienvenido al menu de -d33k40 De/crypter-"
        print "###############################################"
        print "# 1-Encriptar un texto."
        print "# 2-Desencriptar un texto"
        print "###############################################"
        prog(int(raw_input("Ingresa 1 o 2 segun sea tu eleccion: ")))
    elif seguir == "no":
        print "Hasta luego."
    else:
        print "Error."
        seguir(raw_input("Deseas De/Encriptar algun texto mas? si/no: "))

def crypt(text):
    texto = text
    salir = False
    v3 = 0
    while v3 <= 25:
        text = text.replace(v1[v3], v2[v3])
        v3 = v3 + 1
        print text
    res = raw_input("Quieres guardar el texto encriptado? si/no: ")
    if res == "si":
        nombre = raw_input("Ingresa el nombre del archivo: ") + ".txt"
        es = "Original: " + texto + " Encriptado: " + text
        file(nombre, "w").write(es)
        print "Texto guardado con exito"
        seguir(raw_input("Deseas De/Encriptar algun texto mas? si/no: "))
    else:
        print "Hasta luego"

def decrypt(text):
    texto = text
    salir = False
    v3 = 0
    while v3 <= 25:
        text = text.replace(v2[v3], v1[v3])
        v3 = v3 + 1
        print text
    res = raw_input("Quieres guardar el texto desencriptado? si/no: ")
    if res == "si":
        nombre = raw_input("Ingresa el nombre del archivo: ") + ".txt"
        es = "Encriptado: " + texto + " Original: " + text
        file(nombre, "w").write(es)
        print "Texto guardado con exito"
        seguir(raw_input("Deseas De/Encriptar algun texto mas? si/no: "))
    else:
        print "Hasta luego"

prog(int(raw_input("Ingresa 1 o 2 segun sea tu eleccion: ")))


Saludos, acepto sugerencias/fallos/ediciones/criticas constructivas.

Post original: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Espectacular! esto en Python me viene de 10!!!!


You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Espectacular! esto en Python me viene de 10!!!!

Buenas ANTRAX :) haber si empiezo a subir aportitos aqui :) espero te haya gustado amigo ;)