The MASM Forum

Microsoft 64 bit MASM => MASM64 SDK => Topic started by: OlivierS on April 08, 2024, 02:39:00 AM

Title: "Xorer" executable
Post by: OlivierS on April 08, 2024, 02:39:00 AM
Hello,

Here is the source code of a program that xors a file (from which we type the location/name, xored file is copied to file "output.fle").
I guess there are many flaws in it:

-the xor process is a bit trivial, this encryption is very easy to crack.
-the file size must not exceed 2GB, the file title must not exceed 64 bytes.
-Im pretty sure there are other concerns, in matter of security as in term of efficiency.
Thanks in advance for your advices.


Olivier

PS:
(build.bat file):
ml64 madXor.asm /link /subsystem:console /entry:main

(Visual Studio 2022 Developer Command Prompt v17.6.4)

Title: Re: "Xorer" executable
Post by: NoCforMe on April 08, 2024, 04:48:29 AM
First of all: why 64-bit? This would be so much easier in 32-bit. And 64-bit is total overkill for the trivial task you're doing here.
Title: Re: "Xorer" executable
Post by: Vortex on April 08, 2024, 04:54:41 AM
Hi OlivierS,

You would like to use the Masm64 SDK making easier coding.
Title: Re: "Xorer" executable
Post by: OlivierS on April 08, 2024, 05:46:33 AM
Hi and thank you for your replies.
Why 64 bits? My computer OS is a windows 64 machine and the book i have is about 64 bit masm programming. Those are the reasons why i did not choose 32 bits. As you probably noticed, im a beginner(lol). I didnot know i could compile in x32 bit on a win64 machine. I will take a look at the documentation on the forum.
@Vortex, i will take a look at the masm64 sdk for easier coding.
Thank you all :smiley:
Title: Re: "Xorer" executable
Post by: NoCforMe on April 08, 2024, 05:52:28 AM
It is really so much easier (Win32) and it still works like a charm even on fancy-schmancy 64-bit systems.

BTW, 32-bit is referred to as "X86" (after the Intel line of processors), while 64-bit is "X64".
Title: Re: "Xorer" executable
Post by: alCoPaUL on May 14, 2024, 06:50:59 AM
Quote from: OlivierS on April 08, 2024, 02:39:00 AMHello,

Here is the source code of a program that xors a file (from which we type the location/name, xored file is copied to file "output.fle").
I guess there are many flaws in it:

-the xor process is a bit trivial, this encryption is very easy to crack.
-the file size must not exceed 2GB, the file title must not exceed 64 bytes.
-Im pretty sure there are other concerns, in matter of security as in term of efficiency.
Thanks in advance for your advices.


Olivier

PS:
(build.bat file):
ml64 madXor.asm /link /subsystem:console /entry:main

(Visual Studio 2022 Developer Command Prompt v17.6.4)




2 byte password resets at FF+1 (range: 0, FF) if you're implementing byte per byte XORing but visualize the extra routines that you can use at full, say, rax register..

and wait, there are more registers...