Python Forensics – Implementation of Cloud Computing

Python Forensics – Cloud Computing Implementation

Cloud computing can be defined as a collection of hosted services provided to users over the internet. It enables enterprises to consume even computing resources, including virtual machines (VMs), storage, or applications as utilities.

One of the most important advantages of building applications with the Python programming language is the ability to deploy applications virtually on any platform, including cloud computing. This means Python can be executed on cloud servers or launched on convenient devices such as desktops, tablets, or smartphones.

One interesting aspect is creating a cloud base for generating rainbow tables. This facilitates the integration of single-processor and multi-processor versions of applications, which requires some consideration.

Pi Cloud

Pi Cloud is a cloud computing platform that combines the Python programming language with the computing power of Amazon Web Services.

Python Forensics - Cloud Computing Implementation

Let’s take a look at an example of implementing Pi Cloud using a rainbow table.

Rainbow Tables

A rainbow table is defined as a list of all possible plain text permutations of an encrypted password for a specific hashing algorithm.

  • A rainbow table follows a standard pattern, creating a list of hashed passwords.
  • A text file is used to generate passwords, which contains the characters or plain text of the password to be encrypted.

  • This file is used by Pi Cloud, which calls the main function for storage.

  • The output of the hashed passwords is also stored in a text file.

This algorithm can also be used to store passwords in a database and back them up in a cloud system.

The following built-in program creates an encrypted password list in a text file.

Example

import os
import random
import hashlib
import string
import enchant #Rainbow tables with enchant
import cloud #importing pi-cloud

def randomword(length):
   return ''.join(random.choice(string.lowercase) for i in range(length))

print('Author- Radhika Subramanian')

def mainroutine():
   engdict = enchant.Dict("en_US")
   fileb = open("password.txt","a+")

   # Capture the values from the text file named password
   while True:
      randomword0 = randomword(6)
      if engdict.check(randomword0) == True:
         randomkey0 = randomword0+str(random.randint(0,99))
      elif engdict.check(randomword0) == False:
         englist = engdict.suggest(randomword0)
         if len(englist) > 0:
            randomkey0 = englist[0]+str(random.randint(0,99))
         else:
            randomkey0 = randomword0+str(random.randint(0,99))

      randomword3 = randomword(5)
      if engdict.check(randomword3) == True:
         randomkey3 = randomword3+str(random.randint(0,99))
      elif engdict.check(randomword3) == False:
         englist = engdict.suggest(randomword3)
         if len(englist) > 0:
            randomkey3 = englist[0]+str(random.randint(0,99))
         else:
            randomkey3 = randomword3+str(random.randint(0,99))

      if 'randomkey0' and 'randomkey3' and 'randomkey1' in locals():
         whasher0 = hashlib.new("md5")
         whasher0.update(randomkey0)
         whasher3 = hashlib.new("md5")
         whasher3.update(randomkey3)
         whasher1 = hashlib.new("md5")
         whasher1.update(randomkey1)
         print(randomkey0+" + "+str(whasher0.hexdigest())+"n")
         print(randomkey3+" + "+str(whasher3.hexdigest())+"n")
         print(randomkey1+" + "+str(whasher1.hexdigest())+"n")
         fileb.write(randomkey0+" + "+str(whasher0.hexdigest())+"n")
fileb.write(randomkey3+" + "+str(whasher3.hexdigest())+"n")
fileb.write(randomkey1+" + "+str(whasher1.hexdigest())+"n")

jid = cloud.call(randomword) #square(3) evaluated on PiCloud
cloud.result(jid)
print('Value added to cloud')
print('Password added')
mainroutine()

Output

This code will produce the following output –

Python Forensics - Cloud Computing Implementation

The password is stored in a text file, which is visible in the screenshot below.

Python Forensics - Cloud Computing Implementation

Leave a Reply

Your email address will not be published. Required fields are marked *