-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(image:encoder): variable step rate for color channels
- variable step by the encoder would move through the color channels - option for enable/disable the skip of the alpha channel for encoding
- Loading branch information
Showing
28 changed files
with
751 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) | ||
deb: | ||
docker pull 5422m4n/rust-deb-builder | ||
docker run --rm -v ${ROOT_DIR}/..:/mnt -w /mnt \ | ||
5422m4n/rust-deb-builder \ | ||
cargo deb -p stegano-cli --target=x86_64-unknown-linux-musl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,12 +117,12 @@ jobs: | |
name: binaray package .deb | ||
needs: check | ||
runs-on: ubuntu-latest | ||
container: | ||
image: 5422m4n/rust-deb-builder:latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: cargo deb | ||
run: cargo deb -p stegano-cli --target=x86_64-unknown-linux-musl | ||
uses: sassman/[email protected] | ||
with: | ||
package: stegano-cli | ||
- name: Archive deb artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,16 +68,28 @@ jobs: | |
omitBodyDuringUpdate: true | ||
omitNameDuringUpdate: true | ||
omitPrereleaseDuringUpdate: true | ||
- run: cargo deb -p stegano-cli | ||
- name: cargo deb | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
uses: sassman/[email protected] | ||
with: | ||
package: stegano-cli | ||
- name: rename package | ||
id: debpkg | ||
shell: bash | ||
env: | ||
TAG: ${{ github.event.release.tag_name }} | ||
run: | | ||
filename="stegano-$TAG-amd64-static.deb" | ||
mv target/x86_64-unknown-linux-musl/debian/stegano-cli*.deb "$filename" | ||
echo "::set-output name=filename::$filename" | ||
- name: Upload Deb File | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
uses: ncipollo/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
allowUpdates: true | ||
artifactErrorsFailBuild: true | ||
artifacts: ./target/debian/stegano-${{ steps.tag_name.outputs.current_version }}-amd64.deb | ||
artifacts: ${{ steps.debpkg.outputs.filename }} | ||
artifactContentType: application/vnd.debian.binary-package | ||
omitBodyDuringUpdate: true | ||
omitNameDuringUpdate: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[package] | ||
name = "stegano-cli" | ||
description = "Hiding secret data with steganography in PNG images and WAV audio files" | ||
version = "0.4.10" | ||
version = "0.5.0" | ||
authors = ["Sven Assmann <[email protected]>"] | ||
edition = "2018" | ||
edition = "2021" | ||
license = "GPL-3.0-only" | ||
homepage = "https://www.stegano.org" | ||
readme = "README.md" | ||
|
@@ -17,9 +17,9 @@ travis-ci = { repository = "steganogram/stegano-rs", branch = "main" } | |
maintenance = { status = "passively-maintained" } | ||
|
||
[dependencies] | ||
stegano-core = { path = "../stegano-core", version = "0.4.10" } | ||
#stegano-core = "0.4.5" | ||
clap = "2.33" | ||
stegano-core = { path = "../stegano-core", version = "0.5.0" } | ||
#stegano-core = "0.5.0" | ||
clap = "2.34" | ||
|
||
[[bin]] | ||
name = "stegano" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[package] | ||
name = "stegano-core" | ||
description = "Steganography core library for stegano-cli. Supports hiding data in PNG images via LSB Encoding." | ||
version = "0.4.10" | ||
version = "0.5.0" | ||
authors = ["Sven Assmann <[email protected]>"] | ||
edition = "2018" | ||
edition = "2021" | ||
license = "GPL-3.0-only" | ||
homepage = "https://www.stegano.org" | ||
readme = "README.md" | ||
|
@@ -26,19 +26,37 @@ deflate = "1.0" | |
byteorder = "1.4" | ||
hound = "3.4" | ||
thiserror = "1.0" | ||
enum_dispatch = "0.3" | ||
|
||
[dev-dependencies] | ||
speculate = "0.1" | ||
criterion = "0.3" | ||
criterion = { version = "0.3", features = ["html_reports"] } | ||
tempfile = "3.2" | ||
|
||
[dev-dependencies.cargo-husky] | ||
version = "1" | ||
default-features = false | ||
features = ["prepush-hook", "run-cargo-test", "run-cargo-clippy", "run-cargo-fmt"] | ||
|
||
[lib] | ||
bench = false | ||
|
||
[[bench]] | ||
name = "decoder_benchmark" | ||
name = "image_decoding" | ||
path = "benches/image/decoding.rs" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "image_encoding" | ||
path = "benches/image/encoding.rs" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "audio_decoding" | ||
path = "benches/audio/decoding.rs" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "encoder_benchmark" | ||
name = "audio_encoding" | ||
path = "benches/audio/encoding.rs" | ||
harness = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
use hound::WavReader; | ||
use stegano_core::media::audio::LsbCodec; | ||
|
||
pub fn audio_decoding(c: &mut Criterion) { | ||
c.bench_function("Audio Decoding", |b| { | ||
let mut reader = WavReader::open("../resources/secrets/audio-with-secrets.wav") | ||
.expect("Cannot create reader"); | ||
let mut buf = [0; 12]; | ||
|
||
b.iter(|| { | ||
reader.seek(0).expect("Cannot seek to 0"); | ||
LsbCodec::decoder(&mut reader) | ||
.read_exact(&mut buf) | ||
.expect("Cannot read 12 bytes from decoder"); | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!(benches, audio_decoding); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
use hound::WavReader; | ||
use stegano_core::media::audio::LsbCodec; | ||
|
||
pub fn audio_encoding(c: &mut Criterion) { | ||
c.bench_function("Audio Encoding to memory", |b| { | ||
let mut reader = | ||
WavReader::open("../resources/plain/carrier-audio.wav").expect("Cannot create reader"); | ||
let mut samples = reader.samples().map(|s| s.unwrap()).collect::<Vec<i16>>(); | ||
let secret_message = b"Hello World!"; | ||
|
||
b.iter(|| { | ||
LsbCodec::encoder(&mut samples) | ||
.write_all(&secret_message[..]) | ||
.expect("Cannot write to codec"); | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!(benches, audio_encoding); | ||
criterion_main!(benches); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.