如何使用C#隐藏mp3数据框中的数据

发布于 2024-10-08 15:08:03 字数 109 浏览 15 评论 0原文

读取标题名后,数据帧开始,我想知道 mp3 播放器读取的数据帧大小是多少,这样如果我更改每个帧的单个位而不会对文件的声音造成太大影响,以及如何我可以更改一位(最后一位),这样在 C# 中影响最小。 请帮我

after reading the header fame, the data frame starts, i want to know what is the data frame size, that a mp3 player reads, so that if i change single bit of each frame without causing much to the sound of the file, and how can i change a single bit (last bit) so effect is minimum in C#.
please help me

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

仅一夜美梦 2024-10-15 15:08:03

您正在寻找的技术称为'steganography'。

它不是C#(这是比人们想象的要复杂得多),但是这是相关的。。您可能希望使用 p/invoke 来使用它,或者将其移植到 C# 代码中。

The technology you are looking for is called 'steganography'.

It isn't C# (this is a lot more complex than one would think), but this is related.. You might want to use this using p/invoke, or port it into C# code.

千纸鹤 2024-10-15 15:08:03

我能够弄清楚并提出了我自己的算法,Rzr 你说的是对的。

mp3 文件是高度压缩的文件,任何帧中的任何一点变化都会引入巨大的噪音。

有办法解决这个问题,

Soln_1: Hide the text data and in any of the bit of each byte and reconstruct the frame using humming code 

Soln_2: which i was able to do it, using Layer III, BitRate=128000, SampleRate=441000, Padding=0

缺点:文件大小会增加一点,非预期用户无法预测,除非他拥有原始 mp3 文件的精确副本。

能够实现:在没有噪音的情况下,我能够在 3mb mp3 文件中隐藏最多 5kb 的文本数据

解决方法

step1: scan every 8 bytes in each frame
step2: take a 8 bits from the text data

预先定义放置每一位文本数据的位置在每一帧中,例如:第四个位置。

step3:  check every 4th bit location of each byte of the frame is same as the each bit of the text data are same

例如:
文本数据一个字节是

mp3 数据帧中的 01110001 第 8 个字节,

byte_1: 01101111 -->4th location bit is 0
byte_2: 01111111 -->4th location bit is 1
byte_3: 01111001 -->4th location bit is 1
byte_4: 01111011 -->4th location bit is 1
byte_5: 01100011 -->4th location bit is 0
byte_6: 01101100 -->4th location bit is 0
byte_7: 01101011 -->4th location bit is 0
byte_8: 01110011 -->4th location bit is 1

因此帧中的这个字节,每个 4th 位位置都具有与文本数据相同的位位。

Step4: note down the location of the byte in the mp3 data frame, in this case its "1" that is 1st location

如果 mp3 数据帧中的字节与数据位不匹配,则跳过该字节并继续下一个字节,继续执行相同操作,直到隐藏整个文本数据。

Step5:now take all the locations where the text data is present and add these as a byte to the data frame of mp3.

这是我能够成功实施的一种解决方案。

I was able to figure it out and came up with my own algorithm, Rzr what ever you said was right.

The mp3 file is highly compressed file any bit change in any of the frame would introduce tremendous noise.

there is way to work around for this,

Soln_1: Hide the text data and in any of the bit of each byte and reconstruct the frame using humming code 

Soln_2: which i was able to do it, using Layer III, BitRate=128000, SampleRate=441000, Padding=0

drawbacks : file size would be increased abit which the un-intended user cant predict, unless he has the exact copy of the original mp3 file.

Able to achieve : without noise i was able to hide text data upto 5kb in a 3mb mp3 file

Work Around:

step1: scan every 8 bytes in each frame
step2: take a 8 bits from the text data

Pre-definee location of where to put each bit of text data in each frame e.g: 4th location.

step3:  check every 4th bit location of each byte of the frame is same as the each bit of the text data are same

E.g.:
text data one byte is 01110001

1st 8 byte from the mp3 data frames

byte_1: 01101111 -->4th location bit is 0
byte_2: 01111111 -->4th location bit is 1
byte_3: 01111001 -->4th location bit is 1
byte_4: 01111011 -->4th location bit is 1
byte_5: 01100011 -->4th location bit is 0
byte_6: 01101100 -->4th location bit is 0
byte_7: 01101011 -->4th location bit is 0
byte_8: 01110011 -->4th location bit is 1

so this byte from the frame, every 4th bit location is having the bits which are same as the text data bits.

Step4: note down the location of the byte in the mp3 data frame, in this case its "1" that is 1st location

if the byte from the mp3 data frame doesn't matches the data bits then skip the byte and go on to the next byte, keep on doing the same till entire text data is hidden.

Step5:now take all the locations where the text data is present and add these as a byte to the data frame of mp3.

this is one solution i was able to successfully implemented.

雾里花 2024-10-15 15:08:03

我也在做一个类似的项目...首先你必须了解 mp3 文件结构...我希望 此链接将帮助您了解 mp3 文件结构...一旦您清楚了文件结构,您自己编写代码就很容易...以流形式获取 mp3 文件并提取每个文件框架(一旦您了解 mp3 文件结构,这应该非常容易...事实上,我只花了几个小时就编写了代码来做到这一点)...以及关于您的算法的建议。一个 5 mb 的 mp3 文件或多或少有 15,000 帧...所以,如果您考虑每帧替换一点,您可以存储的最大数据是 2KB...

我尝试了相同的方法,但我每帧更改了一个字节...这在生成的文件中引入了一些噪音...有关如何减少噪音的任何建议...!?!?!??希望我的回答对您有所帮助...:)

I'm also working on a similar project... First of all you have to know about mp3 file structure... I hope this link would help you regarding mp3 file structure... Once you are clear about the file structure it's pretty easy to write a code yourself... Get the mp3 file as a stream and extract each frame from it(This should be really easy once you know about mp3 file structure... In fact, It took just a couple of hours for me to write a code to do that)... And a suggestion about your algorithm. A 5 mb mp3 file has more or less 15,000 frames... So, if you think of replacing a bit per frame the largest data you can store is 2KB...

I tried the same but I changed a BYTE per frame... This introduced some noise in the resulting file... Any suggestions on how to reduce the noise...!?!?!?? And hope my answer helps you... :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文