RPEncrypter
RPEncrypter
A PocketMine-MP plugin that automatically encrypts all loaded resource packs.
Just install the plugin and restart your server. All loaded resource packs (such as ones defined in your resource_packs/resource_packs.yml) will automatically be encrypted. This plugin uses your machine ID as the encryption key.
API
ResourcePackEncrypter::encrypt() encrypts resource packs with the supplied encryption-key.
/** @var PluginBase rp_path = $plugin->getDataFolder() . DIRECTORY_SEPARATOR . "MyResourcePack.zip";
// encrypt MyResourcePack.zip plugin->getDataFolder()); strong_result); path, string path . info = rp_path), file_encryption_keygen);
// register encrypted resource pack plugin->getServer()->getResourcePackManager(); manager->getResourceStack(); info->pack; stack); pack->getPackId(), $encryption_key);
// hold reference to encrypted file's resource throughout server runtime info->resource;
To generate static encryption keys (instead of random keys), consider using your machine ID.
use pocketmine\utils\Utils;
encryption_key = md5($machine_id); // 32-byte encryption key
Alternatively, generate a 32-length random string via 1Passoword and store it on your server somewhere.
$encryption_key = "6]xFaeMs9b)UnybZ?raH]*)PJ.Jx!3:0";