CryptoSys PKI Pro Manual

Cipher.Encrypt Method (Byte[], Byte[], Byte[], CipherAlgorithm, Mode, Padding)

Encrypt data in a byte array using the specified block cipher algorithm, mode and padding.

Syntax

[C#]
public static byte[] Encrypt(
	byte[] input,
	byte[] key,
	byte[] iv,
	CipherAlgorithm cipherAlg,
	Mode mode,
	Padding pad
)
[VB.NET]
Public Shared Function Encrypt ( _
	input As Byte(), _
	key As Byte(), _
	iv As Byte(), _
	cipherAlg As CipherAlgorithm, _
	mode As Mode, _
	pad As Padding _
) As Byte()

Parameters

input
Input data to be encrypted
key
Key of exact length for block cipher algorithm
iv
Initialization Vector (IV) of exactly the block size or null for ECB mode
cipherAlg
Type: CipherAlgorithm
Cipher algorithm
mode
Type: Mode
Cipher mode
pad
Type: Padding
Padding method to use

Return Value

Ciphertext in byte array or empty array on error

Remarks

Default padding is Pkcs5 for ECB and CBC mode and NoPad for all other modes.

See Also

VB6/C equivalent: CIPHER_EncryptBytes2

[Contents] [Index]

[PREV: Cipher.Encrypt Method (Byte, Byte, Byte, CipherAlgorithm, Mode)...]   [Contents]   [Index]   
   [NEXT: Cipher.Encrypt Method (Byte, Byte, Byte, CipherAlgorithm, Mode, Padding, Cipher.Opts)...]

Copyright © 2004-21 D.I. Management Services Pty Ltd. All rights reserved. Generated 2021-10-01T09:03:20Z.