11-22-2003, 11:54 PM
Ok, I do this programming team at my school, and I wanna see how many people can solve this problem. It involves encryption, so you will need to know the ASCII tables to do it. Here it is. Oh, and for an added challenge, try to finish this program in the amount of time it took me, 32 min. Oh, and I do have the code I used, but it's in the school's comp.
There is no minimum or maximum length of the file, and people should be able to specify the file name at runtime. Code has no minimum or maximum limber of lines. It can only use pure qb commands though. Good luck. I will give you a sample file.
This should create an output of:
Good Luck
Code:
Computer Security Problem:
A major issue with computer security is to store passwords. Passwords are typically encrypted. For this problem, we assume that all passwords are going to be strings that are 4 characters long. They are all encrypted using a form of cryptography known as "shifting and transposition", where we select a positive integer and we use it to shift each character in the password from within it's own catagory. That means that all uppercase reamin uppercase, lowercase remain lowercase and numbers remain numbers, and all other characters do not shift.
So, as an example password:
bX%7
First, we shift the letters by our cypher. This cypher will be 8:
jF%5
Then, you will switch the first 2 characters and the last two characters:
%5jF
Your problem is to read encrypted passwords from a file, decypher them, then output them onto the screen.
The passwords and cypher digit will be given to you in this format:
Line one of file: No meaning (Dummy line)
Line two and three of file: Take the first 2 numbers of the 2nd line (will always be numbers) and the last 2 numbers of the 3rd line (will always be numbers) and add them together to make the cypher digit
Line four of file: No meaning (Dummy line)
Line five of file: The number of strings to decode (Line 5 will be a number that will represent the number of strings, ex. 0005 means 5 passwords and 0500 means 500 passwords)
Line 6+ of file: Passwords
Code:
"abcd"
"0245"
"5603"
"0896"
"0005"
"7777"
"6923"
"6#&5"
"cdeb"
"YfAg"
Code:
2222
7814
&01#
zwxy
VbTa