Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "crt.bi"
- Dim FileBuff as ubyte ptr
- if Command = "" or Command = "/?" then
- Print !"Simple File Encryptor 1.000\r\n"
- Print !"syntax: encrypt 'filename'\r\n"
- Print "to de-encrypt run program a second time over file as it's a self-decrypting"
- Print "algorithm"
- End If
- 'open input file
- Open command for binary access read as #1
- var iFileSz = lof(1)
- FileBuff = malloc(iFileSz)
- Get #1, , FileBuff[0], iFileSz: Close #1
- 'encrypt data
- For X as integer = 0 to iFileSz
- FileBuff[X] = FileBuff[X] XOR &HFF
- Next X
- 'open output file
- Open command for binary access write as #1
- Put #1,, FileBuff[0], iFileSz: Close #1
- Free FileBuff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement