IMVCrypt

IMVCrypt Interface.

The MV Network Renderer Filter  and MV Network Source Filter  implements this interface.  The Interface returns some information about received network data.

Algorithm Get encryption algorithm
CreateKey Creates a key.
CreateKeyfile Creates a key file.
Enable Enable Encryption/Decryption.
GetKey Get the key.
KeyFilePath Get the key file path
KeyLength Get encryption key length in bytes
Mode Get encryption mode
OpenKeyfile Open a key file and load the key.
Padding Get padding mode
SetKey Set the key.
UseKeyFile Get the "Use Keyfile" flag

Header file: IMVCrypt.h
Interface definition language file: IMVCrypt.idl
Typelib: MVCrypt
Interface ID: IID_IMVCrypt


Property IMVCrypt::Algorithm

Declaration: Property Get/Put Algorithm As Long

Get encryption/decryption algorithm.

Algorithm Value Description
MV_CRYPTO_ALGORITHM_AES 0 AES (Rijndael)
MV_CRYPTO_ALGORITHM_BLOWFISH 1 Blowfish
MV_CRYPTO_ALGORITHM_TEA 2 Tea
Prototype:

HRESULT put_Algorithm(int value);
HRESULT get_Algorithm(int value);


Method IMVCrypt::CreateKey

Declaration: Sub CreateKey

Creates a new key with the current settings.

Prototype:

HRESULT CreateKey();


Method IMVCrypt::CreateKeyfile

Declaration: Sub CreateKeyfile(path As String)

Creates a new key with the current settings and saves the key into a keyfile.

Parameter:

path Path for the new keyfile.
Prototype:

HRESULT CreateKeyfile(STRING path);


Property IMVCrypt::Enable

Declaration: Property Get/Put Enable As Long

Enable Encryption/Decryption.

Prototype:

HRESULT put_Enable(int value);
HRESULT get_Enable(int* value);


Method IMVCrypt::GetKey

Declaration: Sub GetKey(maxLength As Long, length As Long, key As Byte)

Copies the current key into an array. Use the MAX_KEY_LENGTH (=1024) definition to create the array.

Parameter:

maxLength Size of the array from the key parameter
length Contains the current key size after return.
key Array for the current key.
Prototype:

HRESULT GetKey(int maxLength, int* length, byte* key);


Property IMVCrypt::KeyFilePath

Declaration: Property Get/Put KeyFilePath As String

Get/Set the keyfile path.

Prototype:

HRESULT put_KeyFilePath(BSTR value);
HRESULT get_KeyFilePath(BSTR* value);


Property IMVCrypt::KeyLength

Declaration: Property Get/Put KeyLength As Long

Get encryption key length in bytes

Prototype:

HRESULT put_KeyLength(int* value);
HRESULT get_KeyLength(int* value);


Property IMVCrypt::Mode

Declaration: Property Get/Put Mode As Long

Get encryption mode.

Mode Value Description
MV_CRYPTO_MODE_ECB 0 Electronic Code Book
MV_CRYPTO_MODE_CBC 1 Cipher Block Chaining
MV_CRYPTO_MODE_CFB 2 Cipher Feedback Block

Prototype:

HRESULT put_Mode(int value);
HRESULT get_Mode(int* value);


Method IMVCrypt::OpenKeyfile

Declaration: Sub OpenKeyfile(path As String)

Open a keyfile and load the key.

Parameter:

path Path to the keyfile.
Prototype:

HRESULT OpenKeyfile(BSTR path);


Property IMVCrypt::Padding

Declaration: Property Get/Put Padding As Long

Get padding mode

Mode Value Description
MV_CRYPTO_PADDING_ZEROS 0 Padding with zero values.
MV_CRYPTO_PADDING_BLANKS 1 Padding wuth blanks.
MV_CRYPTO_PADDING_PKCS7 2 Padding according to PKCS7
Prototype:

HRESULT put_Padding(int value);
HRESULT get_Padding(int* value);


Method IMVCrypt::SetKey

Declaration: Sub SetKey(length As Long, key As Byte)

Set the key.

Parameter:

length Legth of the new key in bytes.
key Array of length size with the new key.
Prototype:

HRESULT SetKey(LONG length, BYTE key);


Property IMVCrypt::UseKeyFile

Declaration: Property Get/Put UseKeyFile As Long

Get the "Use Keyfile" flag.

Prototype:

HRESULT put_UseKeyFile(int* value);
HRESULT put_UseKeyFile(int* value);