Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2 (20): Malware Authors try to obfuscate their intentions when they write code. By doing so it makes analysis difficult and obfuscates the true
Problem 2 (20): Malware Authors try to obfuscate their intentions when they write code. By doing so it makes analysis difficult and obfuscates the true nature of the malware. They will often use strange algorithms. These algorithms often do not make sense or more importantly wastes the time of the analyst. The end result is often frustration for the analyst trying to uncover the intention of the program. For this challenge you will write a program that will read a user entered string. The string length should be a minimum of 12 and a maximum 20 characters not including the NULL terminator. Any printable character is allowed; including space. Requirements: No global variables are allowed. Create your C files in the Lab4 directory. . The program will have the following functions: 1. getString: a. Gets the user's security string. b. This function has no return value. 2. challenge: a. Prints a riddle if the user entered the correct security string. The process to create the security code from the security string is in the section on the convert function. b. This function has no return value and no parameters. 3. convert: a. Takes the user's security string and converts it to a number using the following algorithm: The algorithm to convert the string to a number will be as follows Value += character ascii value * (length of string - offset of character) Character Ordinal Offset in String Ordinal * (Len - Offset) 'H' 72 o 72 * (5-0) = 360 101 101 * (5-1 ) =404 108 IN 108 * (5-2) =324 108 108 * (5-3) =216 111 111 * (5-4) = 111 Sum: 360 + 404 + 324 + 216 + 111 = 1415 b. The function returns the calculated value associated with the security code. C. The security code should produce a value of 5183 If the code is 5183, the program should call challenge and print 1 of 3 riddles. The user will enter an answer to the riddle and get a randomly generated response. If the value is NOT 5183: The program should prompt the user, that there was an issue and reduce the total attempts count. 2. The total attempts count is max 5 3. After 5 incorrect attempts the program will terminate. The following examples show the program execution. Enter your code: Reacher Your code: [ Reacher ] has value: [ 2689 ] This code doesn't appear to be working! ! ! Enter your code: Hyp3rbol3! Your code: [ Hyp3rbol3! ] has value: [ 5139 ] This code doesn't appear to be working! ! ! Enter your code: Responsible3 Your code: [ Responsible3 ] has value: [ 8095 ] This code doesn't appear to be working! ! ! Enter your code: Vindicat3! Your code: [ Vindicat3! ] has value: [ 5201 ] This code doesn't appear to be working! ! ! Enter your code: Influ3nc3! Your code: [ Influ3nc3! ] has value: [ 5121 ] This code doesn't appear to be working! ! ! ! ! ! End of attempts ! ! ! garyit@garyit-VirtualBox: -/eclipse-workspace/Lab4_2/Releases aryit@garyit-VirtualBox : ~/eclipse-workspace/Lab4_2/Releases ./Lab4_2 Enter your code: Pr3v@13nt Your code: [ Pr3v@13nt ] has value: [ 3938 ] This code doesn't appear to be working! ! ! Enter your code: Vidicat3! Your code: [ Vidic@t3! ] has value: [ 3730 ] This code doesn't appear to be working! ! ! Enter your code: powerful weir Your code: [ powerful_weir ] has value: [ 9994 ] This code doesn't appear to be working! ! ! Enter your code: *AAkka Your code: [ * * ] has value: [ 5183 ] [RIDDLE] Why aren't football games shown on Thursdays?: I don't really know [AI Responsel It doesn't get any better than that does it .. jaryit@garyit-VirtualBox: Questions: 1. After analyzing the algorithm used to generate the number; would you consider this a good algorithm? When answering consider: a. Is it possible to use other input strings to get the same code? 2. Explain why you think this is a good or bad algorithm. Where good or bad is a reference to the complexity of the algorithm
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started