We need to build a server that can store secret notes for users. The server can store/show/delete the secret notes when the user enters his credentials. You can store the users’ credentials (username and password) in plaintext on the server. So, when the user enters the username and password, the server retrieves the user’s notes and prints it. Storing the user’s credentials as plain text is not a secure strategy. If someone could hack the server, it could easily find the stored credentials and unravel all the user’s secret notes. One better strategy is to encrypt the credentials using the hashing and store the hashed credentials instead of the plaintext credentials. You are required to build a hash function that takes the credentials and converts it to a hash index which represents the user’s name and password. Construct a server (class) that has the following: - credentials_file_path: string; where this file contains the hash_index, secret_notes_file_path for each secret note. - table: array of strings; is a hash table that contains the hashed credentials along with the file path to the user’s secret notes - table_size: int; it is the size of the table which is equal to 1 000 000 007 - server(credentials_file_path: string) ; is a constructor that creates credentials file if not existed or loads the credentials file into the hash table - ~server(); is a destructor that stores the latest hash table in the credentials file - load_credentials(); this function loads the credentials into the table from the credentials_file_path. (0.5) - store_credentials(); this function stores the table that is filled with the credentials into credentials file. (0.5) - hash(username: string, password: string): int; this function takes the credentials and outputs the hashed index in the table using the following equation: (1) - insert_secret_notes(username: string, password: string, secretNotes: string); this function stores the secret notes file path in the table. The secret notes file is generated. The file name could be user’s_hashedCode.txt o Example: User’s credentials hash code is 12345 so, the filename is 12345.txt - show_secret_notes(username: string, password: string); it prints the secrets on the console if the username and password are found in the table. Otherwise, it prints “Invalid credentials” - delete_secret_notes (username: string, password: string); this function deletes the record from the table if the username and password are correct and prints to “The user Secrets have been deleted”, otherwise prints “Failed operation”. - Implement the main function of the program to show a menu to the user that allows him to choose an action to perform and takes the necessary input from him. After performing the action, the user will be shown the same menu again. Example for the menu: Please choose an action to continue: 1. Insert secret notes // user inputs the credentials, and secret notes (1) 2. Show secret notes // user inputs the credentials (1) 3. Delete secret notes // user inputs the credentials (1)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

using c++

We need to build a server that can store secret notes for users. The server can store/show/delete
the secret notes when the user enters his credentials. You can store the users’ credentials (username and
password) in plaintext on the server. So, when the user enters the username and password, the server
retrieves the user’s notes and prints it.
Storing the user’s credentials as plain text is not a secure strategy. If someone could hack the server, it
could easily find the stored credentials and unravel all the user’s secret notes. One better strategy is to
encrypt the credentials using the hashing and store the hashed credentials instead of the plaintext
credentials.
You are required to build a hash function that takes the credentials and converts it to a hash index
which represents the user’s name and password.
Construct a server (class) that has the following:
- credentials_file_path: string; where this file contains the hash_index,
secret_notes_file_path for each secret note.
- table: array of strings; is a hash table that contains the hashed credentials along with the
file path to the user’s secret notes
- table_size: int; it is the size of the table which is equal to 1 000 000 007
- server(credentials_file_path: string) ; is a constructor that creates credentials file if not
existed or loads the credentials file into the hash table
- ~server(); is a destructor that stores the latest hash table in the credentials file
- load_credentials(); this function loads the credentials into the table from the
credentials_file_path. (0.5)
- store_credentials(); this function stores the table that is filled with the credentials into
credentials file. (0.5)
- hash(username: string, password: string): int; this function takes the credentials and
outputs the hashed index in the table using the following equation: (1)

- insert_secret_notes(username: string, password: string, secretNotes: string); this
function stores the secret notes file path in the table. The secret notes file is generated. The
file name could be user’s_hashedCode.txt
o Example: User’s credentials hash code is 12345 so, the filename is 12345.txt
- show_secret_notes(username: string, password: string); it prints the secrets on the
console if the username and password are found in the table. Otherwise, it prints “Invalid
credentials”
- delete_secret_notes (username: string, password: string); this function deletes the
record from the table if the username and password are correct and prints to “The user
Secrets have been deleted”, otherwise prints “Failed operation”.
- Implement the main function of the program to show a menu to the user that allows him
to choose an action to perform and takes the necessary input from him. After performing
the action, the user will be shown the same menu again.
Example for the menu:
Please choose an action to continue:
1. Insert secret notes // user inputs the credentials, and secret notes (1)
2. Show secret notes // user inputs the credentials (1)
3. Delete secret notes // user inputs the credentials (1)

Expert Solution
steps

Step by step

Solved in 5 steps with 7 images

Blurred answer
Knowledge Booster
Device network connection
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education