Skip to content

Latest commit

 

History

53 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StegoWave

Audio steganography services with a cli client written in Rust🦀

Available audio file formats

Format CLI code Version Implemented
WAV (16-bits samples) wav16 ^0.0.1 WAV16

Available services

Architecture CLI code Directory API
REST rest /rest_service Swagger
gRPC grpc /grpc_service Proto file

Steganography core lib => stego_wave

This Rust library provides audio steganography functionality. It allows users to hide, extract, and clear secret messages within audio samples using least significant bit (LSB) manipulation. Below is an overview of its key features and design:

Key Features

  • WAV16 Format Support: The library currently supports only 16-bit WAV audio files. It validates that the file meets the 16-bit requirement before processing.

  • Message Embedding: The library can embed secret messages into audio files by altering the LSBs of audio samples. A header (e.g., "STEG") is embedded along with the message to ensure correct extraction.

    • Methods include hide_message for processing files and hide_message_binary for direct sample manipulation.
  • Message Extraction: It provides methods to retrieve the hidden message from an audio file.

    • The methods extract_message and extract_message_binary work by reading the LSBs and reconstructing the hidden data.
  • Message Clearing: In addition to embedding and extraction, the library can clear the hidden message from an audio file using the provided password to locate the modified samples.

  • Password-Based Indexing: Unique random indices are generated based on a password, ensuring that only users with the correct password can extract or clear the hidden message.

  • Configurable LSB Depth: Users can configure the number of LSBs used (with a default of 1 and a valid range of 1 to 16) to balance between audio quality and message capacity. This is implemented using the builder pattern for easy and flexible configuration.


Build setup

Getting the git repository

git clone --branch capstone-project --single-branch https://github.com/Van4ooo/StegoWave.git
cd StegoWave

Run gRPC server

cargo run --bin grpc_server

Run REST server

# Fix zip v2.5 error. https://github.com/juhaku/utoipa/issues/1341
cargo update zip --precise 2.2.2
cargo run --bin rest_server

You can test the server's REST API at Swagger


Tutorial

sw - is a Rust-based tool that allows you to hide, extract, and clear secret message within audio file. It leverages different servers (gRPC and REST) to process your requests and uses least significant bit (LSB) steganography techniques to embed or remove information.

Prerequisites

  • Rust Toolchain: Make sure you have Rust installed. You can download it from site.

  • Audio File: Have an audio file (e.g., WAV format) ready for testing.

  • Server Setup: The application connects to a server running locally. By default:

    • gRPC server URL: http://[::1]:50051

    • REST server URL: http://127.0.0.1:8080

    Ensure that at least one of these servers is running or use the auto option to let the application try gRPC first and then REST if needed.

Build sw

cargo build --release --bin sw
./target/release/sw --help

image

Usage sw

sw supports three primary commands: hide, extract, and clear. All commands share some common fields such as the input file name, audio file format, server choice, and the number of LSBs to modify.

Hiding a secret message

Use the hide command to embed a secret message into an audio file.

./target/release/sw hide --help

image

  • Windows command syntax

    ./target/release/sw hide --input_file <FILE_NAME> --output_file <FILE_NAME> --message "Super secret message!!" --format wav16
  • Linux command syntax

    cat <FILE_NAME> | sw hide --message "Super secret message!!" --format wav16 > <FILE_NAME>

Extracting a secret message

Use the extract command to retrieve a hidden message from an audio file.

./target/release/sw extract --help

image

  • Windows command syntax

    sw extract --input_file <FILE_NAME> --format wav16
  • Linux command syntax

    cat <FILE_NAME> | sw extract  --format wav16 > rez.txt

Clearing a hidden message

The clear command removes the hidden message from an audio file.

./target/release/sw clear --help 

image

  • Windows command syntax

    sw clear --input_file <FILE_NAME> --output_file <FILE_NAME> --format wav16
  • Linux command syntax

    cat <FILE_NAME> | sw clear --format wav16 > <FILE_NAME>

Automatically start the server if it's not running

sw <COMMAND> --start-server --server grpc
sw <COMMAND> --start-server --server rest

This tutorial should help you understand and use the sw application for embedding, extracting, and clearing hidden messages within audio files. Happy steganography!

About

Audio file steganography writen on Rust 🦀

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages