java.lang.Object
org.codelibs.jcifs.smb.util.Crypto
Cryptographic utility class providing encryption and decryption functionality for jCIFS.
Handles security provider initialization and cryptographic operations for SMB authentication.
- Author:
- mbechler
-
Method Summary
Modifier and TypeMethodDescriptionstatic CiphergetArcfour(byte[] key) Get an RC4 cipher instance initialized with the specified key.static CiphergetDES(byte[] key) Get a DES cipher in encryption modestatic MessageDigestgetHMACT64(byte[] key) Get an HMACT64 message authentication code instance.static MessageDigestgetMD4()Get an MD4 message digest instance.static MessageDigestgetMD5()Get an MD5 message digest instance.static ProviderDefault provider is BouncyCastleProvider.static MessageDigestGet a SHA-512 message digest instance.static voidinitProvider(Provider customProvider) Initialize Provider Instance with customProvider
-
Method Details
-
getMD4
Get an MD4 message digest instance.- Returns:
- MD4 digest instance
-
getMD5
Get an MD5 message digest instance.- Returns:
- MD5 digest instance
-
getSHA512
Get a SHA-512 message digest instance.- Returns:
- SHA512 digest instance
-
getHMACT64
Get an HMACT64 message authentication code instance.- Parameters:
key- the key for the HMACT64 MAC- Returns:
- HMACT64 MAC instance
-
getArcfour
Get an RC4 cipher instance initialized with the specified key.- Parameters:
key- the encryption key- Returns:
- RC4 cipher in encryption mode
-
getDES
Get a DES cipher in encryption mode- Parameters:
key- 7 or 8 byte DES key- Returns:
- DES cipher in encryption mode
-
getProvider
Default provider is BouncyCastleProvider. For registering custom provider- Returns:
- Provider
- See Also:
-
initProvider
Initialize Provider Instance with customProvider- Parameters:
customProvider- the custom cryptographic provider to use- Throws:
CIFSUnsupportedCryptoException- if Provider has already been initialized.
-