I'm guessing you are trying to restore your phone from an iTunes backup, is that correct? If it's asking for a password, at some point, perhaps even years ago, you turned on Encrypted Backup and when you did, you had to at that time create an encrypted backup password. Again, assuming you're trying to set up your phone from an iTunes backup, unless you can remember the passcode, it won't work.
BUT, you can use Quick Start directly on your new phone to move everything over from your old phone without need to use your computer with iTunes. You can also create an iCloud backup of your old phone, then use the iCloud backup to set up your new phone.
See this link for the ways you can do this. I particularly like Quick Start as it's simple and works well --> Transfer data from your previous iOS device to your new iPhone, iPad, or iPod touch - Apple Support