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
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $ python steno.py -help
Para ejecutar el programa sigue el siguiente formato
-e archivo_contenedor archivo_texto - > Guardar mensaje
-d archivo_contenedor clave clave - > Recuperar mensaje
NOTA: solo copia la clave desde la terminal
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $
@KevinMichelle
KevinMichelle / gist:bc9089d433cc008f088b
Created November 17, 2014 19:19
Ocultar archivo binario
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $ eog rue.jpg
(eog:4238): EOG-WARNING **: Couldn't load icon: Error writing
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $ python steno.py -e chihiro.wav rue.jpg
Modo seleccionado: Guardar mensaje
Tiempo para leer el archivo : 0:00:00.007129 segundos
Tiempo para leer el archivo : 0:00:16.373147 segundos
@KevinMichelle
KevinMichelle / gist:bd1d06e674c0525013fa
Created November 17, 2014 19:06
Manejo de longitud
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $ python steno.py -e chihiro.wav mensaje.txt
Modo seleccionado: Guardar mensaje
Tiempo para leer el archivo : 0:00:16.057958 segundos
No es posible guardar el mensaje por la longitud de caracteres
153152144 33480934
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $ cat mensaje.txt
Cardcaptor Sakura (カードキャプターさくら Kādokyaputā Sakura?), abbreviated as CCS and also known as Cardcaptors, is a Japanese shōjo manga series written and illustrated by the manga group Clamp. The manga was originally serialized in Nakayoshi from May 1996 to June 2000, and published in 12 tankōbon volumes by Kodansha from November 1996 to July 2000. The story focuses on Sakura Kinomoto, an elementary school student who discovers that she possesses magical powers after accidentally freeing a set of magical cards from the book they had been sealed in for years. She is then tasked with retrieving those cards in order to avoid an unknown catastrophe from befallin
@KevinMichelle
KevinMichelle / gist:37a9390f2f4cbbbce77d
Created November 17, 2014 19:00
Función de cifrado
def cifrado(mensaje, abecedario, numero_de_bits, clave):
formato_de_bits = "{0:0" + str(numero_de_bits) + "b}"
mensaje_cadena_binaria = []
for i in xrange(len(mensaje)):
indice = abecedario.index(mensaje[i])
mensaje_cadena_binaria.append(formato_de_bits.format(indice))
mensaje_cadena = "".join(mensaje_cadena_binaria)
cadena_cifrada = xor(mensaje_cadena, clave)
contador = 0
mensaje_cifrado_binario = []
@KevinMichelle
KevinMichelle / gist:9357e27f6331be150afe
Created November 17, 2014 18:09
Funciones generadoras de conjuntos
def organizar_posiciones(mensaje_preparado, numero_de_bits, control):
pos_actual = 44
posiciones = []
for letra in mensaje_preparado:
nuevas_posiciones = crear_posiciones(pos_actual, numero_de_bits, control)
pos_actual = nuevas_posiciones[len(nuevas_posiciones) - 1]
for i in nuevas_posiciones:
posiciones.append(i)
return posiciones
@KevinMichelle
KevinMichelle / gist:a284859a869f30db91e6
Created November 17, 2014 18:02
Resultados para mensajes de texto
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $ cat mensaje.txt
Sailor Moon (美少女戦士セーラームーン Bishōjo Senshi Sērā Mūn?, originally translated as Pretty Soldier S...
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $ python steno.py -help
Para ejecutar el programa sigue el siguiente formato
-e archivo_contenedor archivo_texto - > Guardar mensaje
-d archivo_contenedor clave clave - > Recuperar mensaje
@KevinMichelle
KevinMichelle / gist:82072231cb79c7f5e9b9
Last active August 29, 2015 14:09
Funciones principales
def ocultar(name, archivo_a_ocultar):
#Checar si se va a guardar un archivo binario o un mensaje de texto
datos_archivo = os.path.splitext(archivo_a_ocultar)
file_ext_archivo = datos_archivo[len(datos_archivo) - 1]
mensaje_texto = True
if file_ext_archivo == ".txt":
archivo_texto = open(archivo_a_ocultar, 'r')
texto = archivo_texto.read()
archivo_texto.close()
abecedario = crear_abecedario(True)
@KevinMichelle
KevinMichelle / ocultar_texto1
Last active August 29, 2015 14:09
Ocultar mensajes de texto
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $ cat mensaje.txt
Sailor Moon (美少女戦士セーラームーン Bishōjo Senshi Sērā Mūn?, originally translated as Pretty Soldier S...
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Steganography $ python steno.py -help
Para ejecutar el programa sigue el siguiente formato
-e archivo_contenedor archivo_texto - > Guardar mensaje
-d archivo_contenedor clave clave - > Recuperar mensaje
@KevinMichelle
KevinMichelle / Avance_parcial_ocultar
Last active August 29, 2015 14:09
Avance parcial de esteganografía
kevin@kevin-Presario-CQ43-Notebook-PC ~/Desktop/Audio $ python leer_binario.py -e 3.png
encriptar
Tiempo para leer el archivo : 0:00:00.076056 segundos
[45, 53, ... , 974, ..., 1171] - > Nota: Lista de bytes
por cambiar siguiendo una heurística inventada,
se ha ocultado el patrón para evitar que alguién lo pueda adivinar
MENSAJE ORIGINAL
Kev Mic
@KevinMichelle
KevinMichelle / ocultar.py
Created November 14, 2014 12:15
Función principal
def ocultar():
arreglo_byte = leer_bytes(nombre)
abecedario = crear_abecedario()
maximo = "{0:b}".format(len(abecedario) - 1)
numero_de_bits = len(maximo)
texto = "Kevin"