r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[MySQL]

Pekr
8-Jan-2006
[185]
So - I did some homework here, but I am at my limits (well, maybe 
not, but I will be very slow from now on), whereas we have ppl knowing 
C here, and ppl who did some hashing etc. for Beer (Ladislav), so 
guys, if you find some 10 minutes of spare time, please at least 
try to give me some pointers here. As I said - the world is upgrading 
mySQL to 5.0 now, so 4.11 is older, not to mention 4.0.1 or 3.23. 
It is about having mysql free scheme for rebol, or not. And don't 
think every admin will be willing to set old-password parameter for 
his server, as this can be regarded a security risk ...
Pekr
9-Jan-2006
[186]
.
Graham
9-Jan-2006
[187]
I think someone needs to pay someone to fix it.
Pekr
9-Jan-2006
[188]
:-)
Graham
9-Jan-2006
[189]
You have these open source sites where a developer offers to fix 
something for a sum.  The community then collects the money and pays 
the developer.  Whoever needs this, will donate to have this done.
Pekr
9-Jan-2006
[190]
how much, and to whom?
Graham
9-Jan-2006
[191x2]
someone first off needs to say that they will do it, and for how 
much.
Jeff could probably do it.
Pekr
9-Jan-2006
[193]
I suggested such model for a long time already. I used it with rebol 
in the past too ... so just - how much, and who does it? :-)
Graham
9-Jan-2006
[194x3]
Ask him how much he wants, and then see who is interested in contributing.
There must be quite a few rebol users using mysql.
if no one contributes .. then clearly it's not worth doing.
Pekr
9-Jan-2006
[197]
I will see what comes up on ml ....
Graham
9-Jan-2006
[198]
People have to earn a living ..
Pekr
9-Jan-2006
[199x4]
anton (sorry, can't write capital "a", my keyboard broken :-), the 
trouble is that I can see some ppl frustrated at ml .....
I don't know any other language, which would not have mysql scheme 
....
I did some preparations even for plug-in ... but nothing happened. 
To have NS kind of plug-in, not many C wrapped code would be needed 
imo!
Not investing much money in our PC shop, I would pay some ppl myself 
to do the job for me :-(
Anton
9-Jan-2006
[203]
I'd be crazy to add this to my schedule now. But ask me in about 
a month and I might look into it then.
Pekr
9-Jan-2006
[204x3]
working on some rebol stuff, if I might ask?
I would at least like to know, if checksum/secure uses typical SHa1 
method?
notice : this group is now web-public
Anton
9-Jan-2006
[207x2]
Of course, rebol, but also looking at getting broadband, and fixing 
other people's computers :-( Trojans galore last week.)
Goodness me, Petr, the checksum/secure question can be sooo easily 
answered. So easily, that I think an experienced reboler such as 
yourself in posing this question must be implying something else.
Pekr
9-Jan-2006
[209]
I don't understand what do you mean here. I probably know, from its 
help, that it supports md5 and sha1, but dunno how to use such fact 
in regards to mysql scheme. Why doc coded his own functions then? 
Or is it just that older auth schemes did not use typical sha1 hashing?
sqlab
9-Jan-2006
[210]
Only the /pro,  /command  and sdk  versions have this functions exposed
Pekr
9-Jan-2006
[211]
really?
sqlab
9-Jan-2006
[212]
If I remember, otherwise there is only encloak
Pekr
9-Jan-2006
[213]
I am not talking about encryption, just looking into 'checsum function 
help ... I just need hash ...
Anton
9-Jan-2006
[214]
We need the C code that they use to generate the checksum. That way 
we might see some comments or code which tell us how it is computed 
and if rebol's builtin checksum also does it.
Pekr
9-Jan-2006
[215x2]
I posted two links above to rebol.cz ...
Now - sorry if I am breaking some licenses, but I will post some 
stuff to my website, and remove it once we are finished:

http://www.rebol.cz/mysql/mysql-protocol.r
http://www.rebol.cz/mysql/password.c
Anton
9-Jan-2006
[217]
Yep, so now you can go and find the C code.
Pekr
9-Jan-2006
[218x3]
maybe this is better description:

The password is saved (in user.password) by using the PASSWORD() 
function in
  mysql.


  This is .c file because it's used in libmysqlclient, which is entirely 
  in C.
  (we need it to be portable to a variety of systems).
  Example:
    update user set password=PASSWORD("hello") where user="test"
  This saves a hashed number as a string in the password field.

  The new authentication is performed in following manner:

  SERVER:  public_seed=create_random_string()
           send(public_seed)

  CLIENT:  recv(public_seed)
           hash_stage1=sha1("password")
           hash_stage2=sha1(hash_stage1)
           reply=xor(hash_stage1, sha1(public_seed,hash_stage2)

           // this three steps are done in scramble() 

           send(reply)

     
  SERVER:  recv(reply)
           hash_stage1=xor(reply, sha1(public_seed,hash_stage2))
           candidate_hash2=sha1(hash_stage1)
           check(candidate_hash2==hash_stage2)

           // this three steps are done in check_scramble()
according to above, it is not so difficult - algorithm is as above 
...
what I am not sure is if I can use checksum to get equivalent of 
above sha1("password") ?
Anton
9-Jan-2006
[221x2]
Ah right:
checksum/secure checksum/secure "mypass"
== #{6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4}
looks same as in 
http://dev.mysql.com/doc/refman/5.0/en/password-hashing.html
Pekr
9-Jan-2006
[223x2]
what is checksum/method "mypass" 'sha1 good for then?
does it mean mySQL new password method is even more rebol friendly 
as it was in the past? hmm, if so, should not be difficult to proceed 
from this point?
Volker
9-Jan-2006
[225]
that checksum has only 20 digits?
'sha1, maybe more explicit?
Pekr
9-Jan-2006
[226x2]
above scheme, what client does, and what server does, should be sufficient 
to achieve the result?
I just wonder why Doc implemented scrambler in such complicated way 
then? Maybe older mysql did so too (some non standard mechanism). 
Do implemented 'floor, crypt-v9, crypt-v10, scramble, hash-v9, hash-v10 
in his scrambler object...
Volker
9-Jan-2006
[228x2]
looks like a direct translation of the c-code to me.
i think it would be enough, if you figure out how Doc sends data 
to server. Have no experience with mysql unfortunally., always using 
files..
Pekr
9-Jan-2006
[230x2]
I figured it out ...
:-)
Volker
9-Jan-2006
[232]
BTW, good recherche :)
Pekr
9-Jan-2006
[233x2]
there is read-packet and write-packet functions ...
in write-packet, there is part, where he simply sends passwd and 
calls 'scramble on it ... scramble decides upon protocol V9 or V10 
version, and calls crypt-v9 or crypt-v10 accordingly, those two call 
hash-v9 or hash-v10 ....