Started learning about linux security and reading some articles about MD5 password hashing.
This godbolt demo uses the crypt function
char *crypt(const char *key, const char *salt);
and passes this salt value
const char *salt = "$1$rockyou";
where
$1$is MD5rockyouis the salt.
Question
Suppose the salt contains a $ symbol, such as rock$you, how should it be formatted before passing it to crypt?
You can't use
$in the salt. From the documentation you linked to:$is not in that set because it's used as the delimiter betweensaltandencrypted.