:stupid: I dont know how do start using XOR. I want to create a program which will read a specified text

encrypt it using XOR and a specific key and write the result to another txt file. Can anyone suggest me how do i

go about this ? I would appreciate if i could get the source-code to work around.

Thankx in advance
Posted on 2003-05-12 01:22:49 by telophase
xor your data with the key to encrypt it then xor the ecrypted data with the key to decrypt it. That is the simplest form of encryption (also the easiest to break)
Posted on 2003-05-12 01:35:28 by donkey
Is it possible for you to give me a complete source-code coz i dont know how to impliment it
Posted on 2003-05-12 01:46:55 by telophase
i tried to use XOR in the following eg: but i falied plz. check and tell where am i going wrong:confused:
-=-=-=-=-=-=-=-=
.data

filehandle dd 0
filename db "read.txt",0
filewrite db "write.txt",0
bytesread dd 0
buffer db 128 dup(?)

.code
invoke _lopen,ADDR filename,OF_READ
mov filehandle,eax
invoke _lread,eax,ADDR buffer,sizeof buffer
mov bytesread,eax
call encrypt

Next:
popad

invoke _lcreat,ADDR filewrite,0
invoke _lwrite,eax,ADDR buffer,sizeof buffer
invoke CloseHandle,filehandle
; ?????????????????????????????????????????????????????????????????????????

encrypt:
pushad

mov ecx,OFFSET bytesread
mov edx,OFFSET buffer
xor byte ptr ,69
dec ecx
cmp ecx,0
je Next
jmp encrypt
-=-=-=-=-=-=-=-=
Posted on 2003-05-12 01:53:01 by telophase
hmm.. Where is your ExitProcess? lol... 69... Just a tip xor with a dword is better since the cracker can just try 255 digits to extract the code. Anyway, you do not need cmp ecx,0 after dec ecx as the dec ecx will set the zero flag if ecx = 0.
Posted on 2003-05-12 02:00:51 by roticv
But how di i store the encrypted char. in buffer and then write the entire buffer (The original file read and which was converted) using write file.
Posted on 2003-05-12 02:04:48 by telophase
I have some very dirty code for you.
Posted on 2003-05-12 03:02:50 by Azrim