8 _________________________________________
\r
9 Crea una conexion a una database indicada
\r
10 _________________________________________
\r
12 global database,db_cursor
\r
13 database=sqlite3.connect(name)
\r
14 db_cursor=database.cursor()
\r
18 ______________________
\r
19 Ejecuta codigo sqlite3
\r
20 ______________________
\r
22 db_cursor.execute(args)
\r
24 def create(args1,args2):
\r
26 _________________________
\r
29 CREATE = CREA un registro
\r
30 _________________________
\r
32 db_cursor.execute("INSERT INTO "+args1+" VALUES("+args2+")")
\r
34 def read(args1,*args2):
\r
36 ______________________
\r
39 READ = LEE un registro
\r
40 ______________________
\r
43 data=db_cursor.execute("SELECT * FROM "+str(args1)+" WHERE "+str(args2[0])+"="+str(args2[1]))
\r
45 data=db_cursor.execute("SELECT * FROM "+str(args1))
\r
46 return data.fetchall()
\r
48 def update(args1,*args2):
\r
50 ______________________________
\r
53 UPDATE = ACTUALIZA un registro
\r
54 ______________________________
\r
56 db_cursor.execute("UPDATE "+str(args1)+" SET "+str(args2[0])+" = "+str(args2[1])+" where "+str(args2[2])+" = "+str(args2[3])+"")
\r
58 def delete(args1,args2,args3):
\r
60 ____________________________
\r
63 DELETE = ELIMINA un registro
\r
64 ____________________________
\r
66 db_cursor.execute("DELETE FROM "+args1+" WHERE "+args2+"="+args3)
\r
70 _____________________
\r
72 hechos en la database
\r
73 _____________________
\r
85 print("connect"+connect.__doc__)
\r
86 print("runcode"+runcode.__doc__)
\r
87 print("create"+create.__doc__)
\r
88 print("read"+read.__doc__)
\r
89 print("update"+update.__doc__)
\r
90 print("delete"+delete.__doc__)
\r
91 print("save"+save.__doc__)
\r
92 print("close"+close.__doc__)
\r
100 text=texto.encode("UTF-8")
\r
101 code=base64.b64encode(text).decode("UTF-8")
\r
106 code=base64.b64decode(text)
\r
107 return code.decode("UTF-8")
\r
109 def encode_list(list2encode,encode2list):
\r
111 for i in range(0,len(list2encode)):
\r
112 encode2list.append(encode(list2encode[contador]))
\r
113 contador=contador+1
\r
116 def decode_list(list2decode):
\r
119 for i in range(0,len(list2decode)):
\r
120 decode2list.append(decode(list2decode[contador1]))
\r
121 contador1=contador1+1
\r
208 alphabet_inversed={
\r
296 for i in range(0,5):
\r
297 for i in range(0,len):
\r
298 passw=passw+alphabet[random.randint(1,77)]
\r
299 check_password_potential(passw)
\r
300 if count_pot>=pass_alt[1]:
\r
301 pass_alt=[passw,count_pot]
\r
314 def check_password_potential(password):
\r
315 global count_pot,count,pass_2,cali
\r
319 if count==len(password):
\r
321 if "a" in password[count]:
\r
322 count_pot=count_pot+0.1
\r
323 if "b" in password[count]:
\r
324 count_pot=count_pot+0.1
\r
325 if "c" in password[count]:
\r
326 count_pot=count_pot+0.1
\r
327 if "d" in password[count]:
\r
328 count_pot=count_pot+0.1
\r
329 if "e" in password[count]:
\r
330 count_pot=count_pot+0.1
\r
331 if "f" in password[count]:
\r
332 count_pot=count_pot+0.1
\r
333 if "g" in password[count]:
\r
334 count_pot=count_pot+0.1
\r
335 if "h" in password[count]:
\r
336 count_pot=count_pot+0.1
\r
337 if "i" in password[count]:
\r
338 count_pot=count_pot+0.1
\r
339 if "j" in password[count]:
\r
340 count_pot=count_pot+0.1
\r
341 if "k" in password[count]:
\r
342 count_pot=count_pot+0.1
\r
343 if "l" in password[count]:
\r
344 count_pot=count_pot+0.1
\r
345 if "m" in password[count]:
\r
346 count_pot=count_pot+0.1
\r
347 if "n" in password[count]:
\r
348 count_pot=count_pot+0.1
\r
349 if "ñ" in password[count]:
\r
350 count_pot=count_pot+0.1
\r
351 if "o" in password[count]:
\r
352 count_pot=count_pot+0.1
\r
353 if "p" in password[count]:
\r
354 count_pot=count_pot+0.1
\r
355 if "q" in password[count]:
\r
356 count_pot=count_pot+0.1
\r
357 if "r" in password[count]:
\r
358 count_pot=count_pot+0.1
\r
359 if "s" in password[count]:
\r
360 count_pot=count_pot+0.1
\r
361 if "t" in password[count]:
\r
362 count_pot=count_pot+0.1
\r
363 if "u" in password[count]:
\r
364 count_pot=count_pot+0.1
\r
365 if "v" in password[count]:
\r
366 count_pot=count_pot+0.1
\r
367 if "w" in password[count]:
\r
368 count_pot=count_pot+0.1
\r
369 if "x" in password[count]:
\r
370 count_pot=count_pot+0.1
\r
371 if "y" in password[count]:
\r
372 count_pot=count_pot+0.1
\r
373 if "z" in password[count]:
\r
374 count_pot=count_pot+0.1
\r
375 if "." in password[count]:
\r
376 count_pot=count_pot+1
\r
377 if "A" in password[count]:
\r
378 count_pot=count_pot+0.4
\r
379 if "B" in password[count]:
\r
380 count_pot=count_pot+0.4
\r
381 if "C" in password[count]:
\r
382 count_pot=count_pot+0.4
\r
383 if "D" in password[count]:
\r
384 count_pot=count_pot+0.4
\r
385 if "E" in password[count]:
\r
386 count_pot=count_pot+0.4
\r
387 if "F" in password[count]:
\r
388 count_pot=count_pot+0.4
\r
389 if "G" in password[count]:
\r
390 count_pot=count_pot+0.4
\r
391 if "H" in password[count]:
\r
392 count_pot=count_pot+0.4
\r
393 if "I" in password[count]:
\r
394 count_pot=count_pot+0.4
\r
395 if "J" in password[count]:
\r
396 count_pot=count_pot+0.4
\r
397 if "K" in password[count]:
\r
398 count_pot=count_pot+0.4
\r
399 if "L" in password[count]:
\r
400 count_pot=count_pot+0.4
\r
401 if "M" in password[count]:
\r
402 count_pot=count_pot+0.4
\r
403 if "N" in password[count]:
\r
404 count_pot=count_pot+0.4
\r
405 if "Ñ" in password[count]:
\r
406 count_pot=count_pot+0.4
\r
407 if "O" in password[count]:
\r
408 count_pot=count_pot+0.4
\r
409 if "P" in password[count]:
\r
410 count_pot=count_pot+0.4
\r
411 if "Q" in password[count]:
\r
412 count_pot=count_pot+0.4
\r
413 if "R" in password[count]:
\r
414 count_pot=count_pot+0.4
\r
415 if "S" in password[count]:
\r
416 count_pot=count_pot+0.4
\r
417 if "T" in password[count]:
\r
418 count_pot=count_pot+0.4
\r
419 if "U" in password[count]:
\r
420 count_pot=count_pot+0.4
\r
421 if "V" in password[count]:
\r
422 count_pot=count_pot+0.4
\r
423 if "W" in password[count]:
\r
424 count_pot=count_pot+0.4
\r
425 if "X" in password[count]:
\r
426 count_pot=count_pot+0.4
\r
427 if "Y" in password[count]:
\r
428 count_pot=count_pot+0.4
\r
429 if "Z" in password[count]:
\r
430 count_pot=count_pot+0.4
\r
431 if "0" in password[count]:
\r
432 count_pot=count_pot+0.7
\r
433 if "1" in password[count]:
\r
434 count_pot=count_pot+0.7
\r
435 if "2" in password[count]:
\r
436 count_pot=count_pot+0.7
\r
437 if "3" in password[count]:
\r
438 count_pot=count_pot+0.7
\r
439 if "4" in password[count]:
\r
440 count_pot=count_pot+0.7
\r
441 if "5" in password[count]:
\r
442 count_pot=count_pot+0.7
\r
443 if "6" in password[count]:
\r
444 count_pot=count_pot+0.7
\r
445 if "7" in password[count]:
\r
446 count_pot=count_pot+0.7
\r
447 if "8" in password[count]:
\r
448 count_pot=count_pot+0.7
\r
449 if "9" in password[count]:
\r
450 count_pot=count_pot+0.7
\r
451 if "." in password[count]:
\r
452 count_pot=count_pot+1
\r
453 if "!" in password[count]:
\r
454 count_pot=count_pot+1
\r
455 if "#" in password[count]:
\r
456 count_pot=count_pot+1
\r
457 if "$" in password[count]:
\r
458 count_pot=count_pot+1
\r
459 if "%" in password[count]:
\r
460 count_pot=count_pot+1
\r
461 if "&" in password[count]:
\r
462 count_pot=count_pot+1
\r
463 if "/" in password[count]:
\r
464 count_pot=count_pot+1
\r
465 if "(" in password[count]:
\r
466 count_pot=count_pot+1
\r
467 if ")" in password[count]:
\r
468 count_pot=count_pot+1
\r
469 if "=" in password[count]:
\r
470 count_pot=count_pot+1
\r
471 if "?" in password[count]:
\r
472 count_pot=count_pot+1
\r
473 if "\\" in password[count]:
\r
474 count_pot=count_pot+1
\r
475 if "¡" in password[count]:
\r
476 count_pot=count_pot+1
\r
477 if "¿" in password[count]:
\r
478 count_pot=count_pot+1
\r
479 if "[" in password[count]:
\r
480 count_pot=count_pot+1
\r
481 if "]" in password[count]:
\r
482 count_pot=count_pot+1
\r
483 if "{" in password[count]:
\r
484 count_pot=count_pot+1
\r
485 if "}" in password[count]:
\r
486 count_pot=count_pot+1
\r
487 if "+" in password[count]:
\r
488 count_pot=count_pot+1
\r
489 if "*" in password[count]:
\r
490 count_pot=count_pot+1
\r
491 if "~" in password[count]:
\r
492 count_pot=count_pot+1
\r
494 if count_pot<=0.1 and count_pot>=0:
\r
495 cali="muy muy débil"
\r
496 elif count_pot<=1 and count_pot>=0.2:
\r
498 elif count_pot<=3 and count_pot>=1.1:
\r
500 elif count_pot<=5 and count_pot>=3.1:
\r
502 elif count_pot<=10 and count_pot>=5.1:
\r
504 elif count_pot<=15 and count_pot>=10.1:
\r
507 cali="indetectable"
\r
512 count_max=[0,"lala"]
\r
514 from tkinter import *
\r
518 check_password_potential(password(30))
\r
519 if count_max[0]<=count_pot:
\r
520 count_max=[count_pot,pass_2]
\r
521 print(cali,pass_2,"\n",count_max)
\r
522 print("_"*int(count_pot))
\r
533 e1=Entry(textvariable=hola)
\r
535 status=Label(text="Generador")
\r
539 global hola_status,hola
\r
541 if hola_status==hola.get():
\r
544 hola_status=hola.get()
\r
545 status.config(text=check_password_potential(hola.get()))
\r
546 t=threading.Thread(target=while_)
\r
555 for i in range(0,27):
\r
556 print("if "+'"'+alphabet[count]+'"'+" in password[count]:")
\r