17个版本
0.5.3 | 2023年4月12日 |
---|---|
0.5.2 | 2022年10月6日 |
0.5.1 | 2022年4月18日 |
0.5.0 | 2021年12月9日 |
0.3.1-beta.4 | 2020年3月1日 |
#67 in 图像
每月85次下载
110KB
2K SLoC
Stegano
一个跨平台的命令行工具,专注于性能和简单性。
演示
功能
- 简单易用的命令行工具
- 跨平台支持(Windows、macOS和Linux)
- 支持以下媒体格式:
- PNG图像
- WAV音频
- 在载体媒体中隐藏一个或多个文件
- 在载体媒体中隐藏一行文本消息
- 基于最低有效位隐写学
- 向后兼容到图像编码和解码的stegano for windows
- 设计上内存安全
- 用rust编写
什么是隐写学?
简而言之,就是在某物(如一本书、一张图片、一个音频甚至一个视频)中隐藏信息的艺术。 你可以在我的幻灯片中找到更多信息 点击这里 或查看我于2020年6月在慕尼黑Rust Meetup上的演讲 点击这里.
安装
要安装stegano cli,只需运行
❯ cargo install --force stegano-cli
(--force只是确保它更新到最新版本的stegano-cli
,如果它已经安装)
注意 二进制文件名为stegano
(没有-cli
)
要验证安装是否成功,可以运行which stegano
,应该输出类似以下内容
$HOME/.cargo/bin/stegano
AUR
stegano
可以通过可用的 AUR 软件包 使用 AUR 辅助工具 进行安装。例如,
❯ yay -S stegano
用法
❯ stegano --help
Stegano CLI 0.4.0
Sven Assmann <[email protected]>
Hiding secret data with steganography in PNG images and WAV audio files
USAGE:
stegano [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
hide Hides data in PNG images and WAV audio files
unveil Unveils data from PNG images
unveil-raw Unveils raw data in PNG images
子命令
隐藏
❯ stegano hide --help
stegano-hide
Hides data in PNG images and WAV audio files
USAGE:
stegano hide [FLAGS] [OPTIONS] --data <data file> --in <media file> --out <output image file>
FLAGS:
--x-force-content-version-2 Experimental: enforce content version 2 encoding (for backwards compatibility)
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-d, --data <data file> File(s) to hide in the image
-i, --in <media file> Media file such as PNG image or WAV audio file, used readonly.
-m, --message <text message> A text message that will be hidden
-o, --out <output image file> Final image will be stored as file
使用 PNG 图像文件的示例
让我们演示如何将像 README.md
这样的文件隐藏在图像 Base.png
中,并将其保存为 README.png
❯ stegano hide --data README.md --in resources/plain/carrier-iamge.png --out README.png
最终结果包含在图像 README.png
中。
专业技巧 您可以一次隐藏多个文件
这里我使用缩写参数 (--data, -d), (--in, -i), (--out, -o)
❯ stegano hide \
-i resources/plain/carrier-image.png \
-d resources/secrets/Blah.txt \
resources/secrets/Blah-2.txt \
-o secret.png
隐藏功能 您可以使用 .jpg
作为输入,并将其保存为 .png
❯ stegano hide \
-i resources/NoSecret.jpg \
-d resources/secrets/Blah.txt \
-o secret.png
使用 WAV 音频文件的示例
❯ stegano hide \
-i resources/plain/carrier-audio.wav \
-d resources/secrets/Blah.txt \
resources/secrets/Blah-2.txt \
-o secret.wav
示例隐藏简短消息
现在让我们假设我们只想在 secret-text.png
中隐藏一点文本消息。因此,我们会运行
❯ stegano hide \
-i resources/NoSecrets.jpg \
-m 'This is a super secret message' \
-o secret-text.png
揭示
❯ stegano unveil --help
stegano-unveil
Unveils data from PNG images
USAGE:
stegano unveil --in <image source file> --out <output folder>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-i, --in <image source file> Source image that contains secret data
-o, --out <output folder> Final data will be stored in that folder
从 PNG 图像文件中揭示示例
让我们揭示(unveil)我们之前在 README.png
中隐藏的 README.md
❯ stegano unveil --in README.png --out ./
❯ file README.md
README.md: UTF-8 Unicode text
示例揭示简短消息
现在让我们揭示上面 secret-text.png
中的消息。因此,我们会运行
❯ stegano unveil \
-i secret-text.png \
-o message
❯ cat message/secret-message.txt
This is a super secret message
揭示-raw
❯ stegano unveil-raw --help
stegano-unveil-raw
Unveils raw data in PNG images
USAGE:
stegano unveil-raw --in <image source file> --out <output file>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-i, --in <image source file> Source image that contains secret data
-o, --out <output file> Raw data will be stored as binary file
示例揭示原始数据
让我们揭示我们刚才在 README.png
中隐藏的 README.md
的原始数据
❯ stegano unveil-raw --in README.png --out README.bin
文件 README.bin
包含了所有通过 LSB 解码算法未过滤解码的原始二进制数据。这对于好奇的人来说很有趣,但对于常规使用并不那么有趣。
贡献
要为 stegano-rs 贡献,您可以选择检查带有标签 good first issue
的现有问题 (点击此处查看),或者 打开一个新问题 并描述您的问题。
此外,每个 PR 都受到欢迎,只是作为一个注意事项:在这个时候,架构和 API 仍在变动,可能会发生变化,因此在任何情况下,我都建议首先打开一个问题来讨论代码贡献。
许可证
- GNU GPL v3 许可证
- 版权所有 2019 - 2020 © Sven Assmann。
依赖关系
~12MB
~183K SLoC