CryptoSys API Library Manual

BLF_FileExt

Encrypts or decrypts a file using a specified mode with extended options.

VBA/VB6 Syntax

Public Declare Function BLF_FileExt Lib "diCryptoSys.dll" (ByVal strFileOut As String, ByVal strFileIn As String, ByRef lpKey As Byte, ByVal nKeyLen As Long, ByVal bEncrypt As Boolean, ByVal strMode As String, ByRef lpInitV As Byte, ByVal nOptions As Long) As Long

nRet = BLF_FileExt(strFileOut, strFileIn, abKey(0), nKeyLen, bEncrypt, strMode, abInitV(0), nOptions)

C/C++ Syntax

long __stdcall BLF_FileExt(const char *szFileOut, const char *szFileIn, const unsigned char *lpKey, long keyBytes, int fEncrypt, const char *szMode, const unsigned char *lpIV, long nOptions);

Parameters

szFileOut
[in] with the full path name of the output file to be created.
szFileIn
[in] with the full path name of the input file to be processed.
lpKey
[in] array containing the key.
keyBytes
[in] containing the length of the key in bytes.
fEncrypt
[in] direction flag: set as ENCRYPT (True) to encrypt or DECRYPT (False) to decrypt.
szMode
[in] specifying the confidentiality mode:
"ECB" for Electronic Codebook mode,
"CBC" for Cipher Block Chaining mode,
"CFB" for 64-bit Cipher Feedback mode,
"OFB" for Output Feedback mode, or
"CTR" for Counter mode.
lpIV
[in] array containing the initialization vector (IV), or zero (0) for ECB mode.
nOptions
[in] option flags:
Zero (0) for default behaviour as per BLF_File.
API_IV_PREFIX to prepend the IV before the ciphertext in the output file (ignored for ECB mode)
API_PAD_LEAVE to leave any padding in place when decrypting (ECB and CBC modes only; ignored if encrypting)

Returns (VBA/C)

If successful, the return value is 0; otherwise it returns a non-zero error code.

.NET Equivalent

Blowfish.FileEncrypt Method (String, String, Byte[], Mode, Byte[], CipherFileOption)
Blowfish.FileDecrypt Method (String, String, Byte[], Mode, Byte[], CipherFileOption)

Remarks

For the default behaviour, see BLF_File. The options are ignored if not applicable. For more information on the behaviour of the options, see Extensions to block cipher functions for files.

Example



See Also

BLF_File

[Contents] [Index]

[PREV: BLF_File...]   [Contents]   [Index]   
   [NEXT: BLF_FileHex...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.