Interface PacketEncryption

All Known Implementing Classes:
AESEncryption

public interface PacketEncryption
An interface for encrypting packets. The outputLength should always be the same as the inputLength. This is because that's what the Minecraft vanilla protocol does.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    decrypt(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset)
    Decrypts the given data.
    void
    encrypt(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset)
    Encrypts the given data.
  • Method Details

    • decrypt

      void decrypt(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) throws Exception
      Decrypts the given data. Input and output arrays can be the same.
      Parameters:
      input - Input data to decrypt.
      inputOffset - Offset of the data to start decrypting at.
      inputLength - Length of the data to be decrypted.
      output - Array to output decrypted data to.
      outputOffset - Offset of the output array to start at.
      Throws:
      Exception - If an error occurs.
    • encrypt

      void encrypt(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) throws Exception
      Encrypts the given data. Input and output arrays can be the same.
      Parameters:
      input - Input data to encrypt.
      inputOffset - Offset of the data to start encrypting at.
      inputLength - Length of the data to be encrypted.
      output - Array to output encrypted data to.
      outputOffset - Offset of the output array to start at.
      Throws:
      Exception - If an error occurs.