Fix Bit Overlap in ViewCryptor2
Problem:
In the function
createViewCryptor2
,
there is an overlap of 128 bit when generating a symmetric key and a signing key
pair.
Consequences:
An adversary having only access to one of the keys has better chances to guess the other one. Since there are still 128 independent bits, the vulnerability is not considered severe, but should be fixed in a future version.
Suggestions:
There are several ways to resolve this issue:
- Increase the size of the seed to have enough bits to make the keys independent.
- Hash bytes 16 to 64 to get again a string of 64 bytes.
- Use a consumer-based programming pattern (similarly as it is already done for the credentials) that can produce “infinitely” many pseudo-random bytes. This essentially hinders us from making such mistakes in the futures.
Drawbacks:
This requires to introduce a new version of encryption while keeping the old one for backwards compatibility.