Here are some assumptions on which the question is based. If anything is wrong with this, please point this out straight away:
Let's say I have a file I want to encrypt with AES256 symmetric encryption. This requires a 256-bit key. It would be very hard to remember though. In its original form it probably contains characters with no ASCII representation, and base64 encoded is would be over 32 characters long.
Which is why I might want to use a password-based key derivation.
The job of a password based key derivation is to to compensate for the fact that the password used might be easier to guess than the actual key by making the action of checking a specific password more computationally expensive.
Now the questions:
- Considering the password strong enough so it is will never be a weak point (let's say 100 chars, uppercase, lowercase, number, specials) can password-based encryption be as secure as just using the key itself, or does it always allow to infer a smaller set of possible keys?
- Same as above, but in the context of
gpg
(assume strongest hashing algorithm with the maximum number of rounds ---s2k-digest-algo
ands2k-count
) - As the worst-case scenario for an attacker is to have to brute force guess the 256-bit key, does it make more sense to just store the key itself? (Assuming that either password or key needs to be stored, as they are both too complicated to remember)
- If the answer to 3 is yes, then is openssl AES265 with specifying a key directly a good method of accomplishing that? From the research I have done, you can not use a key directly with
gpg
.