你能在文本中隐藏数据吗?

发布于 2024-07-10 01:36:30 字数 160 浏览 15 评论 0原文

我希望在页面上放置一些文本并隐藏该文本中的一些数据。 有谁知道过去用来解决这个问题的任何方法/模式?

示例:我有以下文本: “猫坐在狗身上,很高兴。”

我还有数字 123。我想在该句子中隐藏这个数字,以便该句子可以放置在网页上,只有知情的人才能找到该数据。

I wish to put some text on a page and hide some data in that text. Does anybody know of any methods / patterns that have been used in the past to solve this problem?

Example: I have the following text:
"The cat sat on the dog and was happy."

I also have the number 123. I want to hide this number in that sentence such that the sentence can be placed on a web page and only someone in the know would be able to find the data.

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

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

发布评论

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

评论(12

各自安好 2024-07-17 01:36:43

我有两个安全性很好的方案,但代价是 Stegabit 嵌入率相当低。 其中一种非常简单,但每行任意用户给定文本的嵌入率为 1 位,而另一种需要用户在软件的指导下编写隐藏文本,实现的嵌入率范围为 [0.5 , 1.0] 每个字。 查看我的主页 mok-kong-shen.de

I have two schemes with good secuity but with the trade-off of fairly low stegabit embedding rates. One of them is extremely simple but has an embedding rate of 1 bit per line of arbitrary user given texts only, while the other, requiring the user to compose covertexts under the guidance of the software, achieves an embedding rate in the range of [0.5, 1.0] per word. See my home page mok-kong-shen.de

九歌凝 2024-07-17 01:36:42

好吧,您可以尝试类似这个之类的东西...不确定这是否正是您正在寻找的,尽管。

Well, you could try something like this...not sure if that's exactly what you're looking for, though.

爱的故事 2024-07-17 01:36:41

根据此 线程

Mikhail Atallah教授等。 等人。 普渡大学对水印文本进行了大量研究。

该方法使用 TMR (文本含义表示)的短语,通过执行较小的变换将 TMR 定位在距定义的规范形式一定距离的位置来编码位。

(给文本添加水印的另一种方法是 这里

这可能是在文本中隐藏文本的另一种方法,以及其他答案中描述的隐写方法。

According to this thread:

Prof. Mikhail Atallah et. al. here at Purdue did a lot of research on watermarking text.

The approach uses TMRs (Text Meaning Representation) of phrases to encode bits by performing minor transformations positioning the TMR at a certain distance from a defined canonical form.

(another method to watermark text is presented here)

It may be another way to hide text within text, along with the Steganograph method described in the other answers.

二智少女猫性小仙女 2024-07-17 01:36:40

这是将加密数据转换为“自然”文本消息的原型。

http://herosys.net/w/project/text -steganography-hide-text-in-spam-sms

将源文本(例如“明天上午 8 点在大学东门见”)转换为看起来像垃圾邮件的短文本消息。

“有史以来最好的房子!你绝对不能错过它。1000-3000 平方英尺。每平方英尺 15-80 美元。请致电 123-456-7890”。

该算法是您只需创建一个语法图,并为每个单词创建一个候选表。 就像 BASE64 一样,但是索引表根据您预定义的上下文进行更改。

Here is a prototype convert encrypted data to "natural" text message.

http://herosys.net/w/project/text-steganography-hide-text-in-spam-sms

Convert source text like "See U at east door of University, tomorrow 8 am" to short text message looks like spam.

"Best house ever! you should never miss it. 1000-3000 square ft. $15-80 per square ft. Call 123-456-7890".

The algorithm is you just create a grammar diagram, and create a candidate table for each word. Just like BASE64, but index table is changed according your predefined context.

何时共饮酒 2024-07-17 01:36:38

Jon Skeet 提到的方法与 Matthew Kwan 的“SNOW”方法非常相似。 它们都在文本中隐藏少量任意信息,而不添加、删除或更改源文本中的任何单词。
两者都将秘密消息编码为通常不相关、通常不可见的空白——
单词之间和行尾的额外空格和制表符。

The approach Jon Skeet mentioned is very similar to Matthew Kwan's "SNOW" approach. Both of them hide small amounts of arbitrary information in text without adding, deleting, or changing any of the words in the source text.
Both encode the secret message in normally-irrelevant, normally-invisible whitespace --
extra space and tab characters between words and at the ends of lines.

无声情话 2024-07-17 01:36:38

如果“文本”实际上是图像,那么您可以使用 隐写术 - 数据隐藏在二进制图像文件中,而不影响图像的外观。

If the 'text' was actually an image, then you could hide data in that using steganography - the data is hidden in the binary image file without affecting the way the image looks.

智商已欠费 2024-07-17 01:36:37

可能有一种算法可以将该句子变成 123,但我认为一般来说,如果您需要存储任何可能的数值,您将需要接受对文本的一些修改!

There may be an algorithm that can turn that sentence into 123, but I think in general you're going to need to accept some modifications to the text if you need to store any possible numerical value!

终止放荡 2024-07-17 01:36:36

我认为您正在寻找一种称为隐写术的东西。 Corinna John 在 CodeProject 上收集了有关该主题的优秀文章集。

http://www.codeproject.com/script/Articles/MemberArticles。 aspx?amid=475133

I think what you're looking for is something called Steganography. Corinna John has an excellent collection of articles on the subject up on CodeProject.

http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=475133

揽清风入怀 2024-07-17 01:36:34

我认为从高层次上讲,您所说的是隐写术。 http://en.wikipedia.org/wiki/Steganography

关于现代技术的部分应该得到您开始了:http://en.wikipedia.org/wiki/Steganography#Modern_steganograph_techniques

I think at a high level what you are talking about is steganography. http://en.wikipedia.org/wiki/Steganography

The section on modern techniques should get you started: http://en.wikipedia.org/wiki/Steganography#Modern_steganographic_techniques

浅笑轻吟梦一曲 2024-07-17 01:36:33

解决这个问题有非常复杂的方法,但是您可以采用一种非常简单的方法。 例如,为每个数字定义一个形容词:

0. beautiful
1. harmless
2. evil
3. colorful
4. weird

等等。 现在选择您选择的句子并将占位符放入形容词所属的句子中。

"The {adj} cat sat on the {adj} dog and the {adj} cat was happy."

你的数字是 123,所以你的句子是

"The harmless cat sat on the evil dog and the colorful cat was happy."

解析器可以轻松地获取该句子,将其分解为单词,在上表中找到形容词,然后将它们转换回数字。

The -> ?
harmless -> 1
cat -> ?
sat -> ?
on -> ?
the -> ?
evil -> 2
:

最后你又得到了 123。

一旦人们知道句子中隐藏着信息,算法就很容易被破解。 如果通过为每个数字定义多个形容词来添加变体,则可以使其更难破解。 您不必

1. harmless

定义

1. harmless/stupid/blue/fashionable

何时需要对 1 进行编码,而是随机选择上面的任何单词。 由于这些都映射到数字 1,因此反向解析器不会关心其中打印了哪个单词,结果始终是 1。 这种随机化将使算法的逆向工程变得更加困难。

There are very complicated approaches to this problem, however you can probably go with a very simple one. E.g. define an adjective for every number:

0. beautiful
1. harmless
2. evil
3. colorful
4. weird

and so on. Now select sentences of your choice and put place holders into the sentences where adjectives belong.

"The {adj} cat sat on the {adj} dog and the {adj} cat was happy."

Your number is 123, so your sentence is

"The harmless cat sat on the evil dog and the colorful cat was happy."

A parser can easily take the sentence, split it up into words, find adjectives on the table above, and convert them back to numbers.

The -> ?
harmless -> 1
cat -> ?
sat -> ?
on -> ?
the -> ?
evil -> 2
:

at the end you have 123 again.

As soon people know that there is information hidden in the sentence, the algorithm is easily broken. You can make it harder to break if you add variation by defining multiple adjectives per number. Instead of

1. harmless

you can define

1. harmless/stupid/blue/fashionable

when you need to encode 1, randomly pick any of the words above. As these all map to the number 1, the reverse parser won't care which of the words is printed there, the result will always be one. This randomization will make it harder to reverse engineer the algorithm.

一袭水袖舞倾城 2024-07-17 01:36:33

事实上,HTML 使得做到这一点变得非常容易。 不需要真正狡猾的大量隐写术等。让我们看看:

这句话嵌入了 123,然后停止嵌入。

这句话嵌入0102,然后停止嵌入。

(我们必须看看它是否真的在 markdown 中有效,但我怀疑是这样。)诚然,如果您知道有东西需要寻找,那么这是非常明显的,但我认为您会同意事实并非如此对于不经意的观察者来说是显而易见的。

我将其作为一个小谜题来制定该方案,但如果您希望明确解释它,请添加注释。

HTML makes it quite easy to do this, actually. No need for really cunning amounts of steganography, etc. Let's see:

This sentence embeds 123 and then stops embedding.

This sentence embeds 0102 and then stops embedding.

(We'll have to see whether it actually works in markdown, but I suspect so.) Admittedly it's pretty obvious if you know that there's something to look for, but I think you'll agree it's not obvious to casual observers.

I've left it as a little puzzle to work out the scheme, but add a comment if you want it to be explicitly explained.

你的呼吸 2024-07-17 01:36:32

当然这是可以做到的。

您所描述的内容是一个名为隐写术的广泛描述。

例如,您可以对数字进行编码,计算单词数,直到看到字母 B,在这种情况下,123 可以编码为:

You belong to the beautiful group of people being elite.

问题是,想要解码您的消息的人 /em> 必须知道你的算法。

编辑 我注意到我的数字少了一位。 从 0 开始数,您会看到数字 123。

Of course this can be done.

What you are describing is in a broad description called Steganography.

For instance, you might encode a number in such a way that you count the number of words until you see the letter B, in which case 123 could be encoded as:

You belong to the beautiful group of people being elite.

The thing is, the person wanting to decode your message must know your algorithm.

Edit I notice that my numbers are off by one. Start counting at 0 and you'll see the number 123.

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