Here is one way, but it doesn't change the file size:
Create a string to hold the password.
Read in the file to be encrypted one byte at a time.
For each byte, take the next letter in the string.
When you reach the end of the string go back to the start.
For each letter, find its ascii equivelant, and do a bitwise XOR of the two byte values.
Write the new byte value to the new file.
To decrypt, just run the encrypt function on it again with the same password.
edit:
Here is some example code:
function Encrypt(Password$, OldFile$, NewFile$)
byte1 as byte
byte2 as byte
open to read 1,OldFile$
open to write 2,NewFile$
repeat
inc i
if i > len(Password$) then i = 1
read byte 1,byte1
byte2 = asc(mid$(Password$,i))
write byte 2,(byte1~~byte2)
until file end(1)
close file 1
close file 2
endfunction