You cannot hide just a part of the history if a Git repository; due to the way Git works, with each commit including the hash of previous commits, in order use a Git repository you need to have the full history.
However, you do have a few options. One would be to start a new repository with the current contents, and keep your old repository around. You can then give anyone who needs access to the old history the old repository. You can still view the full history across both repositories. You do this by adding remotes for each of the old and new, then using git replace
to attach the last commit of the old repo to the first commit of the new. See the answer to this question for more details.
Another option is to filter the history. You can use git filter-branch --tree-filter
to run a script on each commit in your history, which replaces all instances of your passwords with something like "password". This will preserve the full history, though all of your commits will get new commit IDs. See the answer to this question for more details.
Both of these options will allow you to keep your full history, while not revealing your passwords. One thing to keep in mind if that they will change the actual commit IDs so you will need to make sure all of your working repositories are checked out from the new ones, not the old, or you could accidentally push the old history to one of your new repos. I would recommend changing any passwords that are in the old repo just in case, since once they are there, it may be easy to accidentally reveal them.