This is extremely inefficient:
Repeat If KeyDown(1) Then Return 0 ;possible exits of main loop If Eof(filein) Then Exit If I Mod(1000) = 0 Then UpdateProgBar(progbar,I/fsize) ;update the progbar WriteByte(fileout,bytexor(ReadByte(filein),buff(I Mod(10)))) ;calls most of the work I = I + 1 ForeverChange it to load a huge amount of data into a bank using the ReadBytes command (NOT ReadByte), convert the data, then store it using the WriteBytes command. In fact, you can then remove the IF part from your If I Mod(1000) = 0 line. And personally, I would change it to more like 10,000 or so because UpdateProgBar is VERY slow.