in reply to How to Encrypt Authentication and Data to DB?
You don't have to encrypt and decrypt credentials yourself
Check https://kb.berkeley.edu/page.php?id=23274