Remstart ------------------------------------------------------------------ Author: Volker Stepprath of Testaware Project: Password Encryption System Version: 0.00.001 ;D Language: DarkBASIC Professional v1.057 Description: File en/decrypt using password and xor operator Date: 10. November 2004 ------------------------------------------------------------------ Hint 1: Call function first as encrypt and twice to decrypt Hint 2: Use function as include in your own sources Hint 3: For deep encryption use characters like "%&!#*?..." ------------------------------------------------------------------ Remend xFileName$="Atomix 2004.exe" : Rem * Name of the file to en/decrypt xPassWord$="DarkBASIC Professional" : Rem * Password (try your own characters) _EncryptFile(xFileName$,xPassWord$) : Rem * Call function to en/decrypt file FUNCTION _EncryptFile(xFileName$,xPassWord$) open to read 1,xFileName$ make memblock from file 1,1 close file 1 xFileSize=get memblock size(1)-1 xPassSize=len(xPassWord$) for a=0 to xFileSize b=memblock byte(1,a) if b<>0 inc c : if c>xPassSize then c=1 b=b ~~ asc(mid$(xPassWord$,c)) if b<>0 then write memblock byte 1,a,b endif next a delete file xFileName$ open to write 1,xFileName$ for a=0 to xFileSize write byte 1,memblock byte(1,a) next a close file 1 delete memblock 1 ENDFUNCTION