Not exactly... I mean ...
Well... I guess I may have packed alot of stuff in that lil post.
Bored? If not ...you will be...
First - Encryption doesn't need to be federally regulated 256 bit double password key and challenge - duel key algorythm... blah blah blah
If I made a program that opened a bitmap file as a file of BYTE - and then opened a destination file of byte - and went through and just READ a BYTE - then "change it somehow", and then WRITE it to my new file... I probably DAMAGED that file.... UNLESS
I did the EXACT same thing in reverse... read a byte - do what I must to "change it back somehow" and write it... when I am done - in theory - I have just RESTORED the file to its original State.
This is a SLOW way to do it also... as reading a file a byte at a time - well.. there are better ways to accomplish this sort of thing.
First - the "Change it somehow" and "Change it back somehow" can EASILY be done safely with the XOR operator.
` Dealing with BYTE - so Numeric range is 0 to 255
` you can use ints too.. but you more likely to
` ruin a file using ints if you don't know the format
` of the file if you used by read byte in - change -
` write byte out thing
MagicNo as byte
MagicNo = 56
Original as byte
Original = 167
print "Original:";Original
Encrypted as byte
Encrypted = Original XOR MagicNo
print "Encrypted VALUE:";Encrypted
Decrypted as Byte
Decrypted = Encrypted XOR MagicNo
print "Decrypted:";Decrypted
print
print "Is the Decrypted value the same as the original? COOL B-)"
sync
sync
wait key
Ok - that's a $0.50 primer in encryption... but the other thing I mentioned uses DBPRO stuff that's built in to your advantage.
There are DBPRO commands to load image, make memblock from image, and save memblock.
If you do the following to PREPARE your media:
1: Load image
2: Make Memblock from image
3: Encrypt the memblock
4: Save the memblock
Then in your game you do the opposite:
1: Load Memblock (filename of your encrypted saved memblock)
2: decrypt the memblock
3: make image from memblock
You have more or less prevented the casual person from having access to your media!
I hope this helps.