|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Internal String VisibilityI would like to garble a const string so that someone cannot search for and
change the string in the .exe easily. Is here an easy way to generate the garbled string outside of the IDE to copy into a const string, then ungarble it in the app when I am about to display it? VB6 app "Lorin" <Lo***@discussions.microsoft.com> wrote in message Use any kind of encryption. Your constant would be assigned the encrypted news:25A3FA53-4E01-40EC-BBC5-9FB25573F8DF@microsoft.com... >I would like to garble a const string so that someone cannot search for and > change the string in the .exe easily. > Is here an easy way to generate the garbled string outside of the IDE to > copy into a const string, then ungarble it in the app when I am about to > display it? > VB6 app string. When you need to use it, unencrypt it. -- Mike Which brings up another question.
Are all the MS encryption APIs on all Windows, foreign and domestic? Show quoteHide quote "MikeD" wrote: > > "Lorin" <Lo***@discussions.microsoft.com> wrote in message > news:25A3FA53-4E01-40EC-BBC5-9FB25573F8DF@microsoft.com... > >I would like to garble a const string so that someone cannot search for and > > change the string in the .exe easily. > > Is here an easy way to generate the garbled string outside of the IDE to > > copy into a const string, then ungarble it in the app when I am about to > > display it? > > VB6 app > > > Use any kind of encryption. Your constant would be assigned the encrypted > string. When you need to use it, unencrypt it. > > -- > Mike > > "Lorin" <Lo***@discussions.microsoft.com> schrieb im Newsbeitrag You could bypass the Win-encryption-APIs, if younews:A2341876-4B85-4E43-8196-CCA862BE0809@microsoft.com... > Which brings up another question. > Are all the MS encryption APIs on all Windows, > foreign and domestic? include your own encryption-routines. There are codesnippets out there e.g. for ArcFour (RC4), which can give you strong encryption on any VB- String or ByteArray. The ArcFour-Routines/Implementations are usually very small and work fast if you compile to native code. You can also use them from precompiled Libraries if you want. For example the cCrypt-Class which is available in my toolset contains not only ArcFour, but also SHA1-Hashing, Diffie-Helman-Public-Key-Algos, Functions for large Prime-Numbers, different (non-encrypting) Encoding-Algos (as base64), and different compression-routines as e.g. ZLib or FastLZ. All independent of MS-APIs or -libs. Regarding another thread, where you thought about usage of DB-based approaches (using SQL for your queries) instead of Array-based approaches (doing your own loops), a look at this toolset seems like a good idea, since it also contains also a complete DB-engine, which also does not depend on MS-DB-stuff like ADO or JET - so instead of your Arrays you could use an InMemory- DB for example. Though it will add a dependency of 3-Dlls to your App (ca. 700kB total when UPXed - ca. 2MB when deUPXed, but usable regfree). www.datenhaus.de/Downloads/dhRichClient3.zip www.datenhaus.de/Downloads/dhRichClient3-Demo.zip Olaf "Schmidt" <s**@online.de> schrieb im Newsbeitrag Oops sorry - seems I've mistaken you (the post I hadnews:eE289iupJHA.4448@TK2MSFTNGP05.phx.gbl... > Regarding another thread, where you thought about > usage of DB-based approaches (using SQL for your > queries) instead of Array-based approaches (doing your > own loops), ... in mind came from Webbiz). Olaf "Lorin" <Lo***@discussions.microsoft.com> wrote Don't don't even need to encrypt it, just don't store it all in one place.> I would like to garble a const string so that someone cannot search for and > change the string in the .exe easily. > Is here an easy way to generate the garbled string outside of the IDE to > copy into a const string, then ungarble it in the app when I am about to > display it? > VB6 app For example make an EXE from the following code and run the program. Then try to find the message in the EXE... LFS Private Sub Form_Load() MsgBox Message End Sub Private Function Message() As String Dim itm For Each itm In Array("Che", "ck", " thi", "s ou", "t in", " th", "e E", "XE.") Message = Message & itm Next End Function "Larry Serflaten" <serfla***@usinternet.com> wrote That was a bad example. I checked it out using a Hex editor and then> > Is here an easy way to generate the garbled string outside of the IDE to > > copy into a const string, then ungarble it in the app when I am about to > > display it? > > Don't don't even need to encrypt it, just don't store it all in one place. > For example make an EXE from the following code and run the program. > Then try to find the message in the EXE... sent it. Opening it up in Notepad would show the message clear enough to edit it. None the less, depending on size, breaking it up between modules or procedures would do better. Of course as was suggested, picking any encryption would most likely make it hard enough for most purposes.... LFS Along those lines, you could hide the password inside a sentence or just
random looking text. Either of these jumbled pieces of text will generate the same garbled output string (a password for my example). This one... PW = "May they see sports bad times and assign swears words for your day." or this one... PW = "Ms23//3y819z dp32/&$0abs 3lsskji 22sj2!48/wr9(la0os0)om2rma hj1di" Use this to obtain the real password... For X = 1 To Len(PW) Step 7 Password = Password & Mid(PW, X, 1) Next Laying out a jumbled string is really quite simple. Decide on the step amount (I chose to use 7), write your actual text in the Immediate window and then insert a number of space equal to one less than the step amount you decided on (6 in this case). So, for my example, I wrote out M y p a s s w o r d Then, in the line under it, start writing your garbled text making sure when you get to one of your letters in the line above it, that you type that letter. When done, you have your garbled text that contains your actual text. You can try to make a real or almost real-looking sentence (as I did in my first PW assignment) for your garbled text, or just garble it up right from the beginning. -- Show quoteHide quoteRick (MVP - Excel) "Larry Serflaten" <serfla***@usinternet.com> wrote in message news:ucR4wjGpJHA.5880@TK2MSFTNGP05.phx.gbl... > > "Lorin" <Lo***@discussions.microsoft.com> wrote >> I would like to garble a const string so that someone cannot search for >> and >> change the string in the .exe easily. >> Is here an easy way to generate the garbled string outside of the IDE to >> copy into a const string, then ungarble it in the app when I am about to >> display it? >> VB6 app > > Don't don't even need to encrypt it, just don't store it all in one place. > For example make an EXE from the following code and run the program. > Then try to find the message in the EXE... > > LFS > > Private Sub Form_Load() > MsgBox Message > End Sub > > Private Function Message() As String > Dim itm > > For Each itm In Array("Che", "ck", " thi", "s ou", "t in", " th", "e E", > "XE.") > Message = Message & itm > Next > End Function > > In addition to the other suggestions, I've sometimes
used Chr. For instance, a few years ago someone had psoted a crack for my software based on a hotmail email address. (I create a key based on the email address.) Since I don't sell to "webmail" accounts anyway, I added a foil to the EXE. Since I didn't want the foil to be easily circumvented I used code something like: s = "TM" s1 = "IL" s = Chr$(72) & Chr$(79) & s & Chr$(65) & s1 That gave me "HOTMAIL" without anything vaguely close appearing in the file strings. (Of course that can't be used as a constant, though. It'd have to be a variable, since you can't have any operations in a constant definition.) Show quoteHide quote > I would like to garble a const string so that someone cannot search for and > change the string in the .exe easily. > Is here an easy way to generate the garbled string outside of the IDE to > copy into a const string, then ungarble it in the app when I am about to > display it? > VB6 app > I am currently thinking I should write an eternal VB6 app to take clear text
and garble it. Maybe something like what is on Randy Birch's site. Just a simple NOT AND &HFF per int character is a possiblility. Or make a byte array and NOT. Also, could shift left a few bits since usual text printables are in the 0-127 range. Thoughts? Show quoteHide quote "mayayana" wrote: > In addition to the other suggestions, I've sometimes > used Chr. For instance, a few years ago someone > had psoted a crack for my software based on a hotmail > email address. (I create a key based on the email address.) > Since I don't sell to "webmail" accounts anyway, I added > a foil to the EXE. Since I didn't want the foil to be easily > circumvented I used code something like: > > s = "TM" > s1 = "IL" > s = Chr$(72) & Chr$(79) & s & Chr$(65) & s1 > > That gave me "HOTMAIL" without anything vaguely close > appearing in the file strings. > > (Of course that can't be used as a constant, though. > It'd have to be a variable, since you can't have any > operations in a constant definition.) > > > > I would like to garble a const string so that someone cannot search for > and > > change the string in the .exe easily. > > Is here an easy way to generate the garbled string outside of the IDE to > > copy into a const string, then ungarble it in the app when I am about to > > display it? > > VB6 app > > > > > > I am currently thinking I should write an eternal VB6 app to take clear I expect you know better than anyone else what best suitstext > and garble it. Maybe something like what is on Randy Birch's site. > Just a simple NOT AND &HFF per int character is a possiblility. > Or make a byte array and NOT. > Also, could shift left a few bits since usual text printables are in the > 0-127 range. > Thoughts? your needs. It sounds like the easiest method that won't produce a telltale string in the executable is all that you need. "Lorin" <Lo***@discussions.microsoft.com> wrote in message Well here is an incredibly simple routine to jumble up text, it would be news:FC411D5B-B5E3-45D9-ACB7-E3748F493F52@microsoft.com... >I am currently thinking I should write an eternal VB6 app to take clear >text > and garble it. Maybe something like what is on Randy Birch's site. > Just a simple NOT AND &HFF per int character is a possiblility. > Or make a byte array and NOT. > Also, could shift left a few bits since usual text printables are in the > 0-127 range. > Thoughts? easy to decrypt as long as it's known to be scrambled text, if it's encoded in an executable the crypt-text is not obvious. Public Function EasyEncrypt(Plaintext As String) As String ' Painfully simple encryption for comments etc. ' Same routine to encrypt and decrypt Dim n As Integer Dim c As Integer EasyEncrypt = StrReverse(Plaintext) For n = 1 To Len(EasyEncrypt) c = Asc(Mid$(EasyEncrypt, n, 1)) If c > 32 Then If c > 127 Then c = 383 - c Else c = 160 - c End If Mid$(EasyEncrypt, n, 1) = Chr$(c) End If Next End Function
Help with Binary Compatibility
Fonts (OT) false positives on my files Copying array elements Can I loop through only SELECTED items in a multi-select FileListBox? converting from basic to vb6 Should I distribute Winsock? Visual Basic Express 2008 Custom Error Message Dynamic function calls Problem with Display information in Labels |
|||||||||||||||||||||||