This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\Otro\firmas_digitales>python cliente.py kurogane@gmail.com texto_plano.txt elly@gmail.com | |
El servidor es quien dice que es | |
El servidor confirma que soy yo | |
Claves del cliente [30081, 1374548540040989L, 1896426953870377L] | |
Clave del destinatario [23407, 4523995208352073L] | |
Cifrar texto de : 33 caracteres, 7 palabras en 0 segundos | |
C:\Users\Otro\firmas_digitales>python cliente.py kurogane@gmail.com texto_plano.txt elhaym@gmail.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\Otro\firmas_digitales>python cliente.py michelle@gmail.com texto_plano.txt elly@gmail.com | |
El servidor es quien dice que es | |
El servidor confirma que soy yo | |
CIFRAR | |
hola | |
['%oxkxmbkbmw', 'znmy%oya;u'] | |
CIFRAR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\Otro\firmas_digitales>python cliente.py elly@gmail.com -nrsa | |
-nrsa | |
Crear nuevo archivo de usuario, porque: | |
-No existe tu archivo personal. | |
Las llaves RSA se crearon en : 13 segundos | |
C:\Users\Otro\firmas_digitales>python cliente.py michelle@gmail.com -nrsa | |
-nrsa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cliente.py | |
def recuperar_clave_personal(correo): | |
filename = "../archivos/" + correo + '.dat' | |
if os.path.isfile(filename): | |
archivo = open(filename) | |
auxiliar_datos = archivo.readline() | |
datos = auxiliar_datos.split() | |
archivo.close() | |
return datos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cliente.py | |
def abrir_archivo(nombre_archivo, datos_solicitados): | |
clave_personal = recuperar_clave_personal(correo) #IMPORTANTE | |
clave = [int(clave_personal[1]), int(clave_personal[2]), int(clave_personal[3])] | |
clave_del_otro = [int(datos_solicitados[1]), int(datos_solicitados[2])] | |
max = len(nombre_archivo) | |
min = max - 4 | |
if nombre_archivo[min:max] == ".txt": | |
archivo = open(nombre_archivo, 'r') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
transformar.py | |
def transformar_mensaje(contenido, clave, clave_otro, cifrar): | |
e = clave[0] | |
d = clave[1] | |
n = clave[2] | |
e_otro = clave_otro[0] | |
n_otro= clave_otro[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sakura.py | |
elif cadena[0] == "desafiar_servidor": | |
correo = cadena[1] | |
temporal = [correo, None] | |
datos_usuario_servidor = buscar_usuario(temporal, consulta_servidor) | |
if datos_usuario_servidor is not None: | |
e_cliente = int(datos_usuario_servidor[1]) | |
n_cliente = int(datos_usuario_servidor[2]) | |
reto = int(cadena[2]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cliente.py | |
def solicitar_datos(correo, correo_destinatario, guardar): | |
desafiar_servidor(correo) | |
correo_temporal = [correo_destinatario, correo] | |
resultados = buscar_usuario(correo_temporal, False) | |
if resultados is not None: #Busqueda en archivo local | |
resultados.append(correo) | |
if guardar: #Si se encontro datos en el archivo local, pero se desea actualizar, hay que consultar de nuevo al servidor | |
nuevos_resultados = busqueda_servidor(correo, correo_destinatario) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
manipular_archivos_rsa.py | |
import os.path | |
# datos = [correo, e, n] -> servidor | |
# datos = [correo, e, n, correo_cliente] -> cliente | |
def crear_usuario(datos, es_servidor): | |
print "Crear usuario" | |
if es_servidor: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mint@mint ~/Desktop/firmas_digitales $ python sakura.py | |
Esperando... | |
Crear o actualizar usuario | |
Crear usuario | |
Esperando... | |
Crear o actualizar usuario | |
Crear usuario | |
Esperando... | |
Crear o actualizar usuario | |
Crear usuario |