2

I have an file which has been encrypted by Zed!. This is identified by

file --mime-type test.zed

as "application/CDFV2-encrypted"

However, when using python and the module filemagic:

with magic.Magic(flags=magic.MAGIC_MIME_TYPE) as m:
mime = m.id_buffer(file)

the exact same file is identified as: "application/cdfv2"

They both use libmagic, so I was sure that I would get the same type in both cases. However, according to this; the file command searches for

a user stream in the CDF file called "EncryptedPackage"

which apparently gives the suffix "-encrypted".

Now for my questions:

  • How does one define "user stream"?
  • Can I perform the check by examining the binary file in python?
  • Is there any other python module which can provide information regarding if the file is encrypted or not?

I am using filemagic 1.6 and libmagic 5.22

Niklas Lindskog
  • 138
  • 1
  • 7

0 Answers0