[Código-Python] Code & Decode Archivo a HEX - JaAViEr

Iniciado por JaAViEr, Julio 31, 2011, 09:49:30 PM

Tema anterior - Siguiente tema

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

Julio 31, 2011, 09:49:30 PM Ultima modificación: Marzo 23, 2015, 12:06:15 PM por Expermicid
Especificamos un archivo y lo pasa a HEX , también su inverso.
Código: python

# -*- coding: utf-8 -*-
import binascii
fil=open(raw_input("Archivo:"),"r")
opc=input("1.- Encriptar.\n2.- Desencriptar.\nOpcion:")
encriptado=[]
crypt_temp=""
encr=""
if opc==1:
  for i in fil.read():
    encriptado.append(binascii.b2a_hex(i))
  for sale in encriptado:
    encr+="%s "%sale
  print encr
if opc==2:
  inverso_hex=""
  for i in fil.read():
    inverso_hex+="%s"%i
  for d in inverso_hex.split():
    crypt_temp+=binascii.a2b_hex(d)
  print crypt_temp


Saludos.
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


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
gracias

ya no mas calculadora de windows, xD
Jajaja no entendí :C pero bueno, espero te sirva.
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