This reviews inheritance and file handling (Chapter 17) with seek, tell, read, write, and other direct access file functions in C++.
This lab also shows you how write C++ programs for Command Line Interfaces.
Given
Use the text book to review file handling.
You need your working lab04main.cpp and buffer04.h files. Compile and rerun lab04main.
Use the strings program on the compiled program
strings lab04main(or perhaps
strings a.out)
Can you find my name and my password in the listing?
This is not secure!
I will be giving you a new SecureBuffer class that encrypts its data as it constructs the buffer. SecureBuffer is derived from Buffer.
class SecureBuffer: public Buffer {...}
[ SecureBuffer.h ]
Plus a test program for it
[ tSecureBuffer.cpp ]
I will also be giving you some outlines for the programs that you will need to complete.
Deliverables
A set of test programs, handling
passwords and names with a minimal degree of security.
A working set of main programs that uses an extended Secure Buffer class that lets an administrator administer them and a user change them more securely. Here is a summary of the complete system from the point of view of the two types of user.
I drew this to help me design the programs you will be working with below.
The next little change is to remove an experimental "throw"
inside the "operator[]" function. Instead it should return
the null character:
return '\0';for index that are negative or greater than len. Leave the others untouched.
od -c passwdwill show you the characters inside passwd including the unprintable ones in the encrypted data.
add botting 1234567User Ids (botting above) are placed in a file with no encryption. The password is encrypted in add and then stored the direct access file called
passwdHere is the code.... with some key parts replaced by /*******/: [ add.cpp ] You task is to figure out what I removed and replace it so that the program works again.
Last: A working program that uses shadow and passwd
to authenticate logins. After logging in the user can
change their password.
Here is the code.... with some key parts replaced by /*******/:
[ use.cpp ]
. . . . . . . . . ( end of section Process) <<Contents | End>>
Prologue -- Are we there yet
NO! It takes even more paranoia to fix our password system.
Look at this
[ 001263.html ]
[ 001267.html ]
issues of the Coding Horror blog to learn the evil in hacker's hearts.
. . . . . . . . . ( end of section CSci202 Laboratory 09 Information Security) <<Contents | End>>
Abbreviations