-
Feb 24th, 2012, 05:35 AM
#1
Thread Starter
New Member
My school project!
I received a new major project from my school creating a software which will be used to encrypt and decrypt messages stored in a simple text files using a private key stored in a separate file. The software should also be able to allows the users to enter simple messages that either displays the encrypted or decrypted message. (Use ASCII code)
I just finished the design of the program. It's including two buttons which are encrypt and decrypt, a text box which allows the user to enter messages or load file into it, a listbox which allows the users to load the private key file (ASCII Code). My problem is I don't how to create that private key file.
Please help me out with this, thanks
-
Feb 24th, 2012, 11:49 AM
#2
Fanatic Member
Re: My school project!
I'm not going to give you the answer, but here's a pointer. go to Project/references and make a reference to the FileSystemObject. Once referenced you will have create files, directories, read and write at your disposal
-
Feb 24th, 2012, 02:01 PM
#3
Re: My school project!
Personally I would use the built in file functions rather than the FSO but that's me.
IF it is not a requirement that the private key be created by your program then you could use a text editor like notepad to create a key that contains only typeable characters or a hex editor to make one that includes non typeable characters. You could course also create any type you want through code using the standard Basic file functions.
-
Feb 24th, 2012, 08:20 PM
#4
Re: My school project!
So, write your own encryption and decryption routine. Then toggle back and forth within the textbox to show the encrypted and original text.
Seems simple enough. Go for it. I wrote one of these fifteen years ago and it worked.
-
Feb 25th, 2012, 01:19 AM
#5
Thread Starter
New Member
Re: My school project!
Thanks for your help guys, but what makes me still confused is the ASCII character code consists of 256 characters, how am I gonna create the private key or I just sit there and type ?
-
Feb 25th, 2012, 01:28 AM
#6
Re: My school project!
The base ASCII code set is 128 characters. Extended ASCII brings it up to 256
A key is just a group of characters could be just a few characters or a lot of characters depending on the routine you are using. If the goal is to write your own routines to do this then it is up to you what you use as the key.
-
Feb 25th, 2012, 06:34 AM
#7
Addicted Member
Re: My school project!
Well you could loop thru the unencrypted message one character at a time. Grab it's ASC value, add three to it and save the new character as encrypted message character. Then for decryption, do the same thing except subtract three from the value.
"A" = 65 ASC value so when you add three to it, it becomes ASC value 68 which is "D".
This is very easy to break but it will encrypt your message. the "KEY" is the addition or subtraction of a value.
...
Another way is to "XOR" each character's ASC value.
-
Feb 25th, 2012, 08:40 PM
#8
Re: My school project!
Originally Posted by B61Nuke
Well you could loop thru the unencrypted message one character at a time. Grab it's ASC value, add three to it and save the new character as encrypted message character. Then for decryption, do the same thing except subtract three from the value.
"A" = 65 ASC value so when you add three to it, it becomes ASC value 68 which is "D".
This is very easy to break but it will encrypt your message. the "KEY" is the addition or subtraction of a value.
...
Another way is to "XOR" each character's ASC value.
That "add 3" idea works most of the time but if the existing ASC exceeds 125, you will get an Illegal Function Call error. That can be avoided if you take all existing ASC values below 129 and add 128 to them. Then subtract 129 from all existing ASC values from 129 to 256.
Next, all you have to do is make sure that your code doesn't get used in China, Korea, India, or Singapore. It will likely fail.
Last edited by Code Doc; Feb 25th, 2012 at 08:54 PM.
Doctor Ed
-
Feb 26th, 2012, 01:58 AM
#9
Thread Starter
New Member
Re: My school project!
I forgot to tell the format of the code:
The Character The Code End of line
A Space 4Gh EOL
B Space 8%9 EOL
The Character: A - Space; The Code: 4Gh; End of line: EOL
The Character: B - Space; The code: 8%9; End of line: EOL
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|