Skip to main content

Crate phasm_core

Crate phasm_core 

Source
Expand description

§phasm-core

Pure-Rust steganography engine for hiding encrypted text messages in JPEG photos. Provides two embedding modes:

  • Ghost (stealth): J-UNIWARD cost function + STC coding to resist statistical steganalysis. Optimizes for undetectability.
  • Armor (robust): STDM embedding + Reed-Solomon ECC to survive JPEG recompression. Optimizes for message survivability.

All processing is client-side. The JPEG coefficient codec (jpeg module) is zero-dependency (std only). The steganography layer (stego module) uses AES-256-GCM-SIV encryption and Argon2id key derivation.

§Quick start

use phasm_core::{ghost_encode, ghost_decode};

let cover_jpeg = std::fs::read("photo.jpg").unwrap();
let stego = ghost_encode(&cover_jpeg, "secret message", "passphrase").unwrap();
let decoded = ghost_decode(&stego, "passphrase").unwrap();
assert_eq!(decoded.text, "secret message");

Re-exports§

pub use codec::jpeg;
pub use codec::jpeg::error::JpegError;
pub use codec::jpeg::error::Result as JpegResult;
pub use codec::jpeg::dct::DctGrid;
pub use codec::jpeg::dct::QuantTable;
pub use codec::jpeg::frame::FrameInfo;
pub use codec::jpeg::JpegImage;
pub use stego::ghost_encode;
pub use stego::ghost_decode;
pub use stego::ghost_encode_with_files;
pub use stego::ghost_encode_si;
pub use stego::ghost_encode_si_with_files;
pub use stego::ghost_capacity;
pub use stego::ghost_capacity_si;
pub use stego::StegoError;
pub use stego::GHOST_DECODE_STEPS;
pub use stego::GHOST_ENCODE_STEPS;
pub use stego::ghost_encode_with_quality;
pub use stego::ghost_encode_with_files_quality;
pub use stego::ghost_encode_si_with_quality;
pub use stego::ghost_encode_si_with_files_quality;
pub use stego::ghost_encode_with_shadows;
pub use stego::ghost_encode_si_with_shadows;
pub use stego::ghost_shadow_decode;
pub use stego::ShadowLayer;
pub use stego::GHOST_ENCODE_WITH_SHADOWS_STEPS;
pub use stego::shadow_capacity;
pub use stego::estimate_shadow_capacity;
pub use stego::ghost_capacity_with_shadows;
pub use stego::ghost_encode_with_shadows_quality;
pub use stego::ghost_encode_si_with_shadows_quality;
pub use stego::armor_encode;
pub use stego::armor_encode_with_quality;
pub use stego::armor_decode;
pub use stego::armor_capacity;
pub use stego::armor_capacity_info;
pub use stego::smart_decode;
pub use stego::DecodeQuality;
pub use stego::ArmorCapacityInfo;
pub use stego::EncodeQuality;
pub use stego::validate_encode_dimensions;
pub use stego::MAX_DIMENSION;
pub use stego::MAX_PIXELS;
pub use stego::MIN_ENCODE_DIMENSION;
pub use stego::ARMOR_TARGET_DIMENSION;
pub use stego::PayloadData;
pub use stego::FileEntry;
pub use stego::compressed_payload_size;
pub use stego::progress;
pub use stego::optimize_cover;
pub use stego::OptimizerConfig;
pub use stego::OptimizerMode;

Modules§

codec
Media format codecs — pure I/O parsers with no steganographic logic.
det_math
Deterministic math functions for cross-platform WASM reproducibility.
stego
Steganographic encoding and decoding pipelines.