diff --git a/um_wasm/src/exports/qmc.rs b/um_wasm/src/exports/qmc.rs index 098f897..43219bf 100644 --- a/um_wasm/src/exports/qmc.rs +++ b/um_wasm/src/exports/qmc.rs @@ -19,7 +19,8 @@ impl JsQMC2 { /// Create a new QMC2 (mgg/mflac) cipher instance. #[wasm_bindgen(constructor)] pub fn new(ekey: &str) -> Result { - let cipher = QMCv2Cipher::new(ekey.as_bytes()).map_err(map_js_error)?; + let key = umc_qmc::ekey::decrypt(ekey).map_err(map_js_error)?; + let cipher = QMCv2Cipher::new(key).map_err(map_js_error)?; Ok(JsQMC2(cipher)) }