Dave Angel wrote:
for byte0, byte1 in itertools.izip(packed_data,
itertools.cycle(packed_XorKey)):
decrypt.append(chr(ord(byte0) ^ ord(byte1)))
And of course that leads to:
decrypt = [chr(ord(byte0) ^ ord(byte1)) for byte0, byte1 in
itertools.izip(packed_data, itertools.cycle(packed_X
EncryptString="313B372C2E2C63362E2128"
>
>
>This is different to what I expected, it is a string of ascii bytes
>representing hex values.
>Is that the real format of your data? If so we need to split it into pairs and
>use
>int() to convert it. Or is your real data a string of bytes that happen
Sweet nice tip I love this list. Thank you.
Mike
On Sat, Oct 24, 2009 at 7:40 PM, Dave Angel wrote:
> Tom Green wrote:
>
>> Thanks for your reply Dave. I am capturing the data off the network
>> (wireshark) and saving it in WinHex for testing. I am actually building a
>> socket to decrypt th
Tom Green wrote:
Thanks for your reply Dave. I am capturing the data off the network
(wireshark) and saving it in WinHex for testing. I am actually building a
socket to decrypt the data, so prior to implementing my logic in the socket,
I figured I would write the algorithm in a quick script. H
Thanks for your reply Dave. I am capturing the data off the network
(wireshark) and saving it in WinHex for testing. I am actually building a
socket to decrypt the data, so prior to implementing my logic in the socket,
I figured I would write the algorithm in a quick script. Here is what I
have
Tom Green wrote:
Alan,
Thanks for your response and hopefully I can clear things up. I apologize
for not being more clear.
I obtain the HEX encoded data from Winhex i.e. copy Hex values. The HEX
encode data is very large and I simply paste it into my Python script along
with the XOR key. The
This is what I have so far,
import struct
EncryptString="313B372C2E2C63362E2128"
XorKey="41424344"
key = struct.unpack("d", XorKey)
num_ints = len(EncryptString)/11
data = struct.unpack("%dd"% num_ints,EncryptString)
The above code generates an error the my string must be a string length of
16
> Take the 4 byte XOR key. If I convert them to int with Base 16
> it takes the 4 and converts it to 0x34 when I in turn I actually need 0x41.
OK, thats because int is for converting strings. You need to use struct.unpack
to convert the 4 bytes into an int.
You also need to figure out how man
Alan,
Thanks for your response and hopefully I can clear things up. I apologize
for not being more clear.
I obtain the HEX encoded data from Winhex i.e. copy Hex values. The HEX
encode data is very large and I simply paste it into my Python script along
with the XOR key. The data is a string o
"Tom Green" wrote
wondering if there was someway in Python to indicate that the string is a
string of HEX values similar to Perl's pack.
You need to be very careful in your terminology here.
Is it "a string of hex values" ie a string representation of a hex
value or is it a string of bytes
Hello everyone,
First, I wanted to thank everyone in advance for your help and any feedback
is appreciated. Here is what I am trying to accomplish:
I have this encrypted data that was sent across the network. The decryption
is a simple XOR with a 16 byte key. I started writing a basic Python s
In general, xxx.pyc is the compiled Python bytecode for xxx.py, so
> struct.py is the source for struct.pyc.
>
> Looking at struct.py, it's entire contents is
> from _struct import *
> from _struct import _clearcache
>
> This is a pretty common idiom in the std lib for modules that are
> implemente
On Sun, Sep 6, 2009 at 2:20 PM, Tino Dai wrote:
> Hi All,
>
> Hope the people in the US are having a nice Labor Day! I am looking for
> the source code
> for the pack/unpack functions found in the struct package. As of this email,
> I have tried a
> strings on the struct.pyc file. The inspecti
Hope the people in the US are having a nice Labor Day! I am looking for
the source code
for the pack/unpack functions found in the struct package. As of this
email, I have tried a
strings on the struct.pyc file. The inspection of the pyc file was hoping
that I could find a
stub to the source.
On Sun, Sep 6, 2009 at 3:20 PM, Tino Dai wrote:
> Hi All,
>
> Hope the people in the US are having a nice Labor Day! I am looking for
> the source code
> for the pack/unpack functions found in the struct package. As of this
> email, I have tried a
> strings on the struct.pyc file. The inspect
Hi All,
Hope the people in the US are having a nice Labor Day! I am looking for
the source code
for the pack/unpack functions found in the struct package. As of this email,
I have tried a
strings on the struct.pyc file. The inspection of the pyc file was hoping
that I could find a
stub to the
Note: CC'ing tutor list to make reply visible to all.
> i had to close PYTHONWIN to get out of the program.
Aha!
There are problems in running Tkinter inside both IDLE and Pythonwin.
Basically both programs try to trap abnormal termination - which includes
the GUI close messages...
IMHO, to tes
At 01:57 PM 11/5/2005, Shi Mu wrote:
>when I clicked 'quit' button,
>there is no response. I want to close the interface by clicking 'x',
>the interface could not be closed.
>i had to close PYTHONWIN to get out of the program.
That is a known problem running Tkinter stuff under PythonWin. Others m
when I clicked 'quit' button,
there is no response. I want to close the interface by clicking 'x',
the interface could not be closed.
i had to close PYTHONWIN to get out of the program.
On 11/5/05, Alan Gauld <[EMAIL PROTECTED]> wrote:
> > Why the button of the following code does not work? Thank
> Why the button of the following code does not work? Thanks!
The program works perfectly for me.
Which button do you think is not working?
If its the Hello one where do you expect to see the output?
print always prints to stdout so you need to look in the
console window not on the GUI.
But othe
>frame = Frame(master)
> self.button
Sam - What do you think will happen to frame when __init__ finishes?
On 11/5/05, Shi Mu <[EMAIL PROTECTED]> wrote:
> Why the button of the following code does not work? Thanks!
>
> from Tkinter import *
>
> class App:
>
> def __init__(self, master):
>
>
Why the button of the following code does not work? Thanks!
from Tkinter import *
class App:
def __init__(self, master):
frame = Frame(master)
frame.pack()
self.button = Button(frame, text="QUIT", fg="red", command=frame.quit)
self.button.pack(side=LEFT)
pack is a method of Tkinter widget that needs to be called in order to
have it displayed with the current geometry manager(which per default is
the pack method)
A geometry manager is just a way for arranging widgets into a window.
Another geometry manager is "grid"
If you don't specify anyth
what does pack mean in the following code?
# File: hello1.py
from Tkinter import *
root = Tk()
w = Label(root, text="Hello, world!")
w.pack()
root.mainloop()
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
24 matches
Mail list logo