Discuss this help topic in SecureBlackbox Forum

TElSymmetricCrypto.Encrypt

TElSymmetricCrypto     See also     


Filter: C#/Java  VB.NET  Pascal  C++  PHP  


Encrypts the data. This topic is under developmentā€¦

Declaration

[C#/Java]
    void Encrypt(System.IO.Stream InStream, System.IO.Stream OutStream);
    void Encrypt(byte[] InBuffer, int InIndex, int InSize, ref byte[] OutBuffer, int OutIndex, ref int OutSize);
    static byte[] Encrypt(int AlgID, byte[] Key, byte[] IV, TSBSymmetricCryptoMode Mode, byte[] Buffer);
    static byte[] Encrypt(int AlgID, byte[] Key, byte[] IV, TSBSymmetricCryptoMode Mode, byte[] Buffer, int Offset, int Count);

[VB.NET]
    Sub Encrypt(ByVal InStream As System.IO.Stream, ByVal OutStream As System.IO.Stream)
    Sub Encrypt(ByVal InBuffer As Byte(), ByVal InIndex As Integer, ByVal InSize As Integer, ByRef OutBuffer As Byte(), ByVal OutIndex As Integer, ByRef OutSize As Integer)
    Shared Function Encrypt(ByVal AlgID As Integer, ByVal Key As Byte(), ByVal IV As Byte(), ByVal Mode As TSBSymmetricCryptoMode, ByVal Buffer As Byte()) As Byte()
    Shared Function Encrypt(ByVal AlgID As Integer, ByVal Key As Byte(), ByVal IV As Byte(), ByVal Mode As TSBSymmetricCryptoMode, ByVal Buffer As Byte(), ByVal Offset As Integer, ByVal Count As Integer) As Byte()

[Pascal]
    procedure Encrypt(InBuffer : pointer; InSize : integer; OutBuffer : pointer; var OutSize : integer);
    procedure Encrypt(InStream, OutStream : TStream);
    class function Encrypt(AlgID : integer; const Key, IV : ByteArray; Mode : TSBSymmetricCryptoMode; Buffer : pointer; Size : integer) : ByteArray;

[C++]
    void Encrypt(void * InBuffer, int32_t InSize, void * OutBuffer, int32_t &OutSize);
    void Encrypt(TStream &InStream, TStream &OutStream);
    void Encrypt(TStream *InStream, TStream *OutStream);
    static void Encrypt(int32_t AlgID, const std::vector<uint8_t> &Key, const std::vector<uint8_t> &IV, TSBSymmetricCryptoMode Mode, void * Buffer, int32_t Size, std::vector<uint8_t> &OutResult);

[PHP]
    void Encrypt(TSBPointer|array of byte|string|NULL $InBuffer, integer $InSize, TSBPointer|array of byte|string|NULL $OutBuffer, integer &$OutSize)
    void Encrypt(TStream $InStream, TStream $OutStream)
    string Encrypt(integer $AlgID, array of byte|string|NULL $Key, array of byte|string|NULL $IV, integer $Mode, TSBPointer|array of byte|string|NULL $Buffer, integer $Size)

Parameters

  • AlgID - specifies algorithm identifier.
  • Buffer - buffer containing the data to be encrypted.
  • Size - size of the data block to be encrypted.
  • Offset - offset of the data to be encrypted in Buffer.
  • Count - number of bytes to be read from Buffer.
  • IV - specifies Initial Vector.
  • InBuffer - reference to the data to encrypt.
  • InIndex - Offset of the input data in the input array.
  • InSize - Size of input data in bytes.
  • InStream - the stream with the data for encryption.
  • Key - specifies the secret key.
  • Mode - specifies encryption mode.
  • OutBuffer - reference to buffer where encrypted data should be stored.
  • OutIndex - Offset in the output array, starting from which the data is written.
  • OutSize - Size of available space in OutBuffer in bytes.
  • OutStream - the stream to which the encrypted data will be written.

Mode values:

Return value

    Returns the encrypted data.

Description

    Use this method when you want to encrypt the data and you have all data for encryption at hand. This method is a shorthand for InitializeEncryption / EncryptUdpdate / FinalizeEncryption sequence of calls. Remember to set Padding mode when using block mode of block ciphers.

See also:     InitializeEncryption     FinalizeEncryption     EncryptUpdate     Decrypt     Padding    

Discuss this help topic in SecureBlackbox Forum