Python Forum
computing entropy using pickle files
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
computing entropy using pickle files
#1
Hi everyone
Happy holidays

I'm working on the ISCX VPN2016 dataset, it consists of some pcap files (each pcap is captured traffic of a specific app such as skype or youtube) and I used this code on github to convert the pcaps to pickle files. The prepro.py converts the pcap files to two pickle files, and now I have these bunch of pickles and with running the code below:

checkThePickle = open("AIMchat2.pcapng.pickle", "rb")
pkl = pickle.load(checkThePickle)
print(pkl)
It prints out something like this:

Quote:([array([ 69, 0, 0, 157, 85, 188, 64, 0, 128, 6, 215, 201, 131,
202, 240, 87, 64, 12, 24, 167, 52, 73, 1, 187, 9, 93,
46, 200, 243, 42, 197, 49, 80, 24, 250, 91, 41, 106, 0,
0, 23, 3, 2, 0, 112, 20, 144, 204, 89, 124, 163, 127,
209, 18, 226, 180, 46, 85, 57, 41, 242, 48, 241, 123, 189,
29, 163, 87, 12, 25, 194, 240, 140, 11, 140, 134, 22, 153,
216, 58, 25, 176, 71, 231, 178, 244, 157, 130, 142, 38, 97,
4, 242, 162, 142, 206, 164, 98, 204, 251, 228, 208, 222, 137,
101, 85, 85, 93, 30, 254, 70, 155, 118, 136, 244, 243, 220,
143, 222, 166, 75, 107, 49, 113, 96, 148, 93, 19, 215, 124,
163, 22, 206, 204, 27, 167, 16, 197, 189, 0, 232, 77, 139,
5, 118, 149, 163, 140, 208, 131, 193, 241, 18, 238, 159, 239,
109], dtype=uint8), array([ 69, 0, 0, 40, 183, 8, 64, 0, 100, 6, 146, 242, 64,
12, 24, 167, 131, 202, 240, 87, 1, 187, 52, 73, 243, 42,
197, 49, 9, 93, 47, 61, 80, 16, 64, 0, 124, 4, 0,
0, 0, 0, 0, 0, 0, 0], dtype=uint8),

My purpose is to compute entropy of each pcap files and now I'm wondering if I can use these pickle files for this purpose?

Any helps would be really appreciated.
Reply
#2
I should have divide this problem, so at first I think I should remove those words shown in the output >>> array and dtype = unint8? So I added the code below, in order to remove these words, but it doesn't work.

for word in pkl:
    if word == "array" or word == "dtype=uint8":
        pkl.remove(word)
print(pkl)
Reply
#3
(Dec-29-2019, 10:43 AM)baran01 Wrote: My purpose is to compute entropy of each pcap files and now I'm wondering if I can use these pickle files for this purpose?
Do you have a definition for pcap entropy that you can use?

(Dec-29-2019, 07:06 PM)baran01 Wrote: So I added the code below
Your original question seems to be about measuring entropy, and I'm not sure what the extra code has to do with that.

By the way, you should read the link in my signature. If you take it to heart, I imagine you'll be a much better prepared question-asker.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: cannot pickle ‘_asyncio.Future’ object Abdul_Rafey 1 373 Mar-07-2024, 03:40 PM
Last Post: deanhystad
  Python entropy calculation 12miki12 1 564 Dec-26-2023, 07:59 AM
Last Post: Gribouillis
  Computing GC Content uwl 3 941 Jun-26-2023, 09:37 PM
Last Post: Pedroski55
  pickle problem DPaul 13 4,740 Sep-27-2022, 05:25 PM
Last Post: DPaul
  TypeError: cannot pickle n00sferatu 1 2,647 Dec-14-2021, 03:52 PM
Last Post: yakkaligiri
  Multiprocessing Can't pickle local object law 1 15,969 Aug-30-2021, 02:49 PM
Last Post: law
  Save/Loading using pickle Scordomaniac 4 3,029 Nov-24-2020, 06:11 PM
Last Post: Scordomaniac
  Matlab to Python -- Parallel Computing zistambo 1 1,959 Jun-10-2020, 04:59 PM
Last Post: pyzyx3qwerty
  Computing correlation in audio files ryanblumenow 0 2,761 Jan-15-2020, 06:11 PM
Last Post: ryanblumenow
  Tkinter don't get ver from file via pickle storzo 2 2,559 Jul-31-2019, 03:50 PM
Last Post: storzo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020