## Issue
Users may encounter an error when deploying an integration pack from a main account to a sub-account if an encrypted field such as a password is used within a component of the integration pack.
## Error
java.lang.IllegalStateException: Error decrypting password.
Caused by: javax.crypto.BadPaddingException: Padding error in decryption
## Cause
The primary cause of this issue is related to the encryption and decryption mechanisms employed by the platform. Each account within the system has its own keystore, which is utilized for encrypting sensitive data. When a password is encrypted using one account's keystore (the parent account) and then deployed to a sub-account, the sub-account attempts to decrypt the password using its own keystore. In this scenario, the decryption will fail, resulting in an error.
This is expected behavior as the underlying architecture requires that any sensitive data needs to be re-encrypted using the keystore of the account where the data will ultimately be used. This ensures proper security and data integrity across different account configurations.
## Resolution
To resolve this issue, you must deploy the integration pack with Environment Extensions enabled for the encrypted fields and re-enter any encrypted field values under the Environment Extensions of the sub-account. You can do this through the Environment Extension UI on the platform or using the Atomsphere API after deploying the integration pack. This will ensure the fields are properly encrypted using the sub-account's keystore, preventing any further decryption problems.