Hello Nkm
Both are fine; but in the context you suggest, it's slightly more idiomatic like this:
1. It is only dependent on part of the key.
2. It is dependent only on part of the key.
In #2, there's more emphasis on the fact that it's only part of the key. #1 sounds more neutral. But it's a very small difference.
MrP