public interface FloodgateCipher
| Modifier and Type | Interface and Description |
|---|---|
static class |
FloodgateCipher.HeaderResult |
| Modifier and Type | Field and Description |
|---|---|
static int |
HEADER_LENGTH |
static byte[] |
IDENTIFIER |
| Modifier and Type | Method and Description |
|---|---|
default void |
checkHeader(byte[] data)
Checks if the header is valid.
|
byte[] |
decrypt(byte[] data)
Decrypts the given data using the Key provided in
init(Key) |
default byte[] |
decryptFromString(String data)
Decrypts a String.
This method internally calls decrypt(byte[]) by converting
the UTF-8 String into a byte[] |
default String |
decryptToString(byte[] data)
Decrypts a byte[] and turn it into a String.
This method internally calls decrypt(byte[]) and converts the returned byte[] into a String. |
byte[] |
encrypt(byte[] data)
Encrypts the given data using the Key provided in
init(Key) |
default byte[] |
encryptFromString(String data)
Encrypts data from a String.
This method internally calls encrypt(byte[]) |
static boolean |
hasHeader(String data) |
void |
init(Key key)
Initializes the instance by giving it the key it needs to encrypt or decrypt data
|
static boolean hasHeader(String data)
void init(Key key)
key - the key used to encrypt and decrypt databyte[] encrypt(byte[] data)
throws Exception
init(Key)data - the data to encryptException - when the encryption faileddefault byte[] encryptFromString(String data) throws Exception
encrypt(byte[])data - the data to encryptException - when the encryption failedbyte[] decrypt(byte[] data)
throws Exception
init(Key)data - the data to decryptException - when the decrypting faileddefault String decryptToString(byte[] data) throws Exception
decrypt(byte[]) and converts the returned byte[] into a String.data - the data to encryptException - when the decrypting faileddefault byte[] decryptFromString(String data) throws Exception
decrypt(byte[]) by converting
the UTF-8 String into a byte[]data - the data to decryptException - when the decrypting faileddefault void checkHeader(byte[] data)
throws InvalidFormatException
data - the data to checkInvalidFormatException - when the header is invalidCopyright © 2021 GeyserMC. All rights reserved.