

{"id":13769,"date":"2018-04-18T05:24:08","date_gmt":"2018-04-17T23:54:08","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=13769"},"modified":"2026-04-25T12:02:44","modified_gmt":"2026-04-25T06:32:44","slug":"python-forensics","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-forensics\/","title":{"rendered":"Python Forensics | Hash Function, Virtualization &amp; much more"},"content":{"rendered":"<p>In this tutorial on Python Forensics, we will learn Naming Conventions, Hash Functions, Cracking an Encryption, Virtualization, Network Forensics, Dshell and Scapy, Searching, Indexing, Python Imaging Library, and Mobile Forensics with a detailed explanation.<\/p>\n<p>If you\u2019re new to Python, however, you should begin today with A<strong> <a href=\"https:\/\/data-flair.training\/blogs\/python-tutorial\/\">Python Introduction<\/a>, <\/strong>and then if you face any queries on <strong>Python Forensics<\/strong>, please comment. So, let\u2019s begin with Python Forensics.<\/p>\n<h3>Introduction to Computational Forensics<\/h3>\n<p>A quantitative approach to the methodology of the forensic sciences, Computational Forensics(CF), helps study and solve problems in various forensic disciplines. This is using computer-based modeling, computer simulation, analysis, and recognition.<\/p>\n<p>Based on pattern evidence, such as toolmarks, fingerprints, shoeprints, and documents, it makes use of a gamut of objects, processes, and substances. It also involves physiological and behavioral patterns, DNA, digital evidence, and crime scenes.<\/p>\n<p>We can make use of algorithms dealing with signal and image processing, computer vision, computer graphics, data mining, data visualization, statistical pattern recognition, machine learning, and robotics.<\/p>\n<p>But how is this different from computer forensics? While computer forensics studies digital evidence, computational forensics deals with various types of evidence.<\/p>\n<h3>Naming Conventions for a Basic Python Forensics Application<\/h3>\n<p>Digital forensics pros love Python for parsing disk images, memory dumps, and network packets. Libraries like pytsk3 read NTFS or ext4, while scapy reconstructs packets for timeline analysis. Scripts can hash files (hashlib.sha256) to check integrity, carve lost pictures, or automate simple incident-response playbooks\u2014speeding investigations that once took days.<\/p>\n<p>In order to follow Python Forensics guidelines to build a basic application, we must follow certain naming conventions and patterns. Take a look at the following table:<\/p>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td><b>Naming Convention<\/b><\/td>\n<td><b>Example<\/b><\/td>\n<\/tr>\n<tr>\n<td>Constants<\/td>\n<td>Uppercase; words separated by underscores<\/td>\n<td>SPEED_LIMIT<\/td>\n<\/tr>\n<tr>\n<td>Local variable<\/td>\n<td>camelCase with optional underscores<\/td>\n<td>currentSpeed<\/td>\n<\/tr>\n<tr>\n<td>Global variable<\/td>\n<td>Prefix gl_with camelCase with optional underscores<\/td>\n<td>gl_maximumSpeed<\/td>\n<\/tr>\n<tr>\n<td>Function<\/td>\n<td>PascalCase with optional underscores; active voice<\/td>\n<td>ConvertToMilesPerHour(\u2026)<\/td>\n<\/tr>\n<tr>\n<td>Object<\/td>\n<td>Prefix ob_ with camelCase<\/td>\n<td>ob_mySpeedrecorder<\/td>\n<\/tr>\n<tr>\n<td>Module<\/td>\n<td>Prefix _ with camelCase<\/td>\n<td>_speedRecorder<\/td>\n<\/tr>\n<tr>\n<td>Class<\/td>\n<td>Prefix class_ with PascalCase; keep it brief<\/td>\n<td>class_SpeedSystem<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Consider a hashing algorithm to encrypt data. This is one-way and takes as input a stream of binary data. Now, considering real-life situations, this could be a password or a file, or even binary or other kinds of digital data. The algorithm takes this input and produces a message digest(md). These digests are unique, and no two inputs will generate the same. Take a demo:<\/p>\n<pre class=\"EnlighterJSRAW\">import sys,string,md5\r\nprint(\"Enter full name\")\r\nline=sys.stdin.readline()\r\nline=line.rstrip()\r\nmd5_object=md5.new()\r\nmd5_object.update(line)\r\nprint(md5_object.hexdigest())\r\nexit<\/pre>\n<p>This program makes use of the md5 hashing algorithm. It takes your full name, encrypts it, and secures it. Next in the Python Forensics tutorial, we introduce you to the concept of Hash Functions.<\/p>\n<h3>Python Hash Functions<\/h3>\n<p>A hash<strong><a href=\"https:\/\/data-flair.training\/blogs\/python-function\/\">\u00a0<\/a><\/strong><span style=\"margin: 0px;padding: 0px\"><a href=\"https:\/\/data-flair.training\/blogs\/python-function\/\" target=\"_blank\" rel=\"noopener\"><strong>function<\/strong><\/a> in Python maps<\/span> a large amount of data to a fixed value of a specified length. An input always delivers the same output. This is a hash sum, and it holds a characteristic with specific information.<\/p>\n<p>Since it is practically impossible to reverse a hash function, you\u2019ll rarely find a third-party attack (like brute-force) on it. This is why we also call it a one-way cryptographic algorithm.<\/p>\n<p>Let&#8217;s take a look at this code:<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; import uuid\r\n&gt;&gt;&gt; import hashlib\r\n&gt;&gt;&gt; def hash_password(password):\r\n    salt = uuid.uuid4().hex\r\n    return hashlib.sha256(salt.encode() + password.encode()).hexdigest() + ':' + salt\r\n&gt;&gt;&gt; def check_password(hashed_password, user_password):\r\n    password, salt = hashed_password.split(':')\r\n    return password == hashlib.sha256(salt.encode() + user_password.encode()).hexdigest()\r\n&gt;&gt;&gt; new_pass = input('Enter required password ')<\/pre>\n<p>Please enter required password ayushi<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; hashed_password = hash_password(new_pass)\r\n&gt;&gt;&gt; print('The string to store in the db is: ' + hashed_password)<\/pre>\n<p>The string to store in the db is: b1076bdba4cd3f71b927a7d43b8c0c6b767cf0b310c2371a192572f7f671f271:17de37c5292f4bbc88e74acca7cdefb2<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; old_pass = input('Enter new password ')<\/pre>\n<p>Re-enter new password ayu$hi<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; if check_password(hashed_password, old_pass):\r\n    print(\u2018You entered the correct password\u2019)\r\nelse:\r\n    print(\u2018Passwords do not match\u2019)<\/pre>\n<p>Passwords do not match<br \/>\nThis is the flowchart for this code:<\/p>\n<div id=\"attachment_13789\" style=\"width: 475px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/hash-function.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13789\" class=\"wp-image-13789 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/hash-function.jpg\" alt=\"Python Forensics - Hash Function\" width=\"465\" height=\"506\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/hash-function.jpg 465w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/hash-function-138x150.jpg 138w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/hash-function-276x300.jpg 276w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><p id=\"caption-attachment-13789\" class=\"wp-caption-text\">Python Forensics &#8211; Hash Function<\/p><\/div>\n<p><strong>In the ideal cryptographic hash function:<\/strong><\/p>\n<ul>\n<li>We can easily compute the hash value for any given input<\/li>\n<li>It is infeasible to generate the original input from a given hash value<\/li>\n<li>It is infeasible to modify the input without changing the hash value<\/li>\n<li>It is infeasible to find two different inputs with the same hash value<\/li>\n<\/ul>\n<p><strong>Read: <a href=\"https:\/\/data-flair.training\/blogs\/python-function\/\">Functions in Python Programming Language<\/a><\/strong><\/p>\n<h3>How to Crack an Encryption in Python?<\/h3>\n<p>We must crack the text data we fetch during analysis and evidence. Let\u2019s discuss some basic cryptographic terminology before that.<\/p>\n<p>Plain text is the original message in a human-readable format. Ciphertext is what an encryption algorithm turns plaintext into. Consider the Caesar cipher by Julius Caesar to save the secret text from his enemies. Here, we take each letter in the plain text and shift it three places in the alphabet. It will turn each A into a D, each B into an E, and so on.<\/p>\n<div id=\"attachment_13790\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/casear1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13790\" class=\"wp-image-13790 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/casear1.jpg\" alt=\"Python Forensics - Cracking an Encryption\" width=\"800\" height=\"419\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/casear1.jpg 800w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/casear1-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/casear1-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/casear1-768x402.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><p id=\"caption-attachment-13790\" class=\"wp-caption-text\">Python Forensics &#8211; Cracking an Encryption<\/p><\/div>\n<p><strong>The kinds of pattern evidence we use are:<\/strong><\/p>\n<ul>\n<li>Tire Tracks and Marks<\/li>\n<li>Impressions<\/li>\n<li>Fingerprints<\/li>\n<\/ul>\n<p>We crack the vector data in such biometric data to collect fool-proof evidence. Let\u2019s take an example.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; import sys\r\n&gt;&gt;&gt; def decrypt(k,cipher):\r\n    plaintext=''\r\n    for each in cipher:\r\n        p = (ord(each)-k) % 126\r\n        if p &lt; 32:\r\n            p+=95\r\n            plaintext += chr(p)\r\n            print(plaintext)\r\n&gt;&gt;&gt; cipher = input('Enter message: ')<\/pre>\n<p>Enter message: Ayushi<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; for i in range(1,95,1):\r\n    decrypt(i,cipher)<\/pre>\n<p>~<\/p>\n<p>}<\/p>\n<p>|<\/p>\n<p>{<\/p>\n<p>z<\/p>\n<p>y<\/p>\n<p>x<\/p>\n<p>w<\/p>\n<p>v<\/p>\n<p>u<\/p>\n<p>t<\/p>\n<p>s<\/p>\n<p>r<\/p>\n<p>q<\/p>\n<p>p<\/p>\n<p>o<\/p>\n<p>n<\/p>\n<p>m<\/p>\n<p>l<\/p>\n<p>k<\/p>\n<p>j<\/p>\n<p>i<\/p>\n<p>h<\/p>\n<p>g<\/p>\n<p>f<\/p>\n<p>e<\/p>\n<p>d<\/p>\n<p>c<\/p>\n<p>b<\/p>\n<p>a<\/p>\n<p>`<\/p>\n<p>_<\/p>\n<p>~<\/p>\n<p>}<\/p>\n<p>}~<\/p>\n<p>|<\/p>\n<p>|}<\/p>\n<p>{<\/p>\n<p>{|<\/p>\n<p>z<\/p>\n<p>z{<\/p>\n<p>y<\/p>\n<p>yz<\/p>\n<p>x<\/p>\n<p>xy<\/p>\n<p>w<\/p>\n<p>wx<\/p>\n<p>v<\/p>\n<p>vw<\/p>\n<p>u<\/p>\n<p>uv<\/p>\n<p>t<\/p>\n<p>tu<\/p>\n<p>~<\/p>\n<p>~s<\/p>\n<p>~st<\/p>\n<p>}<\/p>\n<p>}r<\/p>\n<p>}rs<\/p>\n<p>~<\/p>\n<p>~|<\/p>\n<p>~|q<\/p>\n<p>~|qr<\/p>\n<p>}<\/p>\n<p>}{<\/p>\n<p>}{p<\/p>\n<p>}{pq<\/p>\n<p>|<\/p>\n<p>|z<\/p>\n<p>|zo<\/p>\n<p>|zop<\/p>\n<p>{<\/p>\n<p>{y<\/p>\n<p>{yn<\/p>\n<p>{yno<\/p>\n<p>~<\/p>\n<p>~z<\/p>\n<p>~zx<\/p>\n<p>~zxm<\/p>\n<p>~zxmn<\/p>\n<p>}<\/p>\n<p>}y<\/p>\n<p>}yw<\/p>\n<p>}ywl<\/p>\n<p>}ywlm<\/p>\n<p>|<\/p>\n<p>|x<\/p>\n<p>|xv<\/p>\n<p>|xvk<\/p>\n<p>|xvkl<\/p>\n<p>{<\/p>\n<p>{w<\/p>\n<p>{wu<\/p>\n<p>{wuj<\/p>\n<p>{wujk<\/p>\n<p>z<\/p>\n<p>zv<\/p>\n<p>zvt<\/p>\n<p>zvti<\/p>\n<p>zvtij<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt;<\/pre>\n<p><strong>Read: <a href=\"https:\/\/data-flair.training\/blogs\/python-packages\/\">Packages in Python<\/a><\/strong><\/p>\n<h3>Virtualization in Python<\/h3>\n<p>When we emulate IT systems like servers, workstations, networks, and storage, it is an act of virtualization. It is creating a virtual instance of such a resource. The hypervisor helps emulate such virtual hardware.<\/p>\n<div id=\"attachment_13792\" style=\"width: 606px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/virtualization-types-2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13792\" class=\"wp-image-13792 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/virtualization-types-2.jpg\" alt=\"Python Forensics - Virtualization\" width=\"596\" height=\"265\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/virtualization-types-2.jpg 596w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/virtualization-types-2-150x67.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/virtualization-types-2-300x133.jpg 300w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><\/a><p id=\"caption-attachment-13792\" class=\"wp-caption-text\">Python Forensics &#8211; Virtualization<\/p><\/div>\n<p>So what do we use it for in computational forensics? Here\u2019s where we use it:<\/p>\n<p>1. For each investigation, we can use the workstation in a validated state.<\/p>\n<p>2. Attaching the dd image of a drive as a secondary drive on a virtual machine, we can recover data.<\/p>\n<p>3. We can also use the machine as a recovery software to gather evidence.<\/p>\n<p>This is how we can create a virtual machine using Python:<\/p>\n<p><b>Step 1: <\/b>Let\u2019s call our machine \u2018dummy\u2019. Each VM shall have at least 512 MB of memory, expressed in bytes.<\/p>\n<pre class=\"EnlighterJSRAW\">vm_memory = 512 * 1024 * 1024<\/pre>\n<p><b>Step 2: <\/b>Attach this VM to the default cluster.<\/p>\n<pre class=\"EnlighterJSRAW\">vm_cluster = api.clusters.get(name = \"Default\")<\/pre>\n<p><b>Step 3: <\/b>Boot the VM from the virtual HDD.<\/p>\n<pre class=\"EnlighterJSRAW\">vm_os = params.OperatingSystem(boot = [params.Boot(dev = \"hd\")])<\/pre>\n<p>We then combine all options into a VM parameter object. Finally, we call the add method of the vms collection to the VM.<\/p>\n<p>Let\u2019s take an example.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">from ovirtsdk.api import API #importing API library\r\nfrom ovirtsdk.xml import params\r\n\r\ntry: #Api credentials is required for virtual machine\r\n   api = API(url = \"https:\/\/HOST\", \r\n      username = \"Ayushi\", \r\n      password = \"abc123\", \r\n      ca_file = \"ca.crt\")\r\n      \r\n   vm_name = \"dummy\"\r\n   vm_memory = 512 * 1024 * 1024 #calculating the memory in bytes\r\n   vm_cluster = api.clusters.get(name = \"Default\")\r\n   vm_template = api.templates.get(name = \"Blank\")\r\n   \r\n   #assigning the parameters to operating system\r\n   vm_os = params.OperatingSystem(boot = [params.Boot(dev = \"hd\")])\r\n   \r\n   vm_params = params.VM(name = vm_name,\r\n      memory = vm_memory,\r\n      cluster = vm_cluster,\r\n      template = vm_template\r\n      os = vm_os)\r\n\r\n   try: \r\n      api.vms.add(vm = vm_params) \r\n      print(\"Virtual machine '%s' added.\" % vm_name #output if it is successful) \r\n   except Exception as ex: \r\n      print(\"Adding virtual machine '%s' failed: %s\" % (vm_name, ex))\r\n      api.disconnect()\r\n      \r\nexcept Exception as ex:<\/pre>\n<p>The output:<br \/>\nVirtual machine \u2018dummy\u2019 added<\/p>\n<h3>Network Forensics in Python<\/h3>\n<p>In modern Python Forensics network environments, investigating can face several difficulties. Imagine responding to a breach support, investigating insider activities, validating regulatory compliance, or performing assessments pertaining to vulnerability. Let\u2019s discuss some basic terminology for network programming.<\/p>\n<div id=\"attachment_13793\" style=\"width: 923px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/network_programming.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13793\" class=\"wp-image-13793 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/network_programming.jpg\" alt=\"Python Forensics - Network Forensics\" width=\"913\" height=\"432\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/network_programming.jpg 913w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/network_programming-150x71.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/network_programming-300x142.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/network_programming-768x363.jpg 768w\" sizes=\"auto, (max-width: 913px) 100vw, 913px\" \/><\/a><p id=\"caption-attachment-13793\" class=\"wp-caption-text\">Python Forensics &#8211; Network Forensics<\/p><\/div>\n<p><strong>1. Client:<\/strong> The part of the client-server architecture that runs on a personal computer or workstation.<\/p>\n<p><strong>2. Server:<\/strong> The part of the client-server architecture that provides services to different computer programs in the same or other computers.<\/p>\n<p><strong>3. WebSockets:<\/strong> A protocol between the client and the server that runs over a persistent TCP connection. Using this, it is possible to send bi-directional messages between the TCP socket connections.<\/p>\n<p>Using these protocols, we can validate information sent to or received by third-party users. But we must also secure the channel since we use encryption.<\/p>\n<p>Let\u2019s take a look at a program that a client uses for handshaking:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; import socket\r\n# create a socket object\r\n&gt;&gt;&gt; s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\r\n# get local machine name\r\n&gt;&gt;&gt; host = socket.gethostname()\r\n&gt;&gt;&gt; port = 8080\r\n# connection to hostname on the port.\r\n&gt;&gt;&gt; s.connect((host, port))\r\n# Receive no more than 1024 bytes\r\n&gt;&gt;&gt; tm = s.recv(1024)\r\n&gt;&gt;&gt; print(\"The client waits for connection\")\r\n&gt;&gt;&gt; s.close()<\/pre>\n<p>Output:<br \/>\nThe client waits for connection<br \/>\nBefore moving forward with the Python Forensics tutorial, you should read up on Python Modules.<\/p>\n<h3>Python Scapy &amp; Dshell<\/h3>\n<h4>a. Python Dshell<\/h4>\n<p>This is a network forensic analysis toolkit based on Python. The US Army Research Laboratory developed it and released it as open source in 2014. This toolkit makes forensic investigation easy. We have the following decoders in Dshell:<\/p>\n<p><strong>1. dns:<\/strong> Extract DNS-related queries<\/p>\n<p><strong>2. reservedips:<\/strong> Identify solutions for DNS problems<\/p>\n<p><strong>3. large-flows:<\/strong> List netflows<\/p>\n<p><strong>4. rip-http:<\/strong> Extract files from HTTP traffic<\/p>\n<p><strong>5. Protocols:<\/strong> Identify non-standard protocols<\/p>\n<p><strong>You can access the clone repository on GitHub:<\/strong><\/p>\n<p><a href=\"https:\/\/github.com\/USArmyResearchLab\/Dshell\">https:\/\/github.com\/USArmyResearchLab\/Dshell<\/a><\/p>\n<h4>b. Python Scapy<\/h4>\n<p>A Python-based tool to analyze and manipulate network traffic, you can find Scapy here:<\/p>\n<p>http:\/\/www.secdev.org\/projects\/scapy\/<\/p>\n<p>With Scapy, you can analyze packet manipulation. You can also decode and capture packets of a wide range of protocols. Unlike Dshell, it provides a detailed report about network traffic to the investigator. It can also use third-party tools or OS fingerprinting to plot.<\/p>\n<pre class=\"EnlighterJSRAW\">import scapy, GeoIP #Imports scapy and GeoIP toolkit\r\nfrom scapy import *\r\ngeoIp = GeoIP.new(GeoIP.GEOIP_MEMORY_CACHE) #locates the Geo IP address\r\n      def locatePackage(pkg):\r\n      src = pkg.getlayer(IP).src #gets source IP address\r\n      dst = pkg.getlayer(IP).dst #gets destination IP address\r\n      srcCountry = geoIp.country_code_by_addr(src) #gets Country details of source\r\n      dstCountry = geoIp.country_code_by_addr(dst) #gets country details of destination\r\n      print src+\"(\"+srcCountry+\") &gt;&gt; \"+dst+\"(\"+dstCountry+\")\\n\"<\/pre>\n<p>Output:<br \/>\nD:\\Python code&gt;python dshell.py<br \/>\nsrc INDIA &gt;&gt; dst USA<\/p>\n<h3>Python Forensics &#8211; Searching<\/h3>\n<p>With a keyword from the message, we can search for evidence. And with some expertise and knowledge, we know what to search in a file, and also what to search in deleted files.<\/p>\n<p>However, Python helps us with this with its standard <strong><a href=\"https:\/\/data-flair.training\/blogs\/python-library\/\">library<\/a> <a href=\"https:\/\/data-flair.training\/blogs\/python-modules\/\">modules<\/a>. <\/strong>With searching, we can find answers to questions like \u2018who\u2019, \u2018what\u2019, \u2018where\u2019, and \u2018when\u2019.<\/p>\n<p><strong>Key concepts of Searching in Python Forensics:<\/strong><\/p>\n<ul>\n<li><strong>Searching Keywords:<\/strong> It goes through thousands of files at a time to find a specific name or an unknown line.<\/li>\n<li><strong>Finding Patterns:<\/strong> Instead of searching for a specific word, you search by the type of data, like a number or an email ID.<\/li>\n<li><strong>Indexing:<\/strong> It helps in sorting all the data together, which makes it easier to find it later, anytime.<\/li>\n<li><strong>Digital fingerprints:<\/strong> A special code is used to make sure that the evidence is not changed or touched by anyone else.<\/li>\n<\/ul>\n<p>Let\u2019s take a Python example to find a substring.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; s1=\"He came by for blood and milk\"\r\n&gt;&gt;&gt; s2=\"blood\"\r\n&gt;&gt;&gt; s1.find(s2)<\/pre>\n<p>15<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; s1.find(s2,10)<\/pre>\n<p>15<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; s1.find(s2,20)<\/pre>\n<p>-1<\/p>\n<h3>Python Forensics &#8211; Indexing<\/h3>\n<p>In Python Forensics, with indexing, we can gather potential evidence from a file, a disk image, a network trace, or a memory snapshot.<\/p>\n<p><strong>Purpose of using indexing in Python Forensics:<\/strong><\/p>\n<ul>\n<li><strong>Speed:<\/strong> It reduces time by making a readymade index, which makes it easy to scan the data.<\/li>\n<li><strong>Organisation:<\/strong> It collects and organises everything, like files, emails, and hidden data, all in a single place.<\/li>\n<li><strong>Patterns:<\/strong> It makes it easy for you to understand how quickly words like password and bank are being used.<\/li>\n<\/ul>\n<p>Through indexing, we can search for a keyword and carry out interactive searching using the index to rapidly locate keywords. We can also use it to list keywords in a sorted list.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; groceries=['rope','milk','knife']\r\n&gt;&gt;&gt; groceries.index('knife')<\/pre>\n<p>2<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; groceries.index('rope')<\/pre>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; s1.index(s2)<\/pre>\n<p>15<\/p>\n<h3>Python Imaging Library<\/h3>\n<p>Both simple data structures, like databases, and complex ones, like JPEG images, hold data. We can access the simple ones using simple desktop tools, and the complex ones using sophisticated programming tools.<\/p>\n<p>With the PIL, we can process images using the Python interpreter. It supports a gamut of file formats; download the source files from:<\/p>\n<p>http:\/\/www.pythonware.com\/products\/pil\/<\/p>\n<p><strong>This is how we extract data from images:<\/strong><\/p>\n<div id=\"attachment_13794\" style=\"width: 189px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/python_imaging_library.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13794\" class=\"wp-image-13794 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/python_imaging_library.jpg\" alt=\"Python Forensics - Imaging Library\" width=\"179\" height=\"617\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/python_imaging_library.jpg 179w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/python_imaging_library-87x300.jpg 87w\" sizes=\"auto, (max-width: 179px) 100vw, 179px\" \/><\/a><p id=\"caption-attachment-13794\" class=\"wp-caption-text\">Python Forensics &#8211; Imaging Library<\/p><\/div>\n<p>Let\u2019s demonstrate this on an image of penguins.<\/p>\n<div id=\"attachment_13795\" style=\"width: 302px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/penguins.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13795\" class=\"wp-image-13795 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/penguins.jpg\" alt=\"Python Forensics - Penguin Demonstration\" width=\"292\" height=\"222\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/penguins.jpg 292w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/penguins-150x114.jpg 150w\" sizes=\"auto, (max-width: 292px) 100vw, 292px\" \/><\/a><p id=\"caption-attachment-13795\" class=\"wp-caption-text\">Python Forensics &#8211; Penguin Demonstration<\/p><\/div>\n<p>Use PIL to open this image:<br \/>\nfrom PIL import Image<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; im = Image.open('Capture.jpeg', 'r')\r\n&gt;&gt;&gt; pix_val = list(im.getdata())\r\n&gt;&gt;&gt; pix_val_flat = [x for sets in pix_val for x in sets]\r\n&gt;&gt;&gt; print pix_val_flat<\/pre>\n<p>This notes necessary points, including pixel values.<\/p>\n<p><strong>Output:<\/strong><\/p>\n<p>[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]<\/p>\n<h3>Mobile Forensics in Python<\/h3>\n<p>Although considered non-standard in digital investigations, we can make use of smartphones to ease our process.<br \/>\nThrough proper investigation in Python Forensics, we may search for received calls or calls made. We can also extract messages, photos, and other evidence. Let\u2019s see how to get through a lockscreen to extract data.<\/p>\n<p>In Android, we can use a PIN or an alphanumeric password. This can be between 4 and 16 digits\/characters. The smartphone stores this inside a file password.key in \/data\/system. Android stores a salted SHA1-hashsum and MD5-hashsum of this password. Let\u2019s try processing this.<\/p>\n<pre class=\"EnlighterJSRAW\">&gt;&gt;&gt; public byte[] passwordToHash(String password) {\r\n  if (password == null) {\r\n     return null;\r\n  }\r\n  String algo = null;\r\n  byte[] hashed = null;\r\n  try {\r\n     byte[] saltedPassword = (password + getSalt()).getBytes();\r\n     byte[] sha1 = MessageDigest.getInstance(algo = \"SHA-1\").digest(saltedPassword);\r\n     byte[] md5 = MessageDigest.getInstance(algo = \"MD5\").digest(saltedPassword);\r\n     hashed = (toHex(sha1) + toHex(md5)).getBytes();\r\n  } catch (NoSuchAlgorithmException e) {\r\n     Log.w(TAG, \"Failed to encode string because of missing algorithm: \" + algo);\r\n  }\r\n  return hashed;\r\n}<\/pre>\n<p>We can\u2019t crack this using a dictionary attack, since the hashed password is in a salt file. This is a string of a 64-bit random integer represented hexadecimally. This is all about Python Forensics.<\/p>\n<h3>Conclusion<\/h3>\n<p>In result, it only comes with practice, so don\u2019t forget to sharpen your blades. An investigation is only as good as an investigator. Let us know of any queries in the comments on this article on Python Forensics.<\/p>\n<p><a href=\"https:\/\/www.python.org\/\"><strong>For reference<\/strong><\/a><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1976,&quot;href&quot;:&quot;https:\\\/\\\/github.com\\\/USArmyResearchLab\\\/Dshell&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250907100911\\\/https:\\\/\\\/github.com\\\/USArmyResearchLab\\\/Dshell&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-10 14:47:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-15 05:45:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-21 19:03:59&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-31 18:23:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-05 21:34:58&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-12 14:32:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-19 12:23:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-04 08:33:53&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-22 04:49:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-11 17:39:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-25 03:54:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-30 08:04:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-07 17:41:08&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-05-07 17:41:08&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:149,&quot;href&quot;:&quot;https:\\\/\\\/www.python.org&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251206090101\\\/https:\\\/\\\/www.python.org\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-06 12:20:59&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-09 12:44:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-12 13:49:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-15 14:13:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-18 15:26:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-21 17:05:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-24 19:33:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-28 02:44:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-31 04:43:13&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-03 07:01:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-06 07:15:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-09 07:16:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-12 10:01:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-15 10:07:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-18 10:11:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-21 10:20:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-24 10:47:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-27 10:58:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-30 10:59:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-02 12:28:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-05 13:05:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-08 15:11:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-11 15:46:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-14 17:21:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-17 18:37:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 18:52:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-23 19:52:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 01:02:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-02 03:50:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-05 05:18:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-08 06:18:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-11 07:24:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-14 08:33:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-17 08:58:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-20 12:26:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-23 14:32:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-26 16:21:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-29 17:22:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-01 18:18:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-04 18:27:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-08 02:33:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-11 04:53:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-14 06:48:30&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-17 07:17:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-20 07:32:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-23 09:34:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-26 10:13:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-29 10:35:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-02 11:50:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-05 12:07:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-08 13:08:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-11 14:46:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-14 21:24:09&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-05-18 03:08:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-21 06:27:39&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-24 07:06:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-27 07:30:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-30 08:47:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-02 09:37:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-05 09:43:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-08 10:40:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-11 10:49:02&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-14 16:29:16&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-14 16:29:16&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial on Python Forensics, we will learn Naming Conventions, Hash Functions, Cracking an Encryption, Virtualization, Network Forensics, Dshell and Scapy, Searching, Indexing, Python Imaging Library, and Mobile Forensics with a detailed explanation.&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":13784,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[2842,3038,4084,5368,6683,8762,9048,10546,10591,12672,15392],"class_list":["post-13769","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-computational-forensics","tag-cracking-an-encryption","tag-dshell-and-scapy","tag-hash-functions","tag-indexing","tag-mobile-forensics","tag-network-forensics","tag-python-forensics","tag-python-imaging-library","tag-searching","tag-virtualization"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Forensics | Hash Function, Virtualization &amp; much more - DataFlair<\/title>\n<meta name=\"description\" content=\"Python Forensics: Learn Naming Conventions, Hash Functions, Cracking an Encryption, Virtualization, Network Forensics, Dshell and Scapy, Python Imaging Library etc\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/python-forensics\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Forensics | Hash Function, Virtualization &amp; much more - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Python Forensics: Learn Naming Conventions, Hash Functions, Cracking an Encryption, Virtualization, Network Forensics, Dshell and Scapy, Python Imaging Library etc\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-forensics\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-17T23:54:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-25T06:32:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Python-Forensics-01.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Forensics | Hash Function, Virtualization &amp; much more - DataFlair","description":"Python Forensics: Learn Naming Conventions, Hash Functions, Cracking an Encryption, Virtualization, Network Forensics, Dshell and Scapy, Python Imaging Library etc","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/python-forensics\/","og_locale":"en_US","og_type":"article","og_title":"Python Forensics | Hash Function, Virtualization &amp; much more - DataFlair","og_description":"Python Forensics: Learn Naming Conventions, Hash Functions, Cracking an Encryption, Virtualization, Network Forensics, Dshell and Scapy, Python Imaging Library etc","og_url":"https:\/\/data-flair.training\/blogs\/python-forensics\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-04-17T23:54:08+00:00","article_modified_time":"2026-04-25T06:32:44+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Python-Forensics-01.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-forensics\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-forensics\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Python Forensics | Hash Function, Virtualization &amp; much more","datePublished":"2018-04-17T23:54:08+00:00","dateModified":"2026-04-25T06:32:44+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-forensics\/"},"wordCount":1984,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-forensics\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Python-Forensics-01.jpg","keywords":["Computational Forensics","Cracking an Encryption","Dshell and Scapy","Hash Functions","Indexing","Mobile Forensics","Network Forensics","Python Forensics","Python Imaging Library","Searching","Virtualization"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-forensics\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-forensics\/","url":"https:\/\/data-flair.training\/blogs\/python-forensics\/","name":"Python Forensics | Hash Function, Virtualization &amp; much more - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-forensics\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-forensics\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Python-Forensics-01.jpg","datePublished":"2018-04-17T23:54:08+00:00","dateModified":"2026-04-25T06:32:44+00:00","description":"Python Forensics: Learn Naming Conventions, Hash Functions, Cracking an Encryption, Virtualization, Network Forensics, Dshell and Scapy, Python Imaging Library etc","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-forensics\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-forensics\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/python-forensics\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Python-Forensics-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/04\/Python-Forensics-01.jpg","width":1200,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-forensics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python\/"},{"@type":"ListItem","position":3,"name":"Python Forensics | Hash Function, Virtualization &amp; much more"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/13769","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=13769"}],"version-history":[{"count":10,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/13769\/revisions"}],"predecessor-version":[{"id":147879,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/13769\/revisions\/147879"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/13784"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=13769"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=13769"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=13769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}