POV-Ray : Newsgroups : povray.off-topic : How to break a simple "encryption"? : Re: How to break a simple "encryption"? Server Time
28 Jul 2024 10:23:55 EDT (-0400)
  Re: How to break a simple "encryption"?  
From: Warp
Date: 8 Jul 2014 03:32:19
Message: <53bb9e83@news.povray.org>
Lars Rohwedder <rok### [at] gmxde> wrote:
> >>> Which value of Secret2 would allow the * (without overloading) to
> >>> reverse the value with a value of Inverse_of_secret2.
> >>
> >> if SECRET2 is be 123456789, its inverse is 16969517551553616445.
> >>
> >> It is just the "multiplicative inverse modulo 2^64".
> >>
> >> Note the arithmetics of unsigned integer data types is always
> >> "modulo" 2^BITSIZE of that data type.
> >
> > You use the crypto-version of the * operation (from Nist), not the
> > usual multiplication.

> No, it is just the integer multiplication that is done by nerly every
> common CPU, so the usual computer arithmetics. That is no crypto foo.

> Btw, the GCC translates integer divisions (with constant divisor) to
> "multiplications with the inverse element", because multiplications are
> faster than divisions on many CPUs.

Doesn't division via multiplication require a right-sift, though?

In other words, dividing an integer value by a constant can be done as

  (value * x) >> y

where x and y are some magic integers calculated from the divisor?
Can it really be done with just a multiplication?

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.