salt.modules.hashutil

A collection of hashing and encoding functions

salt.modules.hashutil.base64_decodestring(instr)

Decode a base64-encoded string

New in version 2014.7.0.

CLI Example:

salt '*' hashutil.base64_decodestring 'Z2V0IHNhbHRlZA==\n'
salt.modules.hashutil.base64_encodestring(instr)

Encode a string as base64

New in version 2014.7.0.

CLI Example:

salt '*' hashutil.base64_encodestring 'get salted'
salt.modules.hashutil.hmac_signature(string, shared_secret, challenge_hmac)

Verify a challenging hmac signature against a string / shared-secret

New in version 2014.7.0.

Returns a boolean if the verification succeeded or failed.

CLI Example:

salt '*' hashutil.hmac_signature 'get salted' 'shared secret' 'eBWf9bstXg+NiP5AOwppB5HMvZiYMPzEM9W5YMm/AmQ='
salt.modules.hashutil.md5_digest(instr)

Generate an md5 hash of a given string

New in version 2014.7.0.

CLI Example:

salt '*' hashutil.md5_digest 'get salted'
salt.modules.hashutil.sha256_digest(instr)

Generate an sha256 hash of a given string

New in version 2014.7.0.

CLI Example:

salt '*' hashutil.sha256_digest 'get salted'
salt.modules.hashutil.sha512_digest(instr)

Generate an sha512 hash of a given string

New in version 2014.7.0.

CLI Example:

salt '*' hashutil.sha512_digest 'get salted'