From: Gregg Pollack Date: 2006-02-24T04:19:38+09:00 Subject: Re: Help with Sha + Base64 for WSSE encoding. Tom Copeland wrote: >> 1. Create a random Nonce(or string) >> 2. create the token by doing Base64(sha(nonce + timestamp + password) > > Cool. > >> puts Base64.encode64(Digest::SHA1.hexdigest(nonce + time + >> password)).strip > > Hm, do you want to be calling SHA1.hexdigest() here? Or just > SHA1.digest()? Thanks for the quick reply Tom, nonce = "MjAwNi0wMi0yM1QxODo1NjozMVogNDdjYzM5NTVlZmY1NzljZGIwMzVkNTljZjI4ZWU3NzE3Y2Y4NmM5Zg==" time = "2006-02-23T18:56:31Z" password = "test" puts Base64.encode64(Digest::SHA1.digest(nonce + time + password)).strip gets me: MzI2OTQ4YzY4OWQ3MGMxYzMzYTEwZWI2Yzg5MzZiYzMzZGE2ZTJhMg== Unfortunately this is not closer to: 267V1V5JW5xqct0bOAoFEaSDL7Y= -- Posted via http://www.ruby-forum.com/.