encryption - CRAM-MD5 Implementation -


i'm looking @ implementing cram-md5 authentication imap , smtp server. problem cram seems require clear text password available @ times. server sends client unique challenge , client returns:

md5( md5(password, challenge), md5( password ) ) 

i can't see way check without having clear text password, specification doesn't has have 1 available seems logical.

the solution can come encrypt (properly encrypt, not hash) password database (probably using rsa key based aes, have deal that) , decrypt when need compare, seems slow way around though need decrypting , hashing every single login on smtp , imap.

is best solution / efficient solution?

or, better, cram out-of-date because less secure authentication on wire secured ssl now?

the trick need unfinalized md5 of password same intermediate state of md5 context before finalizing.

md5_ctx ctx; md5init(&ctx); md5update(&ctx, password, length); 

if , store value of ctx hashed, 1 can use copies of in cram md5 this

for md5(password, challenge)

md5update(&hashed, challenge, length); md5final(&digest, &hashed); 

and md5( password )

md5final(&digest, &hashed); 

the rest of md5( md5(password, challenge), md5( password ) ) rather simple

i have liked use python example in standard md5 there no way access state of md5 object used libmd5's api


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -