The Program: Setting up classes and understanding tokenization The first step in encrypting/decrypting messages is to parse the messages into words before applying the encryption/decryption algorithms to them. This parsing process is called “tokenization.” Read the contents of a file into this array using the getline command. The objective of this assignment is to demonstrate the use of pointers in a program utilizing c-strings and tokenization. The use of pointers is foundational in C++. This program provides an exercise in using pointers, passing them into functions, using them as return data types, and leveraging them in traversing arrays Instructions Since many of you are studying the field of Cyber Security, you may find this assignment to be especially interesting. Your job is to write a program to encrypt outgoing messages and decrypt incoming messages using a Vigenere Cypher. In this assignment, you will parse a string of words from a file into tokens using the strtok_s command with pointers and then use the Vigenere Cypher algorithm to encrypt and decrypt the parsed words. Before you can perform any encryption/decryption activities, the first step is to read in messages from a file and parse the messages into individual words. The first step in encrypting/decrypting messages is to parse the messages into words before applying the encryption/decryption algorithms to them. This parsing process is called “tokenization.” Tokenization: The process of parsing sentences into words is called tokenization. To tokenize a sentence into words, use the C++ function strtok_s. [Note: do not try to use the C++ strtok function because it has been deemed unsafe and has therefore been deprecated.] In your “client” code (i.e. the file that contains your main function), you will need to declare a character array that will hold 1000 characters. Read the contents of a file into this array using the getline command. To view a discussion on how to use getline with a file object, see this link: There should be two classes in your program: Vigenere and Message. Vigenere contains the encryption key and the logic for encrypting and decrypting individual words. Message contains a vector of words that have been encrypted or decrypted and the logic for calling the functions in the Vigenere class to encrypt or decrypt a word. The Message class serves as a middle-man between your client code and the Vigenere class and holds the encrypted/decrypted results in a vector. Vigenere Class Data Member: string key Functions: Vigenere() ßconstructor void setKey(string k) string getKey() string toUpperCase(string k) string encrypt(string word) string decrypt(string word) The Vigenere class should store an encryption key in a data member called “key.” The class should have a one-argument constructor that receives a string that represents the encryption key. The encryption key must be in all capital letters for the encryption and decryption algorithms to work. Therefore, before setting the encryption key’s value, it should first be converted entirely to upper case. Do this in your toUpperCase function. There should be two classes in your program: Vigenere and Message. Vigenere contains the encryption key and the logic for encrypting and decrypting individual words. Message contains a vector of words that have been encrypted or decrypted and the logic for calling the functions in the Vigenere class to encrypt or decrypt a word. The Message class serves as a middle-man between your client code and the Vigenere class and holds the encrypted/decrypted results in a vector. Class Construction: Details Vigenere Class Data Member: string key Functions: Vigenere() ßconstructor void setKey(string k) string getKey() string toUpperCase(string k) string encrypt(string word) string decrypt(string word) The Vigenere class should store an encryption key in a data member called “key.” The class should have a one-argument constructor that receives a string that represents the encryption key. The encryption key must be in all capital letters for the encryption and decryption algorithms to work. Therefore, before setting the encryption key’s value, it should first be converted entirely to upper case. Do this in your toUpperCase function
Instructions
Your job is to write a program to encrypt outgoing messages and decrypt incoming messages using a Vigenere Cypher.
In this assignment, you will parse a string of words from a file into tokens using the strtok_s command with pointers and then use the Vigenere Cypher
Before you can perform any encryption/decryption activities, the first step is to read in messages from a file and parse the messages into individual words.
The Program: Setting up classes and understanding tokenization
The first step in encrypting/decrypting messages is to parse the messages into words before applying the encryption/decryption algorithms to them. This parsing process is called “tokenization.”
Read the contents of a file into this array using the getline command.
The objective of this assignment is to demonstrate the use of pointers in a program utilizing c-strings and tokenization. The use of pointers is foundational in C++. This program provides an exercise in using pointers, passing them into functions, using them as return data types, and leveraging them in traversing arrays
Instructions
Since many of you are studying the field of Cyber Security, you may find this assignment to be especially interesting.
Your job is to write a program to encrypt outgoing messages and decrypt incoming messages using a Vigenere Cypher.
In this assignment, you will parse a string of words from a file into tokens using the strtok_s command with pointers and then use the Vigenere Cypher algorithm to encrypt and decrypt the parsed words.
Before you can perform any encryption/decryption activities, the first step is to read in messages from a file and parse the messages into individual words.
The first step in encrypting/decrypting messages is to parse the messages into words before applying the encryption/decryption algorithms to them. This parsing process is called “tokenization.”
Tokenization:
The process of parsing sentences into words is called tokenization. To tokenize a sentence into words, use the C++ function strtok_s. [Note: do not try to use the C++ strtok function because it has been deemed unsafe and has therefore been deprecated.]
In your “client” code (i.e. the file that contains your main function), you will need to declare a character array that will hold 1000 characters.
Read the contents of a file into this array using the getline command. To view a discussion on how to use getline with a file object, see this link:
There should be two classes in your program: Vigenere and Message.
Vigenere contains the encryption key and the logic for encrypting and decrypting individual words.
Message contains a
Vigenere Class
Data Member: string key
Functions: Vigenere() ßconstructor
void setKey(string k)
string getKey()
string toUpperCase(string k)
string encrypt(string word)
string decrypt(string word)
The Vigenere class should store an encryption key in a data member called “key.”
The class should have a one-argument constructor that receives a string that represents the encryption key. The encryption key must be in all capital letters for the encryption and decryption algorithms to work. Therefore, before setting the encryption key’s value, it should first be converted entirely to upper case. Do this in your toUpperCase function.
There should be two classes in your program: Vigenere and Message.
Vigenere contains the encryption key and the logic for encrypting and decrypting individual words.
Message contains a vector of words that have been encrypted or decrypted and the logic for calling the functions in the Vigenere class to encrypt or decrypt a word. The Message class serves as a middle-man between your client code and the Vigenere class and holds the encrypted/decrypted results in a vector.
Class Construction: Details
Vigenere Class
Data Member: string key
Functions: Vigenere() ßconstructor
void setKey(string k)
string getKey()
string toUpperCase(string k)
string encrypt(string word)
string decrypt(string word)
The Vigenere class should store an encryption key in a data member called “key.”
The class should have a one-argument constructor that receives a string that represents the encryption key. The encryption key must be in all capital letters for the encryption and decryption algorithms to work. Therefore, before setting the encryption key’s value, it should first be converted entirely to upper case. Do this in your toUpperCase function.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 12 images