Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Sounds like a test. You employers want to know if you have the knowledge to figure this out? In which case, you need to understand character encoding and image formats.
For eg. a way to add a character to a bitmap would be to replace a particular pixel value with the character's ascii value. In the picture, it would appear as a single wrong pixel, lost in a high-res image.
You could extract it by zooming in on the image (without anti-aliasing) until individual pixels are visible, then using a color picker tool.
A more common way is to xor the string, suitably padded, to the binary of the image. You extract the plaintext with xor and the unadulterated image.
It is also possible to create a bitmap of the character at a suitable resolution - then odd it to the bitmap image, then compress the image. Nasty as jpeg compression is lossy.
My point here is that there are lots of ways of getting text into another file (image file in this case). If you have not been told how, then you will have to use your native wit, and your knowledge of the resources available to the people who made the image, to figure it out.
Please answer the questions in the previous responses.
If I use my previous example of adding a string to a bitmap - you will notice that the string is just a row of numbers, and so is the bitmap. In the bitmap, the numbers represent color values while in the string the numbers represent characters.
The exact meaning of the numbers depends on how the characters/colors are encoded. Maybe the colors are HSV, maybe the characters are utf8? Whatever.
Normally an image will have some metadata at the start - this will depend on the actual encoding of the image. Typically, the metadata will say how wide hde image is and what the color encoding is. If the metadata of the image occupies the first N bytes, and the string has S bytes, then you can substitute the bytes of the string for the bytes of thu image starting at byte N+1 and ending at N+S.
So, you need to study character and image encoding methods. You need to find the C++ instructions for manipulating binary files. Then you will have your solution.
Another alternative would be to write out your string as a bitmap - in a painting program, for eg. Then you can just xor the two bitmaps together.
Z = Img xor Str
In which case, you just need to know how to do an xor operation in C++
Last edited by Simon Bridge; 05-07-2008 at 02:45 AM.