-
Hey, look at this:
Code:
Private Sub cmdEncrypt_Click()
Dim i As Integer 'Loop counter
Dim intKeyChar As Integer 'Character within the key that we'll use to encrypt
Dim strTemp As String 'Store the encrypted string as it grows
Dim strText As String 'The initial text to be encrypted
Dim strKey As String 'The encryption key
Dim strChar1 As String * 1 'The first character to XOR
Dim strChar2 As String * 1 'The second character to XOR
'Get the text and key from the textboxes
strText = txtText.Text
strKey = txtKey.Text
'Loop through each character in the text
For i = 1 To Len(strText)
'Get the next character from the text
strChar1 = Mid(strText, i, 1)
'Find the current "frame" within the key
intKeyChar = ((i - 1) Mod Len(strKey)) + 1
'Get the next character from the key
strChar2 = Mid(strKey, intKeyChar, 1)
'Convert the charaters to ASCII, XOR them, and convert to a character again
strTemp = strTemp & Chr(Asc(strChar1) Xor Asc(strChar2))
Next i
'Display the resultant encrypted string
txtText.Text = strTemp
End Sub
(The author said he doesn't care if we steal the code, but anyway, it was made by Lucky: http://members.home.net/theluckyleper ;) )
Put it in a form with a textbox (txtText.Text) with the text to encrypt (it can easily be modified to a file, you can use any string), another textbox (txtKey.Text) where you input the key, and the button to encrypt/disencrypt (cmdEncrypt).
Now, type a text in txtText and a key in txtKey. Press the cmdEncrypt button. Notice how the text is completely different?
(!) If you encrypt it again with the same key, it will return to normal, if just a small part of the key is wrong, you'll never get the original text back!!!
Now, here's another idea: Use 3 keys. Encrypt it 3 times, so it will be nearly impossible to break it :)
Also, you can use Huffman encoding that will not only make the file smaller, but also you can use the "logic tree" (look for a good article on it :p ) as another key!
Hehe, another idea would be to use LOADS of encryptions, so it would take lots of time to find out how to crack it (if they ever would ;) )
-
You seriously want to have raw source code getting thrown about on the user's system? I am sure there is some way to track and record that source. Doesn't sound like a good idea to me.
I think you're wasting your time trying to make it 100% secure. It's either gonna be insecure or it's gonna be too busy encrypting and decrypting pointless information to run at a decent speed.
You can only do so much before the law of diminishing returns kicks in. You can't mess around writing more security code than is going to the actual workings of your app. It's ridiculous.
If you want to really give crackers a headache, write programs with self-modifying code. That's a real *****. Back before any old lamer with a 'l33+ h4><0ring for Dummies' book could write some VBScript and bring down half the world's servers because they're all running Outlook like good little subjects of the Microsoft empire, the really good viruses (and by 'good' I mean 'evil') were self-modifying and really tiny... got to admire some of the programmers that made them for their evil genius really ;)
-
Nah, that wasn't my idea, I mean, it could be used for the serial number...
I think that what you need is something to distinguish one computer from another. That way, when you ran the game for the first time, it would keep something that identifies the system in itself (in the end of the EXE) - try it and you'll see it works, it doesn't get corrupted or anything. Just make it look like garbage so people think it's part of the code ;)
If the user tries to copy the game, the game would see that that was not the computer where it should be, so it would tell the user "Sorry, but the same copy of [name-of-your-game] can only be run on one computer.", delete itself and exit :)
A good way to identify a computer is to look for something unique, like a log file or the system registry. The only problem is that these things change. So we'd have to find a REALLY good way to identify it...
-
Good idea, Sastraxi! I'll check out the setup program later, don't have the time now... ;)
And Zaei, I didn't read the begginers vb book, so it was kinda new to me. Anyway, it's impossible to crack unless you have the right key. And if encrypt the string again, the decrypted text will look like garbage unless you decrypt it again :p
-
Tsk Tsk
"To seek total security is foolish, to expect it is to invite danger."
I think that about sums it up. Also, no offense, but why would someone want your program so badly that they spend years trying to hack it into oblivion, when they can easily have other games/programs that way?
-
So is that suppose to mean you shouldn't protect your software? If he wants to do it, then it will be great. It will develop some strength and uniqueness to the software.
-
Yeah, there would still be some honest people paying for the software - but it would be unfair for them, since others would get it for free. I say yes to protect our games and programs the best we can.
-
You know, i just realized the greatest security measure of them all... Dont actually charge for your game. Just let people download it. Then you dont have to worry about people hacking it, AND you dont have to give any technical support. ::sounds of people cheering in the background::
Z.
-
Unless they use one of those HDD monitoring utilities.
-
Zaei is right - a good way to earn money would be from ads in the web site, where people would have to log in before playing the multiplayer version! I know of a game that does this, and believe me - it works because they make lots of money from ads, and it's fun to play it online: http://www.graalonline.com