By continuing to use this site, you agree to the Terms of Service of this website, including usage of cookies.

OK, Don't show this again

Automatically encrypts loaded resource packs (PocketMine-MP plugin)
version 0.0.1
Approved
Direct Download How to install?
26 Downloads / 26 Total
3 Reviews
Plugin Description §

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 $plugin */
$rp_path = $plugin->getDataFolder() . DIRECTORY_SEPARATOR . "MyResourcePack.zip";

// encrypt MyResourcePack.zip
$encrypter = new ResourcePackEncrypter($plugin->getDataFolder());
$encryption_key = openssl_random_pseudo_bytes(32, $strong_result);
$file_encryption_keygen = fn(string $path, string $contents) => md5($path . $contents);
$info = $encrypter->encryptZip(new ZipArchive($rp_path), $encryption_key, $file_encryption_keygen);

// register encrypted resource pack
$manager = $plugin->getServer()->getResourcePackManager();
$stack = $manager->getResourceStack();
$stack[] = $info->pack;
$manager->setResourceStack($stack);
$manager->setPackEncryptionKey($pack->getPackId(), $encryption_key);

// hold reference to encrypted file's resource throughout server runtime
$plugin->encryptedResourcePackResource = $info->resource;

To generate static encryption keys (instead of random keys), consider using your machine ID.

use pocketmine\utils\Utils;

$machine_id = Utils::getMachineUniqueId()->getBytes();
$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";

NhanAZ
using v0.0.1
15 Feb 24
RPDecrypter plugin please!
Muqsit
15 Feb 24
In due time 😇
Atara6431
using v0.0.1
08 Feb 24
useful plugin!
Muqsit
08 Feb 24
😇
Laith98Dev
Staff
using v0.0.1
02 Feb 24
Nice plugin
Muqsit
02 Feb 24
😇

Reply to review by :

/ 5
Supported API versions
5.0.0
->
5.11.0
Producers §
  • Collaborators:
    • @Muqsit
License §
Categories:
General
Admin Tools
Informational
Developer Tools
API plugins

You can leave one review per plugin release, and delete or update your review at any time

/ 5
Loading...