> On 23 okt. 2015, at 13:59, Pa He <pat.herzf...@gmail.com> wrote:
> Hi Thijs
> Yes, this indeed helps: i got it working:
> key = OpenSSL::PKCS5.pbkdf2_hmac_sha1(pass, salt, iter, 20).unpack('H*')[0]
> => "a71aacc618c164ccf3efd2ae23b0061919844909"
> Gives me the correct saltedpass.
> Got some help from an old bugreport x) 
> https://redmine.ruby-lang.org/issues/5063
> somehow the numbers on the way to stored_key still dont add up
> [46] pry(main)> server_key = OpenSSL::HMAC.hexdigest('sha1', key, 'Server 
> Key')
> => "0307f1e5263b4181aed2aeb22a0a6dd1993dac6c"
> [47] pry(main)> client_key = OpenSSL::HMAC.hexdigest('sha1', key, 'Client 
> Key')
> => "c31fb5d01a1fac55a065fe6b05c133ca5e8d721f"
> [48] pry(main)> stored_key = Digest::SHA1.hexdigest client_key
> => "a71bc7e7d66b312db49557873b9248e9fb27633f"
> Could you also give me your values for this?
> thanks a lot
> cheers patrick

Hi Patrick,

It appears you are using the hex-encoded key. Hex-encoding is useful for
copying and comparing results, but you must make sure to not use hex-encoded
strings instead of normal strings when passing them to the cryptographic
functions. (I.e., remove the '.unpack("*H")’.)

The correct client key for these inputs is:


The correct server key is:


Hope this helps,

You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to