Security to private key in encryption in ionic v1

hi, How can we guarantee that there is a security for private key in encryption?. If you found any examples also helpful in ionic V1. How can we provide security to the private key in ionic v1