Okay, this is what I am trying to do. I am attempting to create my own encrypter. I have the base encryption running, used just to encrypt a string you put in. I am going to add functionality to open a text file's contents and encrypt them, outputing them into another text file. I will be working on that later, so I might post up my questions if I can't figure it out. Anyways, this is what I need help with:
1) How do I open a file's binary code, and convert it to hex?
2) After opening it in hex, it shoud become manipulatable, such as, I can make it into a list, then change each odd charecter, correct?
3) After messing with the hex, how do I convert it back into binary, then save it?
Thank you very much in advance!
~ Hondros
hondros
25
Junior Poster
Recommended Answers
Jump to PostWhich version of Python are you using, it makes a difference.
Jump to PostHere is an example for Python25, it should work with Python26 ...
# read a binary data file # and create a list of 2 digit hexadecimals # the test data file contains the string 'zoomer' try: # pick a file you have in the working directory …
All 5 Replies
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
hondros
25
Junior Poster
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
hondros
25
Junior Poster
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.