Question

I need a c++ program for my class project. The topic for the c++ program is...

I need a c++ program for my class project.

The topic for the c++ program is On Cyber Security password cracking. please keep it easy and simple. So the professor doesn't doubt on me.

Advanced Thank you for your help.

Homework Answers

Answer #1

Solution:

Using brute force we can crack a password by attempting multiple probablities

like for example if actual password CABD, we attempt possibilities  ACDB, ADBC, BACD, BCDA, BDAC, CABD, CBDA, CDAB, DABC, DBCA, DCBA

#include <iostream>
#include <string>
using namespace std;
//we are using brute force attack
string Brute_Force(string actual_password){
  int ascii_NUM=256; //number of possible ascii characters
  for (int c1=0; c1<ascii_NUM; c1++) {
   for (int c2=0; c2<ascii_NUM; c2++) {
    for (int c3=0; c3<ascii_NUM; c3++) {
     for (int c4=0; c4<ascii_NUM; c4++) {
      // convert each digit into char and concat into string
      string passwd_attempt = string()+(char)c1+(char)c2+(char)c3+(char)c4;
      //check if attempted password is equals to the original password
      if (passwd_attempt==actual_password) return passwd_attempt;
     }
    }
   }
  }
  //if password not found
  throw "not found";
}

Thank you, have a great day:-)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
I am about to start my Dissertation for my Msc in Cyber Security course. However, I...
I am about to start my Dissertation for my Msc in Cyber Security course. However, I am still unsure of the topic I will pursue. Could you please give me a few examples of topics (Preferably IoT & Cybersecurity) and provide 3 characteristics of the research topic that makes it suitable for a master’s level research project. This would be really helpful and would enable me to start planning my dissertation. Thank You
I need to write an essay for my school base assessment. My topic chosen is "An...
I need to write an essay for my school base assessment. My topic chosen is "An investigation into market failure in the agricultural sector in my country" . Please brief me on some possible aims and objectives for my essay. Also I need assistance on the contents I need to include in the body of my essay. How should I formulate my essay. I need some guidance
Please I need a project topic name for a project in adjustable speed drives (AC drives...
Please I need a project topic name for a project in adjustable speed drives (AC drives in power electronics) and a guide on how to write the project. Thank you.
Part 1 I need to make an example class that I make up on my own....
Part 1 I need to make an example class that I make up on my own. It should have some variables, at least one function and at least one procedure in it. And then I should create two instances of the class and demonstrate how to use the class by calling some of the procedures and functions. What I make my class about is up to me. Part 2 Do a simple example of ByVal vs ByRef. I can do...
Hi, I'm currently stuck with my homework. I need to know how to write this program...
Hi, I'm currently stuck with my homework. I need to know how to write this program in Python as below: Write function repeatPhrase(phrase, n), which prints the given phrase n times, alternating between lowercase and uppercase. For example, repeat('The sky is blue', 5) would print: the sky is blue THE SKY IS BLUE the sky is blue THE SKY IS BLUE the sky is blue Please help me, thank you very much!
Hello I am currently working on an informative speech for my class. My topic that I...
Hello I am currently working on an informative speech for my class. My topic that I will be speaking on is the importance of budgeting. I am came up with this outline so far: Specific Purpose: To inform the audience about the importance of budgeting - advantages Central Idea: Making a budgeting plan is easy and the most critical step - great tool Introduction Question: what’s more important to you? A daily Starbucks drink or a yearly beach vacation. Why...
This is for a English Writting course...I need to write a project proposal and badly in...
This is for a English Writting course...I need to write a project proposal and badly in need of a topic. The report is basically a proposal that provides details information about defining a problem, importance of the issue, important highlight of the issue, why I am the correct person for investigating the problem, target audience (who will get benefited), how will I conduct research, list of work that will help me complete the report. So I need a scenario/problem/topic which...
Hi, I need this program written in Java for my intro CS class. Thank you in...
Hi, I need this program written in Java for my intro CS class. Thank you in advance. (also here is the description given in class for the code) Write a program that displays all the leap years, ten per line, from 101 to 2100, separated by exactly one space. Also display the number of leap years in this period. - You should use the method isLeap which returns "true" if the year is a leap year, otherwise it should return...
I'm a nursing student and for my OB clinical, I need to write a teaching plan...
I'm a nursing student and for my OB clinical, I need to write a teaching plan for a patient. But before that I need to come up with one nursing diagnosis and two outcomes based on the topic I chose for my teaching plan. So, I chose "circumcision for baby" and for this topic I need help to have one nursing diagnosis and two outcomes, please.
Briefly describe a topic for a health program and several data sources that you have used...
Briefly describe a topic for a health program and several data sources that you have used or could use to inform the program planning process. I need this to be from a population viewpoint. This is for a community health class. Please go into as much detail as possible thank you!