3 ms·
> IMO if you don't need the entropy You almost certainly don't, but my default for any security related value is "properly random" except where the randomness
by dspillett 9y ago
> IMO if you don't need the entropy
You almost certainly don't, but my default for any security related value is "properly random" except where the randomness itself might give clues. That way around is less likely to result in a "kicking oneself" situation in the future!
- Terr_ 9y agoThe reason I'm suggesting a detectable padding is for a different "kicking yourself" scenario: What happens if some system ever doesn't strip the junk? Now you've got corrupt data, and its been corrupted in a way that you cannot reliably fix. In the case of hashed passwords, suppose the user entered "foo" but you stored hash("foo42156"). Now the user is locked out, and there's no way for you to fix it on their next login attempt, because you have no way of knowing how much of it was "real" anymore. In contrast, a deterministic system (like "pad with newlines to 256 bytes") allows you to take their next login attempt, validate it under the older method, and "upgrade" the hash to the correct de-junked version. It's not just passwords either: The issue of corruption also applies to all variable-length non-hashed sensitive data you might apply this scheme to. For example, security-questions, e-mail addresses, financial account numbers, etc.
- dspillett 9y agoValid point. In this case though the extra padding would be in a separate field that only exists to control the length of the POST request body - nothing should be looking at it in a way that would allow it in to corrupt other data.
- Terr_ 9y agoAh, I was interpreting it as randomness/padding on a per-field, basis, ex: password = "foo2556019562042" # Example limit of 16 chars password_real_len = 3