Care should be taken to ensure that the conv() function is robust. Such a function is provided in the library libpam_misc (see below).
conv()