#assets #write #decrypter #rpgm-asset-decrypter-lib

rpgm-asset-decrypter-lib

A library for decrypting/encrypting RPG Maker MV/MZ audio and image assets

1 stable release

1.0.0 Mar 18, 2025

#34 in #write

Download history 46/week @ 2025-03-12 56/week @ 2025-03-19

102 downloads per month

Custom license

36KB
90 lines

rpgm-asset-decrypter-lib

A library for decrypting/encrypting RPG Maker MV/MZ audio and image assets.

Used in my rpgm-asset-decrypter-rs CLI tool.

Installation

cargo add rpgm-asset-decrypter-lib

Usage

Decrypt:

use rpgm_asset_decrypter_lib::Decrypter;
use std::fs::{read, write};

let mut decrypter = Decrypter::new(None);
let file = "./picture.rpgmvp";
let buf = read(file).unwrap();

// For images, decrypter automatically determines the key.
// For audio, read `encryptionKey` property from `System.json` and pass it to `Decrypter` constructor.
let decrypted = decrypter.decrypt(&buf);
write("./decrypted-pitcure.png", decrypted).unwrap();

Encrypt:

use rpgm_asset_decrypter_lib::Decrypter;
use std::fs::{read, write};

// When encrypting, decrypter requires a key.
// It can be read from `encryptionKey` property in `System.json`.
let decrypter = Decrypter::new(Some(String::from("d41d8cd98f00b204e9800998ecf8427e")));
let file = "./picture.png";
let buf = read(file).unwrap();

let encrypted = decrypter.encrypt(&buf);
write("./decrypted-pitcure.rpgmvp", encrypted).unwrap();

License

Project is licensed under WTFPL.

No runtime deps