When you restore the encrypted backup, it will require you enter the password for it. You can enter it as many times as you want then. It will not lock you out.
And you may have not noticed, or thought it was asking for a password for something else, but when selecting the encrypted password option, it will inevitably ask to set one up. The Encryption option does not work without setting up a password first, since it uses the password as part of the encryption seed. It is required. Whatever was used, was something you had to enter yourself.
As explained in the support document linked to above:
3 - On the Summary screen, select "Encrypt [device] backup" in the Backups section.
4 - When asked, make a password. Create one that you'll remember or write it down and store it safely, because there's no way to use your iTunes backups without this password.
As said, you can remove the encryption and make a new encrypted backup and set the password again. But the old backups will not longer be accessible.