Chris M. Thomasson <nos...@nospam.nospam> wrote:
> I am thinking of Diffie???Hellman key exchange and how it could
> possibly apply to my cipher. Well, I am thinking about the following,
> perhaps extremely naive, simplistic method:
> _________________________________________________________
> Alice and Bob decide on a fractal formula F and a point P.
Yes, let's assume 'standard' mandelbrot and P.
>
> Alice thinks of a random unsigned integer AN.
>
> Bob thinks of a random unsigned integer BN.
>
Ok
> Alice sends Bob AN.
>
No! Alice sends Bob the result of applying F AN times on P resulting in P'. The question is ; can Eve work out AN from P' (other than brute force)?
> Bob sends Alice BN.
>
No, see above but Bob sends Alice P'' (result of F**BN(P)).
> Alice iterates F with P (AN + BN) times and gets a secret point S.
>
No, Alice now applies F AN times on P'' (she got from Bob) and gets S.
> Bob iterates F with P (BN + AN) times and gets S as well.
No, Bob applies F BN times on P' and gets S.
>
> Alice and Bob now share the secret point S and can use that to send
> encrypted
> messages to each other using F along with S.
Alice and Bob now share S which they can use to encrypt messages.
Here's another working example. It differs from my previous example (same thread, different message) in that it contains no orbits.
./dh.py -0.5 -0.3 13 47
Alice and Bob agree on C = (-0.5-0.3j)
Eve knows C = (-0.5-0.3j)
Alice chooses a = 13 as random secret and calculates (-0.36239736408-0.17114704742j)
Alice sends (-0.36239736408-0.17114704742j) to Bob. Eve now knows (-0.36239736408-0.17114704742j) too. Can she figure out a?
Bob chooses b= 47 and calculates (-0.382547275834-0.169915369356j)
He sends (-0.382547275834-0.169915369356j) to Alice and thus to Eve also.
Alice applies 13 more iterations on (-0.382547275834-0.169915369356j) and derives (-0.382549399433-0.169966035629j) as a shared secret.
Bob applies 47 more iterations on (-0.36239736408-0.17114704742j) and derives (-0.382549399433-0.169966035629j) as a shared secret.
> _________________________________________________________
>
>
> It should work...
>
The above works but Eve can easily bruteforce a, b and thus S.
So, we need some way to quickly calculate P' and P'' much faster then Eve can do it by brute force.
In DH-keywhatever this is achieved by repeated squaring.
Also I *assume* for now that calculating P' and P'' is one-way.
Further, when I use larger a and b, P' and P'' get into an orbit (for all P's I tried) and then Eve can just predict what the outcome of S will be.
>
> What's wrong with it? What am I missing?
At least all of the above :-)
>
> Try not to be too harsh as I am new at this stuff!
>
Having fun just like you.
Here's my code if your interested:
#!/usr/bin/python
import sys
if len(sys.argv) != 5:
print "$0 x y a b "
exit(1)
C=complex(float(sys.argv[1]),float(sys.argv[2]))
a=int(sys.argv[3])
b=int(sys.argv[4])
def mbf(c,ci,sec):
z_slow=complex(c)
z_fast=complex(c)
orbit=-1
escape=-1
for i in range(0,sec):
z_slow=z_slow*z_slow+ci
z_fast=z_fast*z_fast+ci
z_fast=z_fast*z_fast+ci
if z_fast == z_slow and orbit==-1:
print "Orbit detected at ", i, "for", complex(c)
orbit=i
if abs(z_slow)>2 and escape==-1:
print "Warning", complex(c) , 'escaped at interation ',i
escape=i
#print "DEBUG i=",i,"z_slow=",z_slow
return z_slow
print "Alice and Bob agree on C =",C
print "Eve knows C =",C
A=mbf(C,C,a)
print "Alice chooses a =",a,"as random secret and calculates",A
print "Alice sends",A,"to Bob. Eve now knows",A,"too. Can she figure out a?"
B=mbf(C,C,b)
print "Bob chooses b=",b,"and calculates",B
print "He sends",B,"to Alice and thus to Eve also."
AB=mbf(B,C,a)
print "Alice applies",a,"more iterations on",B,"and derives",AB,"as a shared secret."
BA=mbf(A,C,b)
print "Bob applies",b,"more iterations on",A,"and derives",BA,"as a shared secret."