Expand description
Cryptographic primitives used by the NTLM family and SMB signing.
Thin re-export of the [smb_server_csp] crypto service provider. The active
backend is selected at compile time in smb-server-csp itself:
- default — RustCrypto crates (
libfeature), --no-default-features --features handrolled— bundled implementations.
Modules§
- sha256
- SHA-256 module alias for callers importing by path
(
crypto::sha256::sha256). - sha512
- SHA-512 module alias for callers importing by path.
Functions§
- aes128_
cmac - AES-CMAC over
dataunderkey([RFC 4493]) — SMB 3.x signing. - aes128_
encrypt_ block - Encrypt one 16-byte AES-128 block.
- aes128_
gmac - AES-128-GMAC authentication tag over
msgwithnonce([RFC4543]): the SMB 3.1.1 AES-GMAC signature ([MS-SMB2] §3.1.4.1). GMAC is AES-GCM with an empty plaintext and the message supplied as additional authenticated data; the 16-byte GCM tag is the signature. - aes128ccm_
open - AES-128-CCM open;
ciphertextcarries the trailing 16-byte tag. - aes128ccm_
seal - AES-128-CCM seal with an 11-byte nonce ([MS-SMB2] CCM variant).
- aes128gcm_
open - AES-128-GCM open;
ciphertextcarries the trailing 16-byte tag. - aes128gcm_
seal - AES-128-GCM seal: appends the 16-byte tag to the ciphertext.
nonce= 12 bytes from the transform header’s Nonce field;aad= the 32-byte header tail (MsgSize..SessionId end). - aes256ccm_
open - AES-256-CCM open;
ciphertextcarries the trailing 16-byte tag. - aes256ccm_
seal - AES-256-CCM seal with an 11-byte nonce ([MS-SMB2] CCM variant).
- aes256gcm_
open - AES-256-GCM open;
ciphertextcarries the trailing 16-byte tag. - aes256gcm_
seal - AES-256-GCM seal ([MS-SMB2] AES-256-GCM cipher); appends the 16-byte tag.
- des_
encrypt_ key7 - DES-ECB encrypt one block under a 56-bit NTLM key chunk.
- hmac_
md5 - HMAC-MD5 of
dataunderkey([RFC 2104]). - hmac_
sha256 - HMAC-SHA256 of
dataunderkey. - kdf_
counter_ mode_ hmac_ sha256 - SP800-108 counter-mode KDF with HMAC-SHA256 PRF ([MS-SMB2] §3.1.4.1): K(i) = HMAC-SHA256(key, [i]_32BE || label || 0x00 || context || [L]_32BE)
- md4
- MD4 digest ([RFC 1320]).
- md5
- MD5 digest ([RFC 1321]).
- nt_hash
- NT hash = MD4 of the UTF-16LE encoded password ([MS-NLMP] §3.3.1.1).
- ntlm_
mech_ list_ mic - NTLMSSP MIC for the SPNEGO mechListMIC ([RFC 4178] / [MS-NLMP] §3.4.6), matching samba’s calc_ntlmv2_key + ntlmssp_make_packet_signature:
- ntlmv1_
response - NTLMv1/LM response: three DES encryptions of the challenge under successive 7-byte chunks of the 21-byte expanded hash ([MS-NLMP] §3.3.1).
- rc4
- XOR
datawith the RC4 keystream generated fromkey([MS-NLMP] §3.2.5.1.2 session-key transport). - sha256
- SHA-256 digest ([FIPS 180-4]).
- sha512
- SHA-512 digest ([FIPS 180-4]).