Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Article Preview


Buy Now

Print:
PDF:

Beyond the Limits

Stego Part II

Issue: 1.5 (April/May 2003)
Article Description: No description available.
Article Length (in bytes): 9,885
Starting Page Number: 46
RBD Number: 1525
Resource File(s): None
Related Link(s): None
Known Limitations: None

Excerpt of article text...

In the previous column we set up a basic steganographic engine that encoded pictures and text files inside PICT files. We are going to improve this engine along the following lines:

* faster encoding/decoding;

* secure encoding scheme;

* accept more file types, including files with resource forks;

* storage of multiple files.

Last time I gave you a hint regarding improving the speed of the engine: MemoryBlocks. When manipulating arbitrary data, like in this case, MemoryBlocks are, if not convenient, much faster than strings. They require more care when dealing with them, but the impact on speed is remarkable. Whenever you have to manipulate arbitrary data, use MemoryBlocks.

Last time, we put the data in strings, parsed it, and split it over the pixels of a picture. While a little more cumbersome, using MemoryBlocks instead will prove much faster. Here is the basic principle. Let's assume that mm is a MemoryBlock containing the data stream we want to encode. Each byte to be encoded can be retrieved by mm.Byte(pointer), pointer being just that: a position pointer to the MemoryBlock. This returns an integer, which makes the speed improvement twice as great since it replaces two string functions: Asc(Mid(s,i,1)). This was quite expensive, since we had to retrieve the byte to encode (mid) and then convert it to an integer. Instead of that, one call to a MemoryBlock does it all.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com