Skip to content

Instantly share code, notes, and snippets.

View KevinMichelle's full-sized avatar

Kevin Michelle Contreras González KevinMichelle

  • Nuevo León, México
View GitHub Profile
@KevinMichelle
KevinMichelle / claves_amigas
Created November 3, 2014 11:22
Claves amigas RSA
mint@mint ~/Desktop/firmas_digitales $ python cliente.py michelle@gmail.com texto_plano.txt elly@gmail.com -save
El servidor es quien dice que es
El servidor confirma que soy yo
Crear usuario
mint@mint ~/Desktop/firmas_digitales $ cat ../archivos/michelle@gmail.com_usuarios.usuarios
elly@gmail.com 84691 4131393600897181
mint@mint ~/Desktop/firmas_digitales $ python cliente.py michelle@gmail.com texto_plano.txt kevin@gmail.com -save
El servidor es quien dice que es
El servidor confirma que soy yo
Crear usuario
@KevinMichelle
KevinMichelle / otro_archivo_rsa
Created November 3, 2014 11:20
Más archivo
mint@mint ~/Desktop/firmas_digitales $ cat texto_plano.txt
hola hola hola como estas hola hola hola como estas hola hola hola como estas espero que bien
este es un mensaje hola hola hola como estas hola hola hola como estas hola hola hola como estas encriptado
espero que se encripte bien bien
mint@mint ~/Desktop/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
mint@mint ~/Desktop/firmas_digitales $ cat texto_cifrado.txx
%oh$ohkgdmh ab;nioykhox
%oh$ohkgdmh ab;nioykhox
@KevinMichelle
KevinMichelle / rsa_socket_descifrar
Created November 3, 2014 11:19
(RSA/socket) Descifrar
mint@mint ~/Desktop/firmas_digitales $ python cliente.py elly@gmail.com texto_cifrado.txx michelle@gmail.com
El servidor es quien dice que es
El servidor confirma que soy yo
DESCIFRAR
['%oh$ohkgdmh', 'ab;nioykhox']
['0000110000010010000010000010010110001000001010111001001', '0001000011111100111101010100001101001100010011000011001']
[1698762959623625L, 2390864976815641L]
[373061149196205L, 597159408560434L]
@KevinMichelle
KevinMichelle / rsa_socket_cifrar
Created November 3, 2014 11:18
(RSA/socket) Cifrar
mint@mint ~/Desktop/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
[['h', 'o', 'l'], ['a']]
['010011000001101', '00010']
[9741, 2]
@KevinMichelle
KevinMichelle / rsa_crear_usuario_consulta
Last active August 29, 2015 14:08
(RSA/socket) Crear usuarios
Microsoft Windows [Versión 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.
C:\Users\Otro>cd firmas_digitales
C:\Users\Otro\firmas_digitales>python cliente.py kurogane@gmail.com texto_plano.txt mokona@gmail.com
No existe archivo de usuario, crear llaves
Las llaves RSA se crearon en : 9 segundos
El servidor es quien dice que es
El servidor confirma que soy yo
@KevinMichelle
KevinMichelle / res-sistema-rsa
Last active August 29, 2015 14:07
Resultados de autenticación del sistema
C:\Users\Kevin>python reto.py 1234 27957058 653 44906647
La f(x) que se espera del servidor es 2468.
El mensaje recuperado es 2468.
El servidor es quien dice que es.
C:\Users\Kevin>python reto.py 1234 27957059 653 44906647
La f(x) que se espera del servidor es 2468.
@KevinMichelle
KevinMichelle / daralta.php
Created October 16, 2014 10:33
Mecanismo de registro (consulta)
<?php
function daralta(){
$nombre=$_POST['nombre'];
$e=$_POST['e'];
$n=$_POST['n'];
$enlace = conectarServidor();
if ($enlace){
@KevinMichelle
KevinMichelle / registro.php
Created October 16, 2014 10:33
Registro del usuario
<html>
<head>
<script type="text/javascript" src="rutinas.js">
</script>
</head>
<body>
<a href="inicio.php">Inicio</a>
<br><br>
<form onsubmit='return RSA()'>
<input type='submit' value='Generar Llave'>
@KevinMichelle
KevinMichelle / id_sistema
Created October 16, 2014 10:31
Identificación del sistema
import sys
import random
def sonNumeros(arreglo):
areNumber = True
for i in xrange(1, len(arreglo)):
if not arreglo[i].isdigit(): # Si alguno de los argumentos no son numeros
areNumber = False
break
return areNumber
@KevinMichelle
KevinMichelle / ide_usuario.php
Last active August 29, 2015 14:07
Identificación del usuario
<?php
include 'conectar.php';
include 'usuarios.php';
include 'rutinas_php.php';
$usuario=$_POST['usuarios']; #id del usuario
$respuesta=$_POST['respuesta'];
$reto=$_POST['reto'];