The password must be stored in the keychain of the Mac that uses it to make backups (otherwise that couldn't work and you would have to keep entering the password every time you restart or disconnect that drive).
Search your keychain for
sparsebundle (or sometimes
backupbundle) and/or the name of the drive. You should be able to find them in the system keychain. Make sure you have selected to display "All objects" or "Passwords".
The entry has a long hexadecimal name with dashes. I have seen some reports saying that the name is their computer name, but I have never seen anything else but these hexadecimal names.
You may find several entries. I recommend to try them in reverse order with regard to their modification date.
Alternatively, you can set your own password like this:
- connect to the NAS with the credentials used for Time Machine
- locate the Time Machine sparsebundle
- open Terminal and enter (add a space after the command)
- from Finder, draw the sparsebundle to the Terminal window
- hit enter
This allows you to set a new password for the backup. You shouldn't have to enter the current password, because it is automatically taken from your keychain.