CipherDecrypt(String, String, String, CipherAlgorithm, Mode, Padding, CipherOpts) Method |
Decrypt hex-encoded data using specified block cipher algorithm, mode and padding.
Namespace: CryptoSysPKIAssembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntaxpublic static string Decrypt(
string inputHex,
string keyHex,
string ivHex,
CipherAlgorithm cipherAlg,
Mode mode,
Padding pad = Padding.Default,
CipherOpts opts = CipherOpts.Default
)
Public Shared Function Decrypt (
inputHex As String,
keyHex As String,
ivHex As String,
cipherAlg As CipherAlgorithm,
mode As Mode,
Optional pad As Padding = Padding.Default,
Optional opts As CipherOpts = CipherOpts.Default
) As String
Parameters
- inputHex String
- Hex-encoded input data
- keyHex String
- Hex-encoded key representing exact key length
- ivHex String
- Hex-encoded IV representing exact block length, or "" for ECB mode or if IV is prefixed.
- cipherAlg CipherAlgorithm
- Cipher Algorithm
- mode Mode
- Cipher Mode
- pad Padding (Optional)
- Padding method to use
- opts CipherOpts (Optional)
- Advanced options. Use Cipher.Opts.PrefixIV
to expect the IV to be prepended to the input.
Return Value
StringDecrypted plaintex in hex-encoded string or empty string on error
RemarksInput data may be any even number of hex characters, but not zero.
Default padding is Pkcs5 for ECB and CBC mode and
NoPad for all other modes.
See Also