An application encrypts data with AES (
aes-256-cbc) using a key and IV derived from a randomly-generated pass-phrase (
openssl enc -pass...). It encrypts the pass-phrase with 2048-bit RSA. So the pass phrase data is limited by the size of the RSA key (i.e to a maximum of 256 bytes) and any padding scheme
Given the random characteristic of the pass-phrase data (e.g.
openssl rand), which is better: more data or better padding ?
Example pass phrase lengths:
- 256 bytes with no padding (pass
- 245 bytes with the OpenSSL default
- 214 bytes with
oaeppadding (using the default SHA1 digest)
- 190 bytes with
oaeppadding using a SHA256 digest
To paraphrase, if the random source is good enough is there anything to gain from using fewer random bits for the key and then applying a padding scheme and, if so, which padding scheme is best ?