CryptoSys PKI Pro Manual

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

Encrypt data block in byte array.

Syntax

[C#]
public static byte[] Encrypt(
	byte[] input,
	byte[] key,
	byte[] iv,
	CipherAlgorithm cipherAlg,
	Mode mode
)
[VB.NET]
Public Shared Function Encrypt ( _
	input As Byte(), _
	key As Byte(), _
	iv As Byte(), _
	cipherAlg As CipherAlgorithm, _
	mode As Mode _
) 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

Return Value

Ciphertext in byte array or empty array on error

Remarks

For ECB and CBC modes, input data length must be an exact multiple of the block length.

See Also

VB6/C equivalent: CIPHER_Bytes

[Contents] [Index]

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

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.