Skip to content

WSSE implementation without SALT not working #8915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

WSSE implementation without SALT not working #8915

wants to merge 1 commit into from

Conversation

sergiu-popa
Copy link

I implemented the WSSE token in Symfony 2 using SHA512 algorithm WITH salt. Because bcrypt, without specifying the salt, generates one every time encodes a password, the hash_equals at the end of the AuthenticationProvider won't return TRUE ever.

That's because a client encodes the password without a salt, generating a different hash stored in the database. When comparing ONLY these hashes, the password validates. But when concatenating with nonce, created and encode/decoding base64, the hashed won't match:

$expected = base64_encode(sha1(base64_decode($nonce).$created.$secret, true));

So the salt it should be mentioned in the article.

I implemented the WSSE token in Symfony 2 using *SHA512* algorithm *WITH* salt. Because bcrypt, without specifying the salt, generates one every time encodes a password, the hash_equals at the end of the AuthenticationProvider won't return TRUE ever.

That's because a client encodes the password without a salt, generating a different hash stored in the database. When comparing ONLY these hashes, the password validates. But when concatenating with nonce, created and encode/decoding base64, the hashed won't match:

$expected = base64_encode(sha1(base64_decode($nonce).$created.$secret, true));

So the salt it should be mentioned in the article.
@sergiu-popa sergiu-popa changed the title Not working WSSE implementation without SALT not working Dec 20, 2017
@javiereguiluz
Copy link
Member

@sergiu-popa thanks for this ... but this article is too complex and not really necessary most of the times, so we've decided to remove it entirely. See #8943.

I'm sorry because this was going to be your first contribution to Symfony Docs ... but I'm sure there will be more opportunities to contribute. Thanks!

@sergiu-popa
Copy link
Author

@javiereguiluz, is there another article about implementing some type of token authentication for mobile apps? If not, could we leave this online with the details I specified?

I know it’s complex, but it’s well-written and explained... and following it I managed to implement it in Symfony 4. I’m using this authentication between a SF4 app and Android/iOS app.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants