Why does a hacker need to crack the key to an encrypted file, instead of just brute forcing the password? Most encryption softwares don't seem to have a trial limit. So why would a hacker need to crack the key, or even need to know the salt value, if he can just brute force the 6-8 digit password?
There's a few reasons.

First, most encryption doesn't rely on a password. It relies on 128-bit or 256-bit keys (for symmetric encryption at least), which are mathematically and physically outside the realm of what we consider ever possible to brute force.

Second, in systems that do derive a key from a potentially-weak password, you're right in that the password can be brute forced. However, this is why cryptographers have designed password-based key derivation functions (such as PBKDF2, scrypt, and Argon2). These impose a large computational cost upon each attempt at deriving the encryption key from the password. While it might take 500ms of computation (on a particular CPU) and 50MB of memory for a legitimate user to verify their password, this is an acceptable cost if they're only having to attempt authentication once or twice. On the other hand, this is a significant burden on someone who wants to brute force all possible combinations.