首页 >> 大全

捏脸游戏是如何使用png来隐藏信息的

2023-12-01 大全 30 作者:考证青年

虽然有点好奇, 但基本上还是有点头绪的, 之前用png来隐藏视频文件, 通过压缩的方式隐藏

不知道有没有修好

这次是通过在png文件格式附加实现

1, 图片压缩很重要, 不只是为了减少存储大小, 而且是为了向这种方式进行隐秘的信息存储

2, 简单的信息使用这种方式隐藏很方便, 不必使用zip或者两个文件分别维护, 甚至可以加入秘钥等身份鉴别信息

捏脸上瘾__随便捏脸的游戏

在下面的图片中, 添加隐藏信息, 诸如名字, 身高等

_捏脸上瘾_随便捏脸的游戏

png文件结构

字符串和的一些操作

const s = "12345678";
const c = "45";
const i = s.indexOf(c);
console.log(i);
console.log(s.slice(0, i + c.length));
console.log(s.slice(i + c.length));console.log(Buffer.from("HoneySelectCharaFemale").toString("hex").toLowerCase()
);const h2 ="3247dc7e889f3775a08e6d23c9404b8e82694e17ef9b27868aef8c61e284279e077d0200000000000903000000000000";
console.log(Buffer.from(h2, "hex").toString('utf8'));

简单来讲就是读图片, 转换为hex格式, 然后从png尾部分割为png和txt两端, 重新写到两个文件中,完成图片和信息的分离

const fs = require("fs");
const str = fs.readFileSync("./hs/t.png");
const hex = str.toString("hex");
fs.writeFileSync("./h.txt", hex);
const end = "AE 42 60 82".replace(/\s+/gis, "").toLowerCase();
console.log("end", end, hex.includes(end));
if (hex.includes(end)) {const i = hex.indexOf(end);const png = hex.slice(0, i + end.length);const text = hex.slice(i + end.length);console.log("png", png.length);console.log("text", text.length);const txtBuffer = Buffer.from(text, "hex");console.log(txtBuffer.toString('utf8'))fs.writeFileSync("./text.txt", txtBuffer, "utf8");const pngBuffer = Buffer.from(png, "hex");fs.writeFileSync("./png.png", pngBuffer);
}

成功分离后图片没有损坏, 不过数据不知道什么格式, 只能读一部分

这个应该是标示自定义数据的开头, 后面就是附加的隐藏数据了

up-edbf01cd7cfed9281f59ee1bfc9e10eb71a.png

关于我们

最火推荐

小编推荐

联系我们


版权声明:本站内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 88@qq.com 举报,一经查实,本站将立刻删除。备案号:桂ICP备2021009421号
Powered By Z-BlogPHP.
复制成功
微信号:
我知道了