Computer Science Canada ascii '32' doesn't put space - help. |
Author: | WynterJones [ Sat Apr 08, 2006 1:43 pm ] | ||
Post subject: | ascii '32' doesn't put space - help. | ||
Hello, I had to make a really simple program for class. I have to turn a word to ascii and plus 2, a lot like the caeser cypher (pardon spelling, and perhaps I am incorrect about this tidbit). For the program I have done it, but I've decided I want to make it more complex throughout the year, and maybe when I am done playing with it I may know something, or made something cool involving encryption. I was planning on making a chat program on turing and use whatever encryption program I make and use it for sening and recieving data to the two people in the chat. Instead of sending "hello, how are you" it would send a longer, key that if the teachers were to monitor wouldn't be able to read it. Why? Because my school is under strict rules with computers. We aren't even allowed to read blogs. It gets worse. But anyways this is what I have :
What the encryption process is easy, and easily read by the code so I won't go into detail. Note where I have "Working" in the encrypt proc. I have seen some ascii charts and it says 32 is a space. But when you input a space it enters it twice, and encrypts it onto another line. I want it all to be on one line. So I thought I should put that if statement in there, but it doesn't work. (I know it's commented) but even when it's not commented. Anyone have any suggestions on encryption, or to my problem. Please don't refer me to a tutorial here, because I have read them, and not ready for the complicated encryptions. Baby steps. Thanks. |
Author: | Delos [ Sat Apr 08, 2006 2:58 pm ] | ||||
Post subject: | |||||
A likely problem is this line in encrypt:
Change that to:
Which allows for more than one token to be entered. As for your decyption, it appears to be a little buggy - in decrypts fine, but does not parse the resultant output. So, one ends up with an odd string like "h!/5e!05l!3/l!16o!46" for "hello". You may not need to worry about this for now, but the fact that there's so much repitition in your buffer characters is a sure sign of their existence. Anyone looking at your output will be struck by its length, and be curious as to why random kids are typing out such long essays while on a chat-line. Hence, they will be led to look at the output closely and will notice the repitition and hence hypothesize the existence of bulk in there. They will then proceed to do some simple ASCII manipulations and will quite quickly break the encryption. Not at all serious at your stage, but something to consider as you improve upon your algorithms. |
Author: | WynterJones [ Sat Apr 08, 2006 4:50 pm ] |
Post subject: | |
Thank you very much. I have seen people use : * but was never told what it was for, so thank you for fixing that problem. As for the decryption of the above program isn't set up for the encryption, yet. The code so far is very faulty, and like you said won't be easily dismissed. Pretty much because : hey there = j#68g#20{#49"#81v#62j#64g#73t#15g#69 lol not so great, but I am just learning and trying things. Does anyone have any improvements? Or steps into the right direction to some not so complicated, but fun encryption processes? |
Author: | WynterJones [ Sat Apr 08, 2006 5:18 pm ] | ||
Post subject: | |||
For anyone who cares : I have made it add a space, and make the one part of the code I had before work, with help.
|
Author: | Tony [ Sat Apr 08, 2006 5:41 pm ] | ||
Post subject: | |||
heh
1 to L _really_ difficult to tell the difference in that font So you basically solved the problem of encripted spaces looking weird by not encrypting them. Ehh.. ok, but now it's easy to identify separate encrypted words. Furthermore by noticing that you're not using characters a,b and have only 2 "weird characters": z+1, z+2 it becomes incredibly easy to crack the message.. even without tools. |
Author: | WynterJones [ Sat Apr 08, 2006 9:02 pm ] |
Post subject: | |
Wow, your right. I've created the code that ultimately defeats me. Thanks for the heads up, I'm not even sure why I even wanted the space to begin with. |
Author: | md [ Sun Apr 09, 2006 9:39 am ] |
Post subject: | |
It's not really even a cesar cypher since you are only shifting letters. Perhaps I shall write a good tutorial on encryption... one that starts off easy enough for anyone. |
Author: | Delos [ Sun Apr 09, 2006 12:32 pm ] |
Post subject: | |
Or you could delve into a bit of colloaboration and improve upon Mystic's and perhaps even convice Imm0rtal that his, uh, source code could be put to better uses in the right context... ![]() |
Author: | md [ Sun Apr 09, 2006 2:36 pm ] |
Post subject: | |
We shall see... but having until the end of the month with nothing to do for the most part means lots of free time to look into it. |