Class TOlfCryptDecrypt

Unit

Declaration

type TOlfCryptDecrypt = class(TObject)

Description

Simple class to crypt and decrypt buffers.

This unit contains very simple cryptographic algorithms. DON't USE THEM FOR SENSIBLE DATAS !!!

Check those projects if you need a more robust algorithm :

- Delphi Encryption Compendium https://github.com/MHumm/DelphiEncryptionCompendium

- TMS Cryptographic Pack https://www.tmssoftware.com/site/tmscrypto.asp

Hierarchy

Overview

Methods

Public function XORCrypt(Const AStream: TStream): TMemoryStream; overload;
Public class function XORCrypt(Const AStream: TStream; Const AKeys: TByteDynArray) : TMemoryStream; overload;
Public function XORDecrypt(Const AStream: TStream): TMemoryStream; overload;
Public class function XORDecrypt(Const AStream: TStream; Const AKeys: TByteDynArray): TMemoryStream; overload;
Public class function GenXORKey(Const Size: word): TByteDynArray;
Public function SwapCrypt(Const AStream: TStream): TMemoryStream; overload;
Public class function SwapCrypt(Const AStream: TStream; Const AKeys: TByteDynArray) : TMemoryStream; overload;
Public function SwapDecrypt(Const AStream: TStream): TMemoryStream; overload;
Public class function SwapDecrypt(Const AStream: TStream; Const AKeys: TByteDynArray): TMemoryStream; overload;
Public class function GenSwapKey: TByteDynArray;
Public function ShiftCrypt(Const AStream: TStream): TMemoryStream; overload;
Public class function ShiftCrypt(Const AStream: TStream; const AKeys: TIntegerDynArray): TMemoryStream; overload;
Public function ShiftDecrypt(Const AStream: TStream): TMemoryStream; overload;
Public class function ShiftDecrypt(Const AStream: TStream; const AKeys: TIntegerDynArray): TMemoryStream; overload;
Public class function GenShiftKey(Const Size: word): TIntegerDynArray;
Public function IDBCrypt(Const AStream: TStream): TMemoryStream; overload;
Public class function IDBCrypt(Const AStream: TStream; const AKeys: TIntegerDynArray): TMemoryStream; overload;
Public function IDBDecrypt(Const AStream: TStream): TMemoryStream; overload;
Public class function IDBDecrypt(Const AStream: TStream; const AKeys: TIntegerDynArray): TMemoryStream; overload;
Public class function GenIDBKey(Const Size: word): TIntegerDynArray;
Public constructor Create; overload;
Public constructor Create(Const AKeys: TByteDynArray); overload;
Public constructor Create(Const AKeys: TIntegerDynArray); overload;
Public function Crypt(Const AStream: TStream): TStream; overload; deprecated 'Use XORCrypt()';
Public class function Crypt(Const AStream: TStream; Const AKeys: TByteDynArray) : TStream; overload; deprecated 'Use XORCrypt()';
Public function Decrypt(Const AStream: TStream): TStream; overload; deprecated 'Use XORDecrypt()';
Public class function Decrypt(Const AStream: TStream; Const AKeys: TByteDynArray) : TStream; overload; deprecated 'Use XORDecrypt()';

Properties

Public property ByteKeys: TByteDynArray read FByteKeys write SetByteKeys;
Public property IntegerKeys: TIntegerDynArray read FIntegerKeys write SetIntegerKeys;

Description

Methods

Public function XORCrypt(Const AStream: TStream): TMemoryStream; overload;

use XOR operand to crypt a buffer with the keys buffer property

You can use the program at https://xorkeysgenerator.olfsoftware.fr/ to generate a compatible XOR keys buffer.

Public class function XORCrypt(Const AStream: TStream; Const AKeys: TByteDynArray) : TMemoryStream; overload;

use XOR operand to crypt a buffer with a keys buffer

You can use the program at https://xorkeysgenerator.olfsoftware.fr/ to generate a compatible XOR keys buffer.

Public function XORDecrypt(Const AStream: TStream): TMemoryStream; overload;

use XOR operand to decrypt a buffer with the keys buffer property

You can use the program at https://xorkeysgenerator.olfsoftware.fr/ to generate a compatible XOR keys buffer.

Public class function XORDecrypt(Const AStream: TStream; Const AKeys: TByteDynArray): TMemoryStream; overload;

use XOR operand to decrypt a buffer with a keys buffer

You can use the program at https://xorkeysgenerator.olfsoftware.fr/ to generate a compatible XOR keys buffer.

Public class function GenXORKey(Const Size: word): TByteDynArray;

Export a key as an array of random bytes

Public function SwapCrypt(Const AStream: TStream): TMemoryStream; overload;

exchange bytes between a buffer to crypt and the property key

You can use the program at https://swapkeysgenerator.olfsoftware.fr/ to generate a compatible Swap keys buffer.

Public class function SwapCrypt(Const AStream: TStream; Const AKeys: TByteDynArray) : TMemoryStream; overload;

exchange bytes between a buffer to crypt and the key parameter

You can use the program at https://swapkeysgenerator.olfsoftware.fr/ to generate a compatible Swap keys buffer.

Public function SwapDecrypt(Const AStream: TStream): TMemoryStream; overload;

exchange bytes between a buffer to uncrypt and the property key

You can use the program at https://swapkeysgenerator.olfsoftware.fr/ to generate a compatible Swap keys buffer.

Public class function SwapDecrypt(Const AStream: TStream; Const AKeys: TByteDynArray): TMemoryStream; overload;

exchange bytes between a buffer to uncrypt and the key parameter

You can use the program at https://swapkeysgenerator.olfsoftware.fr/ to generate a compatible Swap keys buffer.

Public class function GenSwapKey: TByteDynArray;

Export a key as an array of 256 random bytes

Public function ShiftCrypt(Const AStream: TStream): TMemoryStream; overload;
 
Public class function ShiftCrypt(Const AStream: TStream; const AKeys: TIntegerDynArray): TMemoryStream; overload;
 
Public function ShiftDecrypt(Const AStream: TStream): TMemoryStream; overload;
 
Public class function ShiftDecrypt(Const AStream: TStream; const AKeys: TIntegerDynArray): TMemoryStream; overload;
 
Public class function GenShiftKey(Const Size: word): TIntegerDynArray;
 
Public function IDBCrypt(Const AStream: TStream): TMemoryStream; overload;
 
Public class function IDBCrypt(Const AStream: TStream; const AKeys: TIntegerDynArray): TMemoryStream; overload;
 
Public function IDBDecrypt(Const AStream: TStream): TMemoryStream; overload;
 
Public class function IDBDecrypt(Const AStream: TStream; const AKeys: TIntegerDynArray): TMemoryStream; overload;
 
Public class function GenIDBKey(Const Size: word): TIntegerDynArray;
 
Public constructor Create; overload;

Create an instance of TOlfCryptDecrypt class

Public constructor Create(Const AKeys: TByteDynArray); overload;

Create an instance of TOlfCryptDecrypt class and fill its key buffer as bytes

Public constructor Create(Const AKeys: TIntegerDynArray); overload;

Create an instance of TOlfCryptDecrypt class and fill its key buffer as integers

Public function Crypt(Const AStream: TStream): TStream; overload; deprecated 'Use XORCrypt()';

Warning: this symbol is deprecated: Use XORCrypt()

DEPRECATED - internally use XORCrypt

Public class function Crypt(Const AStream: TStream; Const AKeys: TByteDynArray) : TStream; overload; deprecated 'Use XORCrypt()';

Warning: this symbol is deprecated: Use XORCrypt()

DEPRECATED - internally use XORCrypt

Public function Decrypt(Const AStream: TStream): TStream; overload; deprecated 'Use XORDecrypt()';

Warning: this symbol is deprecated: Use XORDecrypt()

DEPRECATED - internally use XORDecrypt

Public class function Decrypt(Const AStream: TStream; Const AKeys: TByteDynArray) : TStream; overload; deprecated 'Use XORDecrypt()';

Warning: this symbol is deprecated: Use XORDecrypt()

DEPRECATED - internally use XORDecrypt

Properties

Public property ByteKeys: TByteDynArray read FByteKeys write SetByteKeys;

buffer of bytes used as a key by Crypt/Decrypt functions

Public property IntegerKeys: TIntegerDynArray read FIntegerKeys write SetIntegerKeys;

buffer of integers used as a key by Crypt/Decrypt functions

My libraries for Delphi (c) 1990-2025 Patrick PREMARTIN - Powered by PasDoc
Generated by PasDoc 0.16.0.