For context, I'm assuming the attacker knows the format of the key.
Do these two keys have the same strength, or by leaving the hyphens in the key am I reducing the security by a partly-known-key attack?
A: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa B: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Both keys have the same amount of entropy, 'a' is a hex digit, so 'aa' represents one byte of CSPRNG data.
I guess this is the same question as, 'is there a weakness in using a hex-string key versus the raw version of it, given that the key space is reduced to
0-9a-f characters if left in hex format?'
There is a similar question that exists: Does knowing part of the key make encryption weaker?
But that question assumes a variable length key, which is itself a secret, whereby the security of that key is reduced by the attacker knowing existing parts of it, thus reducing the overall unknown parts. My question is if the key is weakened by the structure of the key itself, when the number of CSPRNG characters always remains the same and the attacker knows none of them.
Another similar question: Does padding an AES key hurt security (besides lowering the strength of the key)?
This is closer to what I'm asking, but is now 7 years old, and I'm wondering if there has been any more recent research or weaknesses identified that might be relevant? The dashes in my example key shown above could technically be considered padding, but is there a distinction when the padding is used within the key, instead of at the start or end?