Question: 1 . Password cracking using multithreading ( 1 5 % - 1 0 0 marks ) - PThread In this task, you will be asked
Password cracking using multithreading marks PThread
In this task, you will be asked to use the crypt library to decrypt a password using multithreading. You will be provided with two programs. The first program called EncryptSHAc which allows you to encrypt a password. For this assessment, you will be required to decrypt a character password consisting of capital letters, and numbers. The format of the password should be LetterLetterNumberNumber For example, PK Once you have generated your password, this should then be entered into your program to decrypt the password. The method of input for the encrypted password is up to you. The second program is a skeleton code to crack the password in regular C without any multithreading syntax. Your task is to use multithreading to split the workload over many threads and find the password. Once the password has been found, the program should finish meaning not all combinations of letters and numbers should be explored unless its ZZ and the last thread happens to finish last.
Cracks a password using multithreading and dynamic slicing based on thread count marks
Program finishes appropriately when password has been found marks
Ive already generated the encrypted string for the password PK using EncryptSHAc and added it to the CrackAZc program.
The encrypted string is:
$$AS$zARikIkblIvWVGgdzSJALGKDoFQsiembpzzQJgbTgJqbiGuxOertUKQO.vlLmCsTMuLWi
The file I was given, EncryptSHAc
#include
#include
#include
#include
#include
#define SALT $$AS$
int mainint argc, char argv
printfs
cryptargv SALT;
return ;
and this one, CrackAZc
#include
#include
#include
#include
#include
int count; A counter used to track the number of combinations explored so far
Required by lack of standard function in C
void substrchar dest char src int start, int length
memcpydest src start, length;
dest length;
This function can crack the kind of password explained above. All combinations
that are tried are displayed and when the password is found, # is put at the
start of the line. Note that one of the most time consuming operations that
it performs is the output of intermediate results, so performance experiments
for this kind of program should not include this. ie comment out the printfs.
void crackchar saltandencrypted
int x y z; Loop counters
char salt; String used in hashing the password. Need space for incase you have modified the salt value, then should modifiy the number accordingly
char plain; The combination of letters currently being checked Please modifiy the number when you enlarge the encrypted password.
char enc; Pointer to the encrypted password
substrsalt saltandencrypted, ;
forxA; xZ; x
foryA; yZ; y
forz; z; z
sprintfplainccd x y z;
enc char cryptplain salt;
count;
ifstrcmpsaltandencrypted, enc
printf#ds s
count, plain, enc;
return; uncomment this line if you want to speedup the running time, program will find you the cracked password only without exploring all possibilites
else
printfds s
count, plain, enc; when the password is not found
int mainint argc, char argv
crack$$AS$zARikIkblIvWVGgdzSJALGKDoFQsiembpzzQJgbTgJqbiGuxOertUKQO.vlLmCsTMuLWi; Copy and Paste your ecrypted password here using EncryptShA program
printfd solutions explored
count;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
