Re: Clever ways to hide a compare



jonathon <spamtrap@xxxxxxxxxx> wrote:
> Suppose you are writing a protection scheme, and need
> to compare 2 values. Is there a clever way to do this
> without an outright 'cmp' instruction? Of course it's always
> possible to use the value in a calculation that is needed for
> correct functionality of the program, but I was wondering
> if there is a way to have 2 values compared in a sneaky
> way where it is not immediately evident what is happening.

Well, a `cmp` is nothing but a `sub` with the resultant
thrown away. So you could us that.

But if I were of a mind to write a software licencing/
protection scheme (and I'm not, but I don't think such things
are automatically evil), then I'd proceed very differently:

I'd provide users with a longish (40 char) serial number
that hashed down to the same ~32 bits. These bits would be
a crypto key to correctly decrypt and decompress a critical
code section. This can be defeated by some techniques,
and there are further countermeasures.

-- Robert



.



Relevant Pages

  • Re: Pick the odd one out.
    ... We have a compare instruction with two ... But to express that we want to compare bytes we have add a "BYTE" somewhere ... (the best place would be the cmp -> cmp.b), ... cmp BYTE PTR, 0 ...
    (alt.lang.asm)
  • Clever ways to hide a compare
    ... Suppose you are writing a protection scheme, and need to compare 2 ... Is there a clever way to do this without an outright 'cmp' ...
    (comp.lang.asm.x86)
  • Re: Trying to compare files in two directories with checksum
    ... The need arose because all of ... I am thinking that cksum ... Just compare them directly, with cmp. ...
    (comp.unix.shell)
  • Re: Would there be support for a more general cmp/__cmp__
    ... >> The problem now is that the cmp protocol has no way to ... >> case or throw a specific exception. ... objects of different types always compare ... So if a coder writes one of the comparisons and as a result python ...
    (comp.lang.python)
  • Re: Read After Write
    ... >mounting the ISO on a loop and do a directory cmp. ... I'm using a DVD as a backup device. ... I used diff -r to compare the hard drive location with the DVD, ...
    (Fedora)