Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How Do You Imput A Turing Encrypter/Decrypter...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
uberwalla




PostPosted: Tue Aug 22, 2006 10:51 am   Post subject: How Do You Imput A Turing Encrypter/Decrypter...

Ok ive seen the encrypters in the turings source code and apps sections...

but how do i imput it into my program so that it encrypts an include file in turing, and decrypts it during the prog so it can read the procedures and variables?

in other words...
i need an encrypter so i can place it in my program so that u cant read the file but while the program is running it can read it.
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Tue Aug 22, 2006 12:05 pm   Post subject: (No subject)

I think this is the second time I've told you this:

You don't need to include any .t source code files with your compiled .exe, not even the .t source code files that aren't the main file.
Delos




PostPosted: Tue Aug 22, 2006 12:10 pm   Post subject: (No subject)

Edit: Umm...just read Cervantes' comment. I'll leave this here anyway, though it makes less sense now.

I will suggest making your own. Sure you could attempt to implement someone else's, but if they haven't structured theirs efficiently, it will just be a hassel and will cause you more stress than solutions.
Encryption is not difficult. A great approach would be the following:

pseudo:

function encrypt (in_string : string) : string
   ...
end
function decrypt (in_string : string) : string
   ...
end


Followed by:

pseudo:

my_enc_string := encrypt ("The quick brown fox jumps over the lazy dog")
my_dec_string := decrypt (my_enc_string)


A simple cypher is the Caesar Cypher, where you use a simple shift. For instance A -> B, B -> C, ..., Z -> A.

Since you have your setup using functions, you can easily write a file using the encryption. When you read it back in, simply reverse and call the decryption function instead.

Give it a try. Post up your code when you're done and we'll take a closer look at it.
NikG




PostPosted: Wed Aug 23, 2006 2:58 pm   Post subject: (No subject)

Let me just clarify what Cervantes and Delos have already tried to explain:

You want it to so that your include files can be encrypted so that people can't see them but also your program should be able to decrypt them so that the program itself can use the include files (am I right?).

What you're failing to understand, uberwalla, is that this is pointless! You do not have to worry about anyone seeing your include files because once you have compiled your program, all you need is the exe to run it. You can delete all the source code (including the include files). No one will be able to see your code!

Now if you're actually talking about a high scores file or something and you don't want it to be editable, then you should include the encrypt/decrypt functions in your program and tell them to decrypt the high scores file, update it with the new scores, and then encrypt it again. This way, you'll have a separate high scores file which is encrypted so that people can't change it (and no one can see your encryption method from your source code either).
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: