Encrypting a Text File?
Encrypting a Text File?
When you save a QBASIC Program to a text file and store variables in it, is there anyway to encrypt the numbers so people using the program can't alter the variables?
to put data in the file:
to get data from the file:
Code: Select all
data$ = "test"
OPEN "file.dat" FOR BINARY AS #1
PUT #1, , data$
CLOSE
Code: Select all
DIM getd AS STRING * 10
OPEN "file.dat" FOR BINARY AS #1
GET #1, , getd
PRINT getd
CLOSE
ysft
Re: Encrypting a Text File?
I think you guys are missing DWolf's point. His concern is that the user of the program can load the source file into QBasic and using the editor can change variables before running the program.DWolf wrote:When you save a QBASIC Program to a text file and store variables in it, is there anyway to encrypt the numbers so people using the program can't alter the variables?
You can write out the program in binary or you can encrypt it, but that means that YOU have to be there to unscramble/decrypt it so it can be run by the user. Not very practical.
My suggestion is to compile the program to an EXE file. Now anybody can run the EXE independently, and there is no way they can "monkey" with any variables or any code. That's the beauty of an EXE file.
*****