{
    "mode": "man",
    "parameter": "crypt_checksalt",
    "section": "3",
    "url": "https://www.chedong.com/phpMan.php/man/crypt_checksalt/3/json",
    "generated": "2026-10-07T14:41:24Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "cryptchecksalt — validate a crypt setting string\n",
            "subsections": []
        },
        "LIBRARY": {
            "content": "Crypt Library (libcrypt, -lcrypt)\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "#include <crypt.h>",
                    "content": "int\ncryptchecksalt(const char *setting);\n"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "cryptchecksalt  checks  the  setting  string  against  the  system configuration and reports\nwhether the hashing method and parameters it specifies are acceptable.  It is intended to  be\nused  by  programs  such as login(1) to determine whether the user's passphrase should be re-\nhashed using the currently preferred hashing method.\n",
            "subsections": []
        },
        "RETURN VALUES": {
            "content": "The return value is 0 if there is nothing wrong with this setting.  Otherwise, it is  one  of\nthe following constants:\n\nCRYPTSALTOK\nsetting is a fully correct setting string.  This constant is guaranteed to equal 0.\n\nCRYPTSALTINVALID\nsetting is not a valid setting string; either it specifies a hashing method that is not\nknown to this version of libxcrypt, or it specifies invalid parameters for the method.\n\nCRYPTSALTMETHODDISABLED (Not implemented, yet)\nsetting  specifies  a hashing method that is no longer allowed to be used at all; crypt\nwill fail if passed this setting.  Manual intervention will be required  to  reactivate\nthe user's account.\n\nCRYPTSALTMETHODLEGACY\nsetting  specifies  a hashing method that is no longer considered strong enough for use\nwith new passphrases.  crypt will still authenticate a passphrase against this setting,\nbut if authentication succeeds, the passphrase should be re-hashed using the  currently\npreferred method.\n\nCRYPTSALTTOOCHEAP (Not implemented, yet)\nsetting  specifies  cost  parameters  that  are  considered  too cheap for use with new\npassphrases.  crypt will still authenticate a passphrase against this setting,  but  if\nauthentication  succeeds,  the  passphrase should be re-hashed using the currently pre‐\nferred method.\n",
            "subsections": []
        },
        "FEATURE TEST MACROS": {
            "content": "<crypt.h> will define the macro CRYPTCHECKSALTAVAILABLE if cryptchecksalt is available  in\nthe current version of libxcrypt.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Since  full configurability is not yet implemented, the current implementation will only ever\nreturn CRYPTSALTOK (0) or CRYPTSALTINVALID when invoked.\n",
            "subsections": []
        },
        "PORTABILITY NOTES": {
            "content": "The function cryptchecksalt is not part of any standard.  It was added to libxcrypt in  ver‐\nsion 4.3.0.\n",
            "subsections": []
        },
        "ATTRIBUTES": {
            "content": "For an explanation of the terms used in this section, see attributes(7).\n┌─────────────────┬───────────────┬─────────┐\n│ Interface       │ Attribute     │ Value   │\n├─────────────────┼───────────────┼─────────┤\n│ cryptchecksalt │ Thread safety │ MT-Safe │\n└─────────────────┴───────────────┴─────────┘\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "crypt(3), cryptgensalt(3), crypt(5)\n\nlibxcrypt                                 November 8, 2018                        CRYPTCHECKSALT(3)",
            "subsections": []
        }
    },
    "summary": "cryptchecksalt — validate a crypt setting string",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "crypt",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/crypt/3/json"
        },
        {
            "name": "cryptgensalt",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/cryptgensalt/3/json"
        },
        {
            "name": "crypt",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/crypt/5/json"
        }
    ]
}