AES-256-CBC to encrypt password for a set of users, and for each user in the database we gotta generate and store the password in the database. The database has constraint that the name of the user must be unique, so I was wondering if using the name of the person as the initialization vector was okay, because names are sufficiently random for a cryptographic perspective, if I encode it to hex and use the 16 bytes for the IV would it be okay. This would give me one less thing to store in the database.
encrypt password for a set of users
You should hash the password for users instead of encrypting them, rarely does an application need to recover the password for any purpose.
password_verify functions that replaces the
crypt function that provides password hashing functionality, and it's broadly interoperable with other implementations of SHA-256/512, BCrypt, Argon password hashing algorithms.
Your specific environment may ship with its own implementations. Python has PassLib.