WaterdogPE icon indicating copy to clipboard operation
WaterdogPE copied to clipboard

Implement credentials file with proper implementation of contentKeys

Open TobiasGrether opened this issue 1 year ago • 0 comments

Right now, there is no native support for the usage of encrypted resource packs with WDPE. Users have to resort to writing their own plugins which uses events to change packet data in order to attach the decryption keys to the ResourcePackInfoPacket.

While this might be fine for some bigger users of encrypted packs, services like EncryptMyPack (Blackbox encryption services) have made it easy to encrypt packs.

Encrypting packs is obviously desirable to protect IP.

This PR implements a credentials.yml file.

Why not just in the config.yml

Content / Decryption Keys are sensitive information. People tend to copy pasting configuration files for example for debugging purposes and sending them somewhere else. To protect people from making a mistake that leaks their credentials, I moved these credentials to a separate credentials file which can be used for other credentials in the future.

How it work

The credentials file contains a Map<String, String> of textureKeys. The key is the pack UUID, and the value is the corresponding contentKey that pack was encrypted with.

Integration

To allow integration with live services and hot reloading, the texture key map is accessible and mutable at runtime. This allows for plugins to delete, replace or add keys without reloading the configuration file.

TobiasGrether avatar Sep 27 '22 11:09 TobiasGrether