SubServers-2/SubServers.Sync/src/net/ME1312/SubServers/Sync/Network/Cipher.java
ME1312 7cd9c9bc4c
Switch SubData Packets from JSON to MessagePack encoding
This is a change to how packets are transferred; the API has not been changed.

While the difference may be unnoticable when using unencrypted packets, because of MessagePack's compact size and better handling of byte values encrypted packets should transfer faster.
2018-08-23 22:32:49 -04:00

35 lines
776 B
Java

package net.ME1312.SubServers.Sync.Network;
import net.ME1312.SubServers.Sync.Library.Config.YAMLSection;
import org.msgpack.value.Value;
/**
* SubData Cipher Layout Class
*/
public interface Cipher {
/**
* Get the name of this Cipher
*
* @return Cipher Name
*/
String getName();
/**
* Encrypt JSON Data
*
* @param key Key to Encrypt Data with
* @param data Data to Encrypt
* @return Encrypted Data Array
*/
Value encrypt(String key, YAMLSection data) throws Exception;
/**
* Decrypt Encrypted JSON Data
*
* @param key Key to Decrypt Data with
* @param data Encrypted Data Array
* @return JSON Data
*/
YAMLSection decrypt(String key, Value data) throws Exception;
}