banr_bklrx.gifbanr_homex_ico.gif (1035 bytes)banr_howbuyx_ico.gif (1114 bytes)banr_descfrx_ico.gif (1119 bytes)banr_hascfrx_ico.gif (1223 bytes)

 

- DLL Functions and Error Codes -
RDEScipher | TDEScipher | DEScipher | HASHcipher

RDEScipher/DLL
ver 1.1

TDEScipher/DLL
ver 2.3

DEScipher/DLL
ver 1.4

HASHcipher/DLL
ver 3.0

RDEScipher/DLL Functions

   Context Management Functions:
AESCreateContext Create an RDEScipher/DLL context. You must have a valid context to access the RDEScipher/DLL functions. You can have multiple contexts active at the same time for processing separate data streams.
AESDestroyContext Destroys an RDEScipher/DLL context previously created by the function AESCreateContext. This function will securely erase the context data and free the associated memory block.
AESResetDir Clears the "Encrypt/Decrypt direction" of the specified context; required if a single context is to be used for both encryption and decryption.
AESResetIV Reset the feedback vector to the value of the Initialization Vector (IV) for the specified context.
AESReset An alias for the AESResetIV function.
AESInitialize Restore all settings to their initial conditions for the specified context.
   Context Properties and Configuration Functions: 
AESSetBlockSize Define the blocksize property for the specified context. The blocksize is the size of each data block. For Electronic Codebook (MODE_ECB), Cipher Block Chaining (MODE_CBC), and Output Feedback (MODE_OFB) modes of operation the value of blocksize must be sixteen bytes. The value can be from one to sixteen bytes for the Cipher Feedback (MODE_CFB) mode of operation.
AESGetBlockSize Get the blocksize property for the specified context.
AESSetAutoPadding Set the autopad property for the specified context. When the autopad property is TRUE, padding will be automatically added (or removed).
AESGetAutoPadding Get the autopad property for the specified context.
AESSetCipherMode Define the AES mode of operation for the specified context. RDEScipher currently (ver 1.1) supports the following modes of operation:
  • Electronic Codebook (MODE_ECB)
  • Cipher Block Chaining (MODE_CBC)
  • Cipher Feedback (MODE_CFB)
  • Output Feedback (MODE_OFB)
AESGetCipherMode Get the mode of operation for the specified context.
AESSetInitVector Set the initialization vector (IV) value for the specified context. A valid initialization vector is required for all modes of operation except Electronic Codebook (MODE_ECB).
AESSetIVFmHexStr Set the initialization vector (IV) for the specified context from a "Hex String" argument.
AESGetInitVector Get the initialization vector value for the specified context.
AESGetIVAsHexStr Get the value of the Init. Vector for the specified context as a "Hex String".
AESSetKeyAsBin Define the value and length of the key for the specified context. The length may be 128, 192 or 256 bits; the key itself is in binary format.
AESSetCipherKey An alias for the AESSetKeyAsBin function.
AESSetKeyFmHexStr Define the value and length of the key for the specified context. The length may be 128, 192 or 256 bits; the key itself is a "Hex String" argument.
AESGetKeyAsBin Get the value of the key and its length for the specified context; the key value is in binary format.
AESGetCipherKey An alias for the AESGetKeyAsBin function.
AESGetKeyAsHexStr Get the value of the key and its length for the specified context; the key value is a "Hex String".
   Encryption and Decryption Functions: 
AESEncryptBlock Encrypt the specified number of bytes of the input buffer into the output buffer using the properties defined for the specified context.
AESEncryptHexToHex Encrypt an input string of hex chars, and return the result as a string of hex chars using the properties defined for the specified context.
AESDecryptBlock Decrypt the specified number of bytes of the input buffer into the output buffer using the properties defined for the specified context.
AESDecryptHexToHex Decrypt an input string of hex chars, and return the result as a string of hex chars using the properties defined for the specified context.

RDEScipher/DLL Error Codes

RDEScipher/DLL functions return a value upon completion. The return value should be tested to determine if the operation completed successfully. 

Error Description
AES_OKAY Normal status - no errors.
AES_ERRINVCONTEXT The supplied context value is invalid.
AES_ERRINVKEYLEN The key input is invalid.
AES_ERRKEYUNDEF No key value has been assigned to this context.
AES_ERRINVIVLEN The IV input is invalid.
AES_ERRIVUNDEF No IV has been assigned to this context.
AES_ERRNULLINPUT One of the arguments is null (un-allocated).
AES_ERRBLOCKSIZEBAD The blocksize and cipher mode are inconsistent with each other for this context.
AES_ERRINVBLOCKSIZE The blocksize input argument is invalid.
AES_ERRBLKSZINCTBAD The blocksize and input count are inconsistent with each other
AES_ERRINVMODE The cipher mode input argument is invalid.
AES_ERRINVALIDOP An invalid operation was attempted with this context.
AES_ERRINVPADDING An error has occurred in auto padding the input.
AES_ERRINVPARAM The value of a parameter is outside limits allowed by the system.
AES_ERRINVARG The value of an argument is invalid.
AES_ERRHEXSTR The input string is not a valid "hex string"
AES_ERRMALLOC The system failed to allocate the requested memory.

TDEScipher/DLL

TDEScipher/DLL Functions

DESCreateContext Create a TDEScipher/DLL context. You must have a valid context to access the TDEScipher/DLL functions. You can have multiple contexts active at the same time for processing separate data streams.
DESDecrypt Decrypt the specified number of bytes of the input buffer into the output buffer using the key and initialization vector defined for the specified context.
DESDecryptHexToHex
(in version 2.3)
Decrypt an input string of hex chars, and return the result as a string of hex chars using the key(s) and Init. Vector defined for the specified context.
DESDestroyContext Destroys a T DEScipher/DLL context previously created by the function DESCreateContext. This function will securely erase the context data and free the associated memory block.
DESEncrypt Encrypt the specified number of bytes of the input buffer into the output buffer using the key and initialization vector defined for the specified context.
DESEncryptHexToHex
(in version 2.3)
Encrypt an input string of hex chars, and return the result as a string of hex chars using the key(s) and Init. Vector defined for the specified context.
DESGetBlocksize Return the blocksize value for the specified context.
DESGetCipherKey Return the value of cipher key one for the specified context.
DESGetCipherKey2 Return the value of cipher key two for the specified context.
DESGetCipherKey3 Return the value of cipher key three for the specified context.
DESGetKeysAsHexStr
(in version 2.3)
Return the value of all cipher keys for the specified context as a "Hex String".
DESGetCipherMode Return the mode of operation for the specified context.
DESGetInitVector Return the initialization vector value for the specified context.
DESGetIVAsHexStr
(in version 2.3)
Return the value of the Init. Vector for the specified context as a "Hex String".
DESGetParityCheck Return the parity check value for the specified context.
DESReset Reset the encryption engine to the start state for the specified context.
DESSetBlocksize Define the blocksize value for the specified context. The blocksize is the size of each data block (in bytes). For Electronic Codebook (MODE_ECB), Cipher Block Chaining (MODE_CBC), Triple Electronic Codebook (MODE_TECB), and Triple Cipher Block Chaining (MODE_TCBC) modes of operation the value of blocksize must be eight bytes. The value can be from one to eight bytes for Cipher Feedback (MODE_CFB), Output Feedback (MODE_OFB), Triple Cipher Feedback (MODE_TCFB), and Triple Output Feedback (MODE_TOFB) modes of operation.
DESSetCipherKey Define the value of the cipher key for DES modes for the specified context. For Triple DES modes of operation this function defines the key value used in the first round. The cipher key value is eight bytes in length but only 56 bits of the key value are actually used in the DES algorithm. The remaining eight bits are used for parity check.
DESSetCipherKey2 Define the value for cipher key two for the specified context. Used only for Triple DES modes.
DESSetCipherKey3 Define the value for cipher key three for the specified context. Used only for Triple DES modes.
DESSetKeysFmHexStr
(in version 2.3)
Define one or 3 cipher keys for the specified context using a "Hex String" argument.
DESSetCipherMode Define the DES mode of operation for the specified context. TDEScipher supports the following modes of operation:
  • DES Modes:
    • Electronic Codebook (MODE_ECB)
    • Cipher Block Chaining (MODE_CBC)
    • Cipher Feedback (MODE_CFB)
    • Output Feedback (MODE_OFB)
  • Triple DES Modes:
    • Triple Electronic Codebook (MODE_TECB)
    • Triple Cipher Block Chaining (MODE_TCBC)
    • Triple Cipher Feedback (MODE_TCFB)
    • Triple Output Feedback (MODE_TOFB)
DESSetInitVector Define the initialization vector (IV) value for the specified context. A valid initialization vector is required for all modes of operation except Electronic Codebook (MODE_ECB) and Triple Electronic Codebook (MODE_TECB).
DESSetIVFmHexStr
(in version 2.3)
Define the Init. Vector for the specified context using a "Hex String" argument.
DESSetKeyParityOdd Set the cipher key buffer to odd parity.
DESAllKeysParityOdd
(added in version 2.2)
Set all of the keys to odd parity for the specified context.
DESSetParityCheck Define the parity check value for the specified context. The parity check only applies when setting the cipher key value. This operation is provided for compatibility with hardware DES implementations. If parity check is set to CHECK_PARITY an error code will be returned if a key without odd parity is specified in DESSetCipherKey.

TDEScipher/DLL Error Codes

TDEScipher/DLL functions return an error code upon completion. The return values should be tested to determine if the operation completed successfully. 

Error Description
DES_OKAY Normal status - no errors.
DES_ERRINVCONTEXT The specified context is invalid.
DES_ERRWEAKKEY The specified key belongs to the set of "weak keys" and is therefore not secure.
DES_ERRKEYUNDEF Invalid cipher key value (key 1 for triple-DES modes).
DES_ERRKEY2UNDEF Invalid cipher key value for key 2.
DES_ERRKEY3UNDEF Invalid cipher key value for key 3.
DES_ERRIVUNDEF Invalid initialization vector.
DES_ERRBADBLOCKSIZE The blocksize value is invalid.
DES_ERRBLOCKSIZEUNDEF Invalid blocksize value.
DES_ERRMODEUNDEF The mode of operation has not been defined.
DES_ERRINVMODE Invalid DES or triple-DES mode of operation.
DES_ERRKEYPARITY The cipher key does not have odd parity.
DES_ERRHEXSTR
(in version 2.3)
Error in the hex input string argument, or its associated count value

DEScipher/DLL Functions

DESCreateContext Create a DEScipher/DLL context. You must have a valid context to access the DEScipher/DLL functions. You can have multiple contexts active at the same time for processing separate data streams.
DESDecrypt Decrypt the specified number of bytes of the input buffer into the output buffer using the key and initialization vector defined for the specified context.
DESDestroyContext Destroys a DEScipher/DLL context previously created by the function DESCreateContext. This function will securely erase the context data and free the associated memory block.
DESEncrypt Encrypt the specified number of bytes of the input buffer into the output buffer using the key and initialization vector defined for the specified context.
DESGetBlocksize Returns the current blocksize value for the specified context.
DESGetCipherKey Returns the current cipher key value for the specified context.
DESGetCipherMode Returns the current DES mode of operation for the specified context.
DESGetInitVector Returns the current initialization vector for the specified context. 
DESGetParityCheck Returns the parity check value for the specified context.
DESReset Reset the encryption engine to the start state for the specified context.
DESSetBlocksize Set the blocksize value for the specified context. DES is a block cipher - that is, it processes data in blocks. The blocksize is the size of each data block (in bytes). For Electronic Codebook (MODE_ECB) and Cipher Block Chaining (MODE_CBC) modes of operation the value of blocksize must be eight bytes. The value can be from one to eight bytes for Cipher Feedback (MODE_CFB) and Ouput Feedback (MODE_OFB) modes of operation.
DESSetCipherKey Set the cipher key value for the specified context. The cipher key value is eight bytes in length but only 56 bits of the key value are actually used in the DES algorithm. The LSB of each byte in the cipher key is used for parity. If parity checking is active (see DESSetParityCheck) an error code will be returned if the key value does not have odd parity.
DESSetCipherMode Set the DES mode of operation for the specified context. There are four modes of DES encryption :
  • Electronic Codebook (MODE_ECB)
  • Cipher Block Chaining (MODE_CBC)
  • Cipher Feedback (MODE_CFB)
  • Output Feedback (MODE_OFB)
DESSetInitVector Set the initialization vector (IV) value for the specified context. A valid IV is required for all modes of operation except Electronic Codebook (MODE_ECB).
DESSetKeyParityOdd Set the cipher key buffer to odd parity.
DESSetParityCheck Set the parity check value for the specified context. The parity check only applies when setting the cipher key value. This operation is provided for compatibility with DES hardware implementations. If parity check is set to CHECK_PARITY an error code will be returned if a key without odd parity is specified in DESSetCipherKey.

DEScipher/DLL Error Codes
DEScipher/DLL functions return an error code upon completion. The return values should be tested to determine if the operation completed successfully. 
Error Description
DES_OKAY Normal status - no errors.
DES_ERRINVCONTEXT The specified context is invalid.
DES_ERRWEAKKEY The specified key belongs to the set of "weak keys" and is therefore not secure.
DES_ERRKEYUNDEF You have not specified a valid cipher key value.
DES_ERRIVUNDEF You have not specified a valid initialization vector.
DES_ERRBADBLOCKSIZE The blocksize value is invalid.
DES_ERRBLOCKSIZEUNDEF You have not specified a valid blocksize value.
DES_ERRMODEUNDEF You have not specified a valid DES mode of operation.
DES_ERRINVMODE You have specified an invalid DES mode of operation.
DES_ERRKEYPARITY The cipher key does not have odd parity.

HASHcipher/DLL Functions

SHACreateContext Create a HASHcipher context using the SHA hash algorithm. A valid context must exist to access the HASHcipher functions. Multiple contexts may be active at the same time for processing separate data streams.
SHADestroyContext

Destroy a HASHcipher context previously created by SHACreateContext. This function will securely erase the context data, and free the associated block of memory.

SHAFile
(in version 3.0)
Calculate the SHA hash value of the specified file, and return the result as a hex string.
SHAFinalize

Finalize the hash value - SHAFinalize must be called to compute a valid hash value, and hash values are not accessible until it has been called.

SHAGetHashValue Retrieve the current hash values as long integers. A complete hash value is comprised of five long integers. SHAGetHashValue will retrieve a single long integer on each call. The complete hash array is retrieved by calling the function five times (index from one to five).
SHAGetHashString Retrieve the current hash value array as a string of dash-delimited hexadecimal character strings. The entire string represents the complete hash value array, is 44 characters in length (including the null terminator) and is comprised of five eight-character hexadecimal strings separated by the dash character ‘-‘. Each eight-character hexadecimal string represents one of the five hash array values.
SHAInitialize

Initialize the hash module to the start state for the specified context. SHAInitialize requires a valid, previously created HASHcipher context with the SHACreateContext function.

SHAUpdateHash

Update the current hash value for the specified context. The parameter count must contain the number of characters to process. The hash values are not accessible for a context until SHAFinalize has been called.

MD5CreateContext
(in version 3.0)
Create a HASHcipher context using the MD5 hash algorithm. A valid context must exist to access the HASHcipher functions. Multiple contexts may be active at the same time for processing separate data streams.
MD5DestroyContext
(in version 3.0)

Destroy a HASHcipher context previously created by MD5CreateContext. This function will securely erase the context data, and free the associated block of memory.

MD5File
(in version 3.0)
Calculate the MD5 hash value of the specified file, and return the result as a hex string.
MD5Finalize
(in version 3.0)

Finalize the hash value - MD5Finalize must be called to compute a valid hash value, and hash values are not accessible until it has been called.

MD5GetHashValue
(in version 3.0)
Retrieve the current hash values as long integers. A complete hash value is comprised of four long integers. MD5GetHashValue will retrieve a single long integer on each call. The complete hash array is retrieved by calling the function four times.
MD5GetHashString
(in version 3.0)
Retrieve the current hash value array as a string of dash-delimited hexadecimal character strings. The entire string represents the complete hash value array, is 35 characters in length (including the null terminator) and is comprised of four eight-character hexadecimal strings separated by the dash character ‘-‘. Each eight-character hexadecimal string represents one of the five hash array values.
MD5Initialize
(in version 3.0)

Initialize the hash module to the start state for the specified context. SHAInitialize requires a valid, previously created HASHcipher context with the SHACreateContext function.

MD5UpdateHash
(in version 3.0)

Update the current hash value for the specified context. The parameter count must contain the number of characters to process. The hash values are not accessible for a context until SHAFinalize has been called.

HASHcipher/DLL Error Codes

HASHcipher/DLL functions return an error code upon completion. The return values should be tested to determine if the operation completed successfully. 
Error Description
HASH_OKAY No errors have been encountered.
HASH_ERRINVCONTEXT The specified context is not valid.
HASH_ERRNOTINIT The specified context has not been initialized. The context must be initialized by *Initialize before *UpdateHash or *Finalize can be called.
HASH_ERRINVINDEX The index value passed to *GetHashValue is outside the acceptable range. The index value must be a value in the range 1 through 5 for SHA, 1 through 4 for MD5.
HASH_ERRNOTFINAL The specified context has not been finalized. The function *Finalize must be called to generate valid hash values.
HASH_ERRINVCOUNT The byte count specified to *UpdateHash is not valid.
HASH_ERRFILESPEC Invalid file specification for SHAFile or MD5File
HASH_ERRCRTCONTEXT Unable to create a valid context of the HASHcipher/DLL


OPTIONS:
.
HOME | RESOURCE PAGE | BACK TO TDEScipher PAGE | BACK TO HASHcipher PAGE  


Copyright ©, 1995-2001 Bokler Software Corp. All rights reserved. DEScipher, TDEScipher and HASHcipher are trademarks of Bokler Software Corp. The "animated_cipher.gif" is copyrighted by Bokler Software Corp. Microsoft, Windows, Visual Basic, Visual C++ and ActiveX are trademarks of Microsoft Corp.