Skip to main content

ngdp_crypto/
lib.rs

1//! Encryption and decryption support for NGDP/TACT files.
2//!
3//! This crate provides:
4//! - Key management for TACT encryption keys
5//! - Salsa20 stream cipher implementation for BLTE mode 'E'
6//! - ARC4 cipher implementation (for legacy support - **DEPRECATED**)
7//! - Hardcoded WoW encryption keys
8//! - Key file loading from multiple formats
9
10#![cfg_attr(test, allow(deprecated))]
11
12#[deprecated(
13    since = "0.4.0",
14    note = "ARC4 module is deprecated and will be removed in v0.5.0. Use salsa20 module instead."
15)]
16pub mod arc4;
17pub mod error;
18pub mod key_service;
19pub mod keys;
20pub mod salsa20;
21
22pub use error::CryptoError;
23pub use key_service::KeyService;
24
25// Re-export encryption/decryption functions
26#[allow(deprecated)]
27#[deprecated(
28    since = "0.4.0",
29    note = "ARC4 decryption is deprecated and will be removed in v0.5.0. Use decrypt_salsa20 instead."
30)]
31pub use arc4::decrypt_arc4;
32#[allow(deprecated)]
33#[deprecated(
34    since = "0.4.0",
35    note = "ARC4 encryption is deprecated and will be removed in v0.5.0. Use encrypt_salsa20 instead."
36)]
37pub use arc4::encrypt_arc4;
38pub use salsa20::{decrypt_salsa20, encrypt_salsa20};
39
40/// Result type for crypto operations.
41pub type Result<T> = std::result::Result<T, CryptoError>;