openssl aes 128 en de and python read file - JohnHau/mis GitHub Wiki

#!/bin/bash

echo -n -e '\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a'
| openssl enc -v -aes-128-cbc -K 2b7e151628aed2a6abf7158809cf4f3c
-iv 000102030405060708090a0b0c0d0e0f -nopad| od -Ax -tx1

#!/bin/bash

#echo -n -e '\x76\x49\xab\xac\x81\x19\xb2\x46\xce\xe9\x8e\x9b\x12\xe9\x19\x7d' \

| openssl enc -d -aes-128-cbc -K 2b7e151628aed2a6abf7158809cf4f3c\

cat eee.bin
| openssl enc -d -aes-128-cbc -K 2b7e151628aed2a6abf7158809cf4f3c
-iv 000102030405060708090a0b0c0d0e0f | od -Ax -tx1 -iv 000102030405060708090a0b0c0d0e0f | od -Ax -tx1

#!/usr/bin/python import os print("hello python")

size=os.path.getsize("odb.bin") print("size is %d" %size)

fp=open("odb.bin","rb+")

fp.seek(2,0) #fp.seek(2,os.SEEK_SET) cp=fp.tell() print("cp is %d"% cp)

nb=fp.write(b'\x3c') print("write %d bytes" % nb)

fp.flush()

#con=fp.read(1) #con=fp.read()

#print("it is %x" % con.hex()) #print("it is %x" % int(con.hex()))

#print(list(con)) #for i in list(con):

print(hex(i))

#print(type(con))

#rv= int(con.hex(),16) #print(hex(rv))

#rv= int(con,16) #print(con.hex()) #print(int.from_bytes(con,byteorder='big')) #print(type(con.hex()))

fp.close()