The best way is to use the Linux way, which keeps a hash of your passwords and doesn't store them in clear. I think you don't want to memorize the password, but this is impossible (only if you want to use a secured usbstick for log in, which can store the hash of your password and/or the certificate - btw, never tried this on iMX boards).
I understand that you need a method to keep the passwords in clear - hopefully you understand why this is not safe :smileyhappy:
Even you encrypt your password using a symmetric or asymmetric algorithm, you should have/keep the security key used in the algorithm. Every method you use you need to memorize (in mind or in other way) a password / a key.
In any other modern OS (Linux, macOS, Windows, QNX..etc) the user should keep in mind the password - when you type it the OS will calculate the hash and will compare it with the one saved when you created the user. This is the most common and the safest popular method used so far. Note that if the hacker will obtain root access and read the hash, can break pretty easily the password using a hash breaker - but this is not so easy (or almost impossible in a linear time) if you're using a strong password.
Thank you,
Marius