Suppose I would like to use a very long string as a password. As an example we can just say this string is 100 characters in length.
However, suppose the application for which I would like to use this password only supports password lengths of 64 characters. Without going in detail, assume that simply truncating the desired password at 64 characters would significantly increase its predictability.
Would it be secure if I used as my password a hash of this password, for the sole purpose of reducing its length?
For example, if I chose to use a base64-encoded SHA-256 hash of the password, I believe that I am looking at a search space of about 2.96 * 1079 (64 possible characters * length of 44). I choose to use base64 instead of the hex representation because the hex representation consists of a smaller search space (16 possible characters * length of 64 = 1.16 * 1077).
(EDIT: As Thomas Pornin pointed out in his answer, the search space will always be 2256 regardless of what encoding is used.)
For my purposes, this search space size is sufficient. However, does the fact that I am using a base64 encoding of a SHA-256 hash introduce any predictability o the password? In other words, if an attacker knows that my password is a base64-encoded SHA-256 hash of an input string (but he knows nothing about the input string), would he some how be able to reduce that initial search space of 2.96 * 1079?
