PX2-Generator - generador de clave segura V 1.0

Iniciado por _4L3, Junio 05, 2011, 12:20:30 AM

Tema anterior - Siguiente tema

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

Junio 05, 2011, 12:20:30 AM Ultima modificación: Enero 18, 2013, 06:00:30 PM por 11Sep
Hola, soy nuevo aquí y también nuevo en python, después de leer un rato me decidí a codear este script en python

> funciones

* generar clave segura entre 12 a 18 caracteres.

* generar un archivo *.txt con la password, el nombre del archivo y el comentario son asignados por el usuario.


El *.txt se genera en la mismo directorio donde se esta ejecutando el script.


Código: python


#!/usr/bin/env python
#-*-encoding: utf-8 -*-

import random, re, os
from random import choice


def main():
    "presentation tool"
    #os.system('title PX2 Generator V 1.0')
    os.system('clear')
    #os.system('cls')
    print "\n************************************************************ "
    print "*         Name    : PX2 Generator                          * " # PX2 Generator (Paja Password Generator)
    print "*         Version : 1.0                                    * "
    print "*         Code by : _4L3                                   * "
    print "*         Website : http://zonadebit.blogspot.com          * "
    print "*         E-mail  : [email protected]             * "
    print "*         License : Creative Commons BY - NC - SA          * "   # licencia CC: Reconocimiento - No Comercial - Compartir Igual 3.0
    print "************************************************************ \n"


def Generator_Password():
    "random password generator"

    Password = ''

    for i in range(3):
   
      Aleatory1 = random.choice ('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
      Aleatory2 = random.choice ('|@#_$%-&(>)=?¿/¡!\.,<[]{}^') 
      Aleatory3 = random.choice ('abcdefghijklmnopqrstuvwxyz') 
      Aleatory4 = str(random.choice(range(200)))
      Password = Password + (Aleatory1 + Aleatory2 + Aleatory3 + Aleatory4)

    print chr(27)+"[1;37m","[+]",chr(27)+"[0;37m","Your password has",len(Password),"characters :",chr(27)+"[1;32m",Password, chr(27)+"[0m", "\n\n"
    #print " [+] Your password has",len(Password),"characters : ",Password,"\n\n"
    Option(Password)

   
def Option(Password):

    option=raw_input(" > In accordance ? if you're not in accordance generates a new password Y/N : ")

    if option=='yes' or option=='Yes' or option=='YES' or option=='y' or option=='Y':
     
         Generator_Password()
       
    elif option=='not' or option=='Not' or option=='NOT' or option=='n' or option=='N':
       
         Build_File(Password)
     
    else:
 
         Option(Password)


def Build_File(Password):

    File_name = raw_input("\n > Writes the file name  : ")


    if re.search("[^A-Za-z0-9_ ]",File_name) or File_name == '' :

       print"\n > Not accept empty spaces and special characters, only numbers and letters. \n"
       Build_File(Password)

    else:

       File_name = File_name + ".txt"
       Comment= raw_input("\n > Comment : ")

       try:

           Lines = [Comment+"\n\n", "[+] Your password : "+Password]
           Archive = open(File_name, "w")
           Archive.writelines(Lines)

       except IOError, e:

   print"Your error is : ",e
   exit()

       finally:

   Archive.close()
           raw_input("\n > Thanks for using PX2-Generator, Press the [Enter] key to exit\n")


main()
Generator_Password()





*.exe para windows > 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

*.py para Gnu/linux > 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

saludos a esta gran comunidad  ;)
no quiero imitar o lograr ser como otros, solo quiero construir el mejor yo.

Nice, también está el Py2Exe
Aunque nunca he usado algo así...
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

Py2Exe, exacto man yo escribí el 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, luego en la terminal de windows escribí el siguiente comando

>python 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 py2exe

y listo obtuve mi ejecutable saludos  ;D
no quiero imitar o lograr ser como otros, solo quiero construir el mejor yo.