Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.2.1 instead.
Reason given by maintainers: 编解码输出画面损坏(品红条纹)

yccstego —— YCC(YCbCr) 亮度通道 nsF5 隐写工具

PyPI - Version PyPI - Python PyPI - Downloads GitHub - Release GitHub - License

在 JPEG 压缩域中对 YCbCr 的 Y(亮度)通道量化 DCT 系数 实施 nsF5 伴随式矩阵编码隐写。 自实现标准 JPEG(DCT+量化+Huffman) 编解码,保证量化系数在“保存→解析”后逐位一致, 从而实现压缩域无失真往返嵌入。

0.2.0 起嵌入逐字节确定:湿纸求解的遍历种子由(干点集合,目标伴随式)派生, 相同输入得到完全相同的输出字节(跨进程/跨机器一致),实验可复现、可写进回归测试; 旧版(≤0.1.4)生成的含密图仍可正常解码。

安装

# 从 PyPI 安装
pip install yccstego
# 或本地源码开发模式安装
pip install -e .

控制台命令 yccstego 依赖 Python 的 Scripts 目录在 PATH 中; 若未配置可用 python -m yccstego.cli。

用法(CLI)

# 嵌入(消息 UTF-8,中英文均可)
yccstego embed in.png out.jpg -m "你好,ycc stego" -p 3 -k 口令
# 消息超容量时按 UTF-8 安全截断(默认则报错)
yccstego embed small.png out.jpg -m "很长很长的中文…" -p 3 -k 口令 --truncate
# 解码
yccstego extract out.jpg -p 3 -k 口令
# 隐写分析
yccstego analyze out.jpg

确定性与修改轨迹(0.2.0)

import yccstego.api as api
jpg1, _ = api.embed_bytes("cover.png", "同一段话", p=3)
jpg2, _ = api.embed_bytes("cover.png", "同一段话", p=3)
assert jpg1 == jpg2                       # 逐字节一致

jpg, rep = api.embed_bytes("cover.png", "看算法", p=3, trace=True)
for ch in rep["changes"]:                 # 每个被修改系数的轨迹
    print(ch["block"], ch["rc"], f'{ch["from"]}->{ch["to"]}', ch["kind"], ch["pool"])
# kind: shrink=减幅 / wet=湿纸方程解 / boost=升幅兜底; pool: head=认证头 / body=正文

report 同时新增 wet_points(嵌入前载体中 |c|=1 的湿点个数)。

与 nsf5stego 主线的关系

本项目保持独立仓库/独立发版;自 nsf5stego v1.9.0 起被其作为依赖集成(Python≥3.10 自动安装),经桥接层提供 CLI --jpeg、 GUI"JPEG 域"模式与实验档案 repro 的字节级重跑校验。两侧算法行为保持一致。

结构

  • yccstego/color.py RGB↔YCbCr(BT.601) 与 4:2:0 子采样
  • yccstego/dct.py 8×8 分块 DCT/IDCT、量化表、之字扫描
  • yccstego/huffman.py 标准 JPEG DC/AC Huffman 编解码
  • yccstego/jpeg_codec.py 图像↔量化系数↔.jpg 位流
  • yccstego/nsf5.py Y 亮度量化 DCT 系数上的 nsF5 嵌入/提取(伴随式+湿纸+块置乱+图像哈希自同步)
  • yccstego/steganalysis.py YCC 域盲隐写分析
  • yccstego/cli.py 命令行入口

许可

本项目基于 Apache License 2.0 发布,详见 LICENSE 与 NOTICE。

Metadata

Release files for yccstego 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yccstego 0.2.0
File Size Uploaded
yccstego-0.2.0.tar.gz 36.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yccstego 0.2.0
File Interpreter ABI Platform
yccstego-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 72.2 kB

Release files / yccstego-0.2.0.tar.gz

Download URL yccstego-0.2.0.tar.gz
Size 36.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c6055d99313fa9ed3fea23db325bce031ff1402b582bb9d305abd58eb42e71d7
BLAKE2b-256 checksum
How to use checksums
c76f9e16eef464a1c543bcfbf4a4c8b9a555ccd08e60b5f2db89c30b3a5b93a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / yccstego-0.2.0-py3-none-any.whl

Download URL yccstego-0.2.0-py3-none-any.whl
Size 35.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f01283ab1ab263a975ae0c8b963a0a6b62e82cd9abd9452b7a7eb58ebec098a
BLAKE2b-256 checksum
How to use checksums
01ce824c7f17341b42fdc54c4855c24a18bea3edb77a7c3c736f3c9d9a4525ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page