Click or drag to resize

CipherEncrypt(String, String, String, CipherAlgorithm, Mode, Padding, CipherOpts) Method

Encrypt hex-encoded data using specified block cipher algorithm, mode and padding.

Namespace: CryptoSysPKI
Assembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntax
public static string Encrypt(
	string inputHex,
	string keyHex,
	string ivHex,
	CipherAlgorithm cipherAlg,
	Mode mode,
	Padding pad = Padding.Default,
	CipherOpts opts = CipherOpts.Default
)

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
cipherAlg  CipherAlgorithm
Cipher Algorithm
mode  Mode
Cipher Mode
pad  Padding  (Optional)
Padding method to use (optional)
opts  CipherOpts  (Optional)
Advanced options. Use Cipher.Opts.PrefixIV to prepend the IV to the output.

Return Value

String
Encrypted ciphertext in hex-encoded string or empty string on error
Remarks
Input 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