06-01-2006, 07:47 PM
Code:
#define infile "infile.bmp"
#define passfile "passfile.bmp"
#define outfile "outfile.enc"
dim as integer ifHandle,pfHandle,ofHandle,fpos
dim as ubyte ifTemp,passTemp
ifHandle=freefile
pfHandle=ifHandle+1
ofHandle=pfHandle+1
open infile for binary as #ifHandle
open passfile for binary as #pfHandle
open outfile for binary as #ofHandle
if lof(ifHandle)<>lof(pfHandle) then
print "Error: different file lengths."
sleep
end
end if
do
get #ifHandle,,ifTemp
get #pfHandle,,passTemp
put #ofHandle,,chr$(ifTemp xor passTemp)
fpos+=1
if fpos>=lof(ifHandle) then exit do
loop
print "Done."
sleep
close
If you are encrypting a bitmap file, make a password file by just opening up mspaint and drawing a picture that has the exact same dimensions of the picture you want to encrypt. (Note: that won't work for some compressed image formats like png, because even two pictures of the same dimensions will have different compressed sizes.)
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
--------------------------------------
Freebasic is like QB, except it doesn't suck.