Crates.io | ngdp-crypto |
lib.rs | ngdp-crypto |
version | 0.4.3 |
created_at | 2025-08-06 12:24:29.784475+00 |
updated_at | 2025-08-11 12:06:15.752591+00 |
description | Salsa20 and ARC4 encryption/decryption with key management for Blizzard's TACT files |
homepage | https://github.com/wowemulation-dev/cascette-rs |
repository | https://github.com/wowemulation-dev/cascette-rs |
max_upload_size | |
id | 1783728 |
size | 64,338 |
Encryption and decryption support for Blizzard's NGDP/TACT system.
Add this to your Cargo.toml
:
[dependencies]
ngdp-crypto = "0.3"
This crate provides cryptographic functionality for handling encrypted content in Blizzard's games. It implements the specific cipher configurations and key management required for TACT (Trusted Application Content Transfer) files.
use ngdp_crypto::{KeyService, decrypt_salsa20};
// Initialize key service
let mut key_service = KeyService::new();
key_service.load_from_standard_dirs()?;
// Get a key by name
let key_name = 0xFA505078126ACB3E_u64;
if let Some(key) = key_service.get_key(key_name) {
// Decrypt data
let decrypted = decrypt_salsa20(encrypted_data, key, iv, block_index)?;
}
The KeyService automatically searches for key files in:
~/.config/cascette/
~/.tactkeys/
CASCETTE_KEYS_PATH
environment variableSupported key file formats:
# CSV Format (WoW.txt style)
FA505078126ACB3E,BDC51862ABED79B2DE48C8E7E66C6200
# TXT Format with description
FA505078126ACB3E BDC51862ABED79B2DE48C8E7E66C6200 WoW 8.2.0.30898 Nazjatar Cinematic
# TSV Format
FA505078126ACB3E BDC51862ABED79B2DE48C8E7E66C6200
The crate includes hardcoded keys for common WoW content and can load additional keys from:
use ngdp_crypto::KeyService;
use std::path::Path;
let mut key_service = KeyService::new();
let keys_loaded = key_service.load_key_file(Path::new("/path/to/WoW.txt"))?;
println!("Loaded {} keys", keys_loaded);
use ngdp_crypto::{decrypt_salsa20, decrypt_arc4};
// For Salsa20 encrypted blocks
let decrypted = decrypt_salsa20(
encrypted_data,
key,
iv,
block_index
)?;
// For ARC4 encrypted blocks
let decrypted = decrypt_arc4(
encrypted_data,
key,
iv,
block_index
)?;
MIT OR Apache-2.0