Skip to content
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

[Q] Question about the AEAD implementation key's expanding and re-hashing #60

Closed
arthurkiller opened this issue Aug 6, 2017 · 3 comments

Comments

@arthurkiller
Copy link

arthurkiller commented Aug 6, 2017

According to the document about AEAD in shadowsocks.org. HKDF_SHA1 is strong enough even if the in put key is weak.

But I get the code in ss-go2 that hashing and expanding the input key to requested key length first, then get the hashed key do the HKDF_SHA1 again to get the subkey for AEAD.

Why do this? And I can't see the document request for re-hashing & expanding for the key.

Only once HKDF operation is leaking safty?

Thx dude, waiting for reply.

@riobard

@riobard
Copy link

riobard commented Aug 6, 2017

@dszhengyu
Copy link

dszhengyu commented Sep 7, 2017

@riobard I have talked with @arthurkiller
Still, we can't figure out why to expand the user password to the key length before apply the HKDF_SHA1 function
Nor I can find this mentioned in the document https://shadowsocks.org/en/spec/AEAD-Ciphers.html

@riobard
Copy link

riobard commented Sep 7, 2017

Do you mean why we do this?

key = kdf(password, choice.KeySize)

Before SIP007 we used the key derived from password directly. SIP007 proposed to compute subkeys from that derived key.

In theory we could compute subkeys from password directly, but why bother? All SS crypto code deal with keys instead of passwords.

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

No branches or pull requests

3 participants