# Encrypt message in html file

**URL:** <https://www.ruby-forum.com/t/encrypt-message-in-html-file/181211>\
**Category:** Ruby\
**Created:** [January 7, 2010, 12:50pm UTC](https://www.ruby-forum.com/t/encrypt-message-in-html-file/181211 "2010-01-07T12:50:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![naething](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e47774/32.png) [@naething](https://www.ruby-forum.com/u/naething)\
**Post date:** [January 7, 2010, 12:50pm UTC](https://www.ruby-forum.com/t/encrypt-message-in-html-file/181211/1 "2010-01-07T12:50:28Z")

</div>

Hello. How you can encrypt a message using as a container HTML file,  
that is, the message must be recorded in the gaps that HTML ignores.

---

<div class="post-metadata">

**Author:** ![naething](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e47774/32.png) [@naething](https://www.ruby-forum.com/u/naething)\
**Post date:** [January 7, 2010, 1:10pm UTC](https://www.ruby-forum.com/t/encrypt-message-in-html-file/181211/2 "2010-01-07T13:10:50Z")

</div>

On 07.01.2010 12:50, Gregory Biasky wrote:

> Hello. How you can encrypt a message using as a container HTML file,  
> that is, the message must be recorded in the gaps that HTML ignores.

HTML has no “gaps”, in the sense that content is ignored.

The only way to transfer a cyphertext in HTML would be the tag,  
which is ignored if a _browser_, or rather HTML rendering engine, cannot  
make sense of it (it’s still available if you look in the HTML source).

Content in the is displayed as best as possible by the  
rendering engine.

This is, however, not cryptography, but a very poor man’s steganography,  
in the first place.

This is probably better placed on the security-basics mailing list[0],  
rather than ruby-talk, too.

[0] [http://www.securityfocus.com/archive/105/description](http://www.securityfocus.com/archive/105/description)

---

<div class="post-metadata">

**Author:** ![naething](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e47774/32.png) [@naething](https://www.ruby-forum.com/u/naething)\
**Post date:** [January 7, 2010, 5:44pm UTC](https://www.ruby-forum.com/t/encrypt-message-in-html-file/181211/3 "2010-01-07T17:44:53Z")

</div>

Gregory Biasky wrote:

> it does not address the problem of safety, it is a task for the  
> demonstration of shorthand, using as a container, not the image of a  
> html file. In general, how to find a whitespace and insert there the  
> encrypted information, that is the question \*?

You could put it in comments, or encode it as whitespace characters, or  
use a fake tag.  
Note that this has nothing to do with Ruby and so is off topic here.

Best,  
–Â  
Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![naething](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e47774/32.png) [@naething](https://www.ruby-forum.com/u/naething)\
**Post date:** [January 7, 2010, 4:14pm UTC](https://www.ruby-forum.com/t/encrypt-message-in-html-file/181211/4 "2010-01-07T16:14:37Z")

</div>

it does not address the problem of safety, it is a task for the  
demonstration of shorthand, using as a container, not the image of a  
html file. In general, how to find a whitespace and insert there the  
encrypted information, that is the question \*?

---

<div class="post-metadata">

**Author:** ![naething](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e47774/32.png) [@naething](https://www.ruby-forum.com/u/naething)\
**Post date:** [January 7, 2010, 7:12pm UTC](https://www.ruby-forum.com/t/encrypt-message-in-html-file/181211/5 "2010-01-07T19:12:01Z")

</div>

On 07.01.2010 16:14, Gregory Biasky wrote:

> it does not address the problem of safety, it is a task for the  
> demonstration of shorthand, using as a container, not the image of a  
> html file. In general, how to find a whitespace and insert there the  
> encrypted information, that is the question \*?

“string with\_a\_space”.gsub " ",“some\_other\_text\_maybe\_encrypted”

That does not, however, _hide_ your text.

BTW: shorthand is _not_ steganography (you were talking about the latter  
in your OP).
