Class AESEncryption
java.lang.Object
org.geysermc.mcprotocollib.network.crypt.AESEncryption
- All Implemented Interfaces:
PacketEncryption
An encryption implementation using "AES/CFB8/NoPadding" encryption.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
AESEncryption
Creates a new AESEncryption instance.- Parameters:
key- Key to use when encrypting/decrypting data.- Throws:
GeneralSecurityException- If a security error occurs.
-
-
Method Details
-
decrypt
public void decrypt(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) throws Exception Description copied from interface:PacketEncryptionDecrypts the given data. Input and output arrays can be the same.- Specified by:
decryptin interfacePacketEncryption- 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
public void encrypt(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) throws Exception Description copied from interface:PacketEncryptionEncrypts the given data. Input and output arrays can be the same.- Specified by:
encryptin interfacePacketEncryption- 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.
-