I HAVE APPLICATION WITH PRG AND SCX FILE
I WANT TO ENCRYPT MY PROGRAM FOR SAFETY MY SOURCE PROGRAM
CAN YOU GIVE ME CODE FOR ENCRYPT AND UN-ENCRYPT MY SOURCE PROGRAM.
mY SOURCE PROGRAM IS *.PRG AND *.SCX *.SCT FILE
If you need to distribute you prg file, then no, I don't think it's possible to encrypt your prg.
May I ask why you are distributing your uncompiled source code?
And please refrain from using uppercase letters, it means you are screaming, and I don't think that is your intention.
Cobart,
The simple answer is to create a project of your program and form, and them build the .EXE with the Project encrypt option on (and debug off). This will make it impossible for someone with just a file viewer from reading your code.
Unfortunately, there are programs (like Xitech's ReFox and others) that can decompile this encrypted file back into the original code - although with no comments.
There are also software "wrapper" programs that might make it even more difficult to decompile, but NO program can't be hacked given the time, resources and the right incentive to do it. (Note: Yesterday's announcement that someone has broken MS's "foolproof" routine on it's XBox, and now it's may be possible to run Linux on it!
Rick, that sounds horrible - what is the best "wrapper"-program for VFP at the moment?
And have you any experience how the performance will be influenced by such a program?
Well it turns out that the "best" program to prevent decompiling is ReFox itself. They offer a branding utility and depending on the level you choose, it adds additional code to the your .EXE and/or changes your runtime files.
There is very little no virtually no performance hit depending on the level choosen. Note: This highest level can make it difficult if you have multiple VFP programs on a single system, unless you encrypt them all the same. And of course if you are just one supplier of VFP software you can run into conflicts!
Last, even these variants can reportedly be decompiled with a pirated reverse engineered version of ReFox that is available from sources in China.
Rick, a simple manner to "hide" your code is put in a ZIP file with a password. That manner, you can put all your .prgs safe and other type of files too.
JLucio
I wrote these 2 small routines (they are generic, but they work) to encrypt any (ascii file) (that you could open in a word editor)
Func Encrypt()
LOCAL Enc_File,Enc_Key
CLEAR
Enc_File = GETFILE("PRG" && in your case prgs!
IF EMPTY(Enc_File) OR !FILE(Enc_File)
MESSAGEBOX("Sorry file does not exist or You did not select a file",16,"Invalid"
RETURN
ENDIF
Enc_key = VAL(INPUTBOX("Enter an Encryption Key Value","Value","40")
IF EMPTY(Enc_Key)
Enc_Key = 32 && by default
ENDIF
nHandle = fopen(Enc_File,2)
nLength = fseek(nHandle,0,2)
=fseek(nHandle,0)
cString = fread(nHandle,nLength)
w = ""
WAIT WINDOW "Encrypting File, please wait... " NOWAIT
for x = 1 to len(cString)
* c = ltrim(str(x))
HeadIn = ltrim(str(asc(substr(cString,x,1))))
HeadOut = chr(val(HeadIn) + Enc_key)
w =w+HeadOut
next x
***********
Function Decrypt()
LOCAL Enc_File,Enc_Key
CLEAR
Enc_File = GETFILE("PRG"
IF EMPTY(Enc_File) OR !FILE(Enc_File)
MESSAGEBOX("Sorry file does not exist or You did not select a file",16,"Invalid"
RETURN
ENDIF
Enc_key = VAL(INPUTBOX("Enter an Encryption Key Value","Value","40")
IF EMPTY(Enc_Key)
Enc_Key = 32 && by default
ENDIF
nHandle = fopen(Enc_File,2)
nLength = fseek(nHandle,0,2)
=fseek(nHandle,0)
cString = fread(nHandle,nLength)
WAIT WINDOW "Decrypting File, please wait... " NOWAIT
w = ""
for x = 1 to len(cString)
c = ltrim(str(x))
HeadIn = ltrim(str(asc(substr(cString,x,1))))
HeadOut = chr(val(HeadIn) -Enc_Key)
w =w+HeadOut
next x
=fseek(nHandle,0)
if fwrite(nHandle,w,nlength) = 0
MESSAGEBOX("Error has occured: "+ ferror())
ELSE
MESSAGEBOX("File has been decrypted with Key Code: " + LTRIM(STR(Enc_Key)))
ENDIF
fclose(nHandle)
I just tried it on 2 prgs, and 5 txt files... And it worked!!
Let me know what you think!! Plz, I am curious!!! Please let me know if this helped you
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.