This article mainly introduces how to obtain the ssdeep value of a file using Python. it is a practical technique. This article describes in detail the specific steps and precautions for implementing this function, for more information about how to obtain the ssdeep value of a file in Python, see the following example. The specific method is as follows:
First, to obtain the ssdeep value, you must first import ssdeep
An error occurred while installing pyssdeep on ubuntu. later, we found that the apt-cache search "ssdeep" had several full apt-get install, but the problem remained.
Then download to the pyssdeep source file, tar zxvf pyssdeep.tar.zip, apt-get install python-dev, and then python setup. py install.
In general, it should be because python-dev is not installed.
The code is as follows:
Def _ get_ssdeep (self, file_path): "Generates the ssdeep fuzzy hash of the file. @ return: ssdeep fuzzy hash of the file "if not IS_SSDEEP: return None try: return ssdeep. ssdeep (). hash_file (file_path) handle T: return None
I hope this article will help you with Python programming.