-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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
whisper: sym encryption message padding includes salt #15631
Conversation
whisper/whisperv6/message.go
Outdated
@@ -124,6 +124,8 @@ func (msg *sentMessage) appendPadding(params *MessageParams) error { | |||
rawSize := len(params.Payload) + 1 | |||
if params.Src != nil { | |||
rawSize += signatureLength | |||
} else { | |||
rawSize += AESNonceLength |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is true only for symmetric encryption
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Src
is nil
, then it's using symmetric encryption
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Src is used to identify the source of the message, i.e. for digital signature. Dst is used for asymmetrc encryption. And KeySym is used for symmetric encryption. So, you can change line 127 like this:
} else if params.KeySym != nil {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well then it's very confusing. Then both sym and asym should be able to sign their messages. So it should be if
and not else if
e8b755a
to
3f8f954
Compare
Now that the AES salt has been moved to the payload, padding must be adjusted to hide it, lest an attacker guesses that the packet uses symmetric encryption.
Now that the AES salt has been moved to the payload, padding must be adjusted to hide it, lest an attacker guesses that the packet uses symmetric encryption.
Now that the AES salt has been moved to the payload, padding must be adjusted to hide it, lest an attacker guesses that the packet uses symmetric encryption.