Greetings Kiran435,
When a backup is encrypted, the password does have to be entered to use the backup. You have unlimited attempts at this password though, so some options to consider -
Apple ID password
Previous device’s passcode
Restrictions/Screen Time passcode
The reason a backup might be encrypted would be to store data that an unencrypted backup does not. About encrypted backups on your iPhone, iPad, or iPod touch
When you encrypt the backup for your iPhone, iPad, or iPod touch
The "Encrypt local backup" option in the Finder or iTunes locks and encodes your information. Encrypted backups can include information that unencrypted backups don't:
• Your saved passwords
• Wi-Fi settings
• Website history
• Health data
• Call history
Encrypted backups don't include Face ID, Touch ID, or device passcode data.
You can turn off backup encryption for future backups and also reset the password, however that would only apply to backups going forward, not to the previously made backups. If you can’t remember the password for your encrypted backup
If you can’t remember the password for your encrypted backup
1. On your device, go to Settings > General > Transfer or Reset [Device], then tap Reset.
2. Tap Reset All Settings and enter your device passcode.
3. Tap Reset All Settings.
4. Follow the steps to reset your settings. This won't affect your user data or passwords, but it will reset settings like display brightness, Home Screen layout, and wallpaper. It also removes your encrypted backup password.
5. Connect your device to the Finder or iTunes again and create a new encrypted backup.
You won't be able to use previous encrypted backups, but you can use the Finder or iTunes to back up your current data and set a new backup password.
If you have a device with iOS 10 or earlier, you can't reset the password. In this case, try the following:
• If someone else set up your device, ask them for the password.
• Use an iCloud backup instead. If you don't have an iCloud backup, you can make one.
• Use an older iTunes or Finder backup.
Thanks.