Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(C++ Phishing Scanner) Phishing is a form of identity theft in which, in an e-ma

ID: 3717941 • Letter: #

Question

(C++ Phishing Scanner) Phishing is a form of identity theft in which, in an e-mail, a sender pos- ing as a trustworthy source attempts to acquire private information, such as your user names, pass- words, credit-card numbers and social security number. Phishing e-mails claiming to be from popular banks, credit-card companies, auction sites, social networks and online payment services may look quite legitimate. These fraudulent messages often provide links to spoofed (fake) websites where you’re asked to enter sensitive information.

Create a text file with a list of words, phrases and company names commonly found in phishing messages (Program must ask for name of file.) Assign a point value to each based on your estimate of its likeliness to be in a phishing message (e.g., one point if it’s somewhat likely, two points if moderately likely, or three points if highly likely). Write a program that scans a file of text for these terms and phrases.From the Phishing file, replace all non-alpha characters by a space before checking for phishing For each occurrence of a keyword or phrase within the text file, add the assigned point value to the total points for that word or phrase. For each keyword or phrase found, output to another text file, one line with the word or phrase, the number of occurrences and the point total. Then show the point total for the entire message. Does your program assign a high point total to some actual phishing e-mails you’ve received? Does it assign a high point total to some legitimate e-mails you’ve received?

Explanation / Answer

lower your mortgage rate,2
lowest insurance rates,1
lose weight,3
promised you,2
your email won,3
job offer,1

And finally comes the C-Code that will try to provide spam score of a text user enters through his keyboard. You can anytime change the Input source to meet your needs!

#include<stdio.h>
#include<string.h>

typedef struct spamWord {
char text[30];
int weight;
} SPAMWORD;

SPAMWORD words[30];

void init() { //loads spam words from csv file
int i;
FILE *fp = fopen("word_list.csv", "r");
for (i = 0; i < 30; i++) {
fscanf(fp, "%[^,],%d ",words[i].text, &(words[i].weight));
}
}

int getFreq(char doc, char subStr) { //counts the frequrency of a word in a text document
int i = 0;
while ((doc = strstr(doc, subStr)) != NULL) {
doc = doc + strlen(subStr);
i++;
}
return i;
}


int main() {
init(); //do not forget to initialize
char doc[1024];
int i, score;
score = 0;
printf("Enter text to get spam score: ");
scanf("%[^ ]", doc);
for (i = 0; i < 30; i++) {
score = score + (getFreq(doc, words[i].text) * words[i].weight);
}
printf("Your spam score is: %d ", score);
}

As per as my findings it does assign a high point total to some legitimate e-mails I’ve received

If you have any query, please get back to me and get them solved. Am here to help you with all your queries!