broken c port of Ec25519 key exchange

Just starting out? Need help? Post your questions and find answers here.
PeterH
User
User
Posts: 28
Joined: Sun Apr 11, 2010 11:01 am

Re: broken c port of Ec25519 key exchange

Post by PeterH »

This might actually solve all of my current problems. Using the code above, especially since Danilo made it insanely fast, combined with the code demivec completed (http://www.forums.purebasic.com/english ... 38#p253838) it should be possible to implement ECDSA (http://en.wikipedia.org/wiki/Elliptic_Curve_DSA).

1) You generate your keys as usual for the curve25519 etc.
2) k = generate 32 random bytes (or a number between 1 and (n-1) if you wanna be super duper error proof)
3) z = sha1(message/file)
4) r = basepoint * 2 (if r = 0 goto step 2)
5) n = 2^255-19
6) d_A = private key from earlier
7) s = k^(-1) * (z + (r * d_A) ) mod n (if s = 0 goto step 2)

(r,s) = signature

That is if I understood this thingy correct. Huge advantages with ECC as a base since it'd be the solution for many people looking for RSA and way faster despite smaller keys. This would mean a secure key exchange algorithm and DSA support, everything fully cross-compilable without hassle. Pretty neat. Any help is welcome of course. Still no PB here so I can't try this out just yet. Still no preprocessor or decent includes (without inline assember) to support this yet. Seems the language is not keeping up with the modern day where encryption is an everyday need for most people (and programmers). People who don't express their need just simply don't understand that they need bigints yet. If I can verify curve25519 and ECDSA working without external libraries and without inline assembler I'll try to buy PB anyway and see if the extra cash might get development on a bigint library started. One never knows. Butterfly effect and all that. :P
Post Reply