3d browser

LB3Help_TCodec

Return to Help home page

TCodec

The TCodec component is a device which encodes and decodes (hence the word codec is derived similiary to the way the word modem is derived). A TCodec encapsulates an encryption key, and refers to a encryption cipher, a block chaining mode (in the case of block-mode ciphers). The features of a TCodec include:

  • Abstracts away the selection of cipher and chaining mode. All encryption and decryption operations have the same call, irrespective of the choice of cipher or chaining mode.
  • Works with both Symetric ciphers and Asymetric ciphers.
  • Stores and encapsulates password (symetric ciphers only) strings and the underlying binary keys as applicable to the cipher.
  • Facilitates progress bar utilisation for long encrypts/decrypts
  • Facilitates user driven abort for long encrypts/decrypts
  • Key generation for asymetric ciphers, including progress bar and abort opportunities
  • Comes in two flavours: Component (TCodec) or interface pointer (ICodec), depending on your preferred style of programming.
  • Collects metrics on encryption/decryption operations
  • Automatic and transparent management of IV's for block-mode ciphers (except for ECB mode or so designated). IV's are nonced and the nonce prepended to the input encryption stream.
  • Automatic and transparent salting of messages to provide at a miminum of 64 bits of salt. Salting occurs:
    • For stream mode ciphers (except Compressors, Converters or any cipher designated as not needing salting).
    • For block mode ciphers (except when chaining mode is ECB or so designated)
  • Block-mode ciphers are adapted to give the TCodec user a simple stream-mode interface. The necessary block quantisation (padding, key-streaming, ciphertext stealing) techniique is intelligently depending on the choice of cipher, chaining mode and message length, to yield optimum security with mimimum overhead.

Properties and data members

FGenerateAsymetricKeyPairProgress_CountPrimalityTests: integer;
property Key: TSymetricKey
property StreamCipherId: string
property BlockCipherId: string
property ChainModeId: string
property Password: string
property Mode: TCodecMode
property isUserAborted: boolean
property CountBytesProcessed: int64
property EstimatedWorkLoad : int64
property Duration : TDateTime
function Speed : inteer
property Cipher: string
property ChainMode: string
property AsymetricKeySizeInBits: cardinal

Methods

procedure Burn/Reset;
procedure SaveKeyToStream[ Store: TStream];
procedure InitFromStream/Key/GeneratedAsymetricPair[ Store: TStream];
procedure Begin/End_Enc/DecryptMemory[ CipherText{out}: TStream];
procedure Enc/DecryptMemory[ const Plaintext; PlaintextLen: integer];
procedure Enc/DecryptStream[ Plaintext, CipherText: TStream];
procedure Enc/DecryptFile[ const Plaintext_FileName, CipherText_FileName: string];
procedure Enc/Decrypt[Ansi]String const Plaintext: string; var CipherText_Base64: ansistring;
function isAsymetric: boolean;
function Speed: integer;

Events

property CryptoLibrary: TCryptographicLibrary
property OnProgress : TOnHashProgress

Component Relationships

banana banana banana