Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6088859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:02:03+00:00 2026-05-23T12:02:03+00:00

I am playing around with steganography. I am trying to pull a text file

  • 0

I am playing around with steganography. I am trying to pull a text file from a image. I am able to read the file, get the bits, but I have an issue with the extraction of these bits.

int getbits( pixel p) {
    return p & 0x03;   
}

char extract ( pixel* image ) {
    static int postion;
    postion = 0;

    postion = *image;

    postion++;

    char curChar;
    curChar = '\0';
    for(int i = 0; i<4; ++i) {
        curChar = curChar << 2;
        curChar = curChar | getbits(postion);
    }
    return curChar;
}

Pixel is an unsigned char. I have loop that calls extract() and fputc(3) the return value. I feel like I am getting garbage from these bits. Which causes me to have massive (1.5 gig) txt files in return.

void decode( PgmType* pgm, char output[80] )
{
FILE*outstream;
int i, length;

outstream = fopen(output, "w");

if(!outstream)
{
    fatal("Could not open");
}
for(i=0; i < 16; ++i)
{
    length = length << 2;
    length = length | getbits(*pgm->image);
}
if ((length* 4) < (pgm->width * pgm->height))
{
    fatal("File Too Big");
}
for (i = 0 ;i<length; ++i)
{
    fputc(extract(pgm->image), outstream);

}
fclose(outstream);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:02:04+00:00Added an answer on May 23, 2026 at 12:02 pm

    You are only actually reading the first pixel in the image – [Edit] because while you are trying to use a static var to keep count, as Oli points out you’re immediately overwriting it.

    Instead use position to track your count; but hold the data in another var:

    Instead extract() should look something like:

    char extract ( pixel* image )
    {
       static int postion = 0;
    
       pixel data = image[position];
    
       postion++;
    
       // use 'data' for processing
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im playing around with the Tablesorter plug-in for jQuery and was trying to get
Just playing around with the now released Silverlight 2.0. I'm trying to put a
been playing around with ResolveClientUrl(~/Confirmation.aspx) and other methods.. I am tryin go get the
I'm playing around with LinqToSQL using an existing multi-lingual database, but I'm running into
been playing around with Capistrano to get an automated deploy between my server and
Im playing around with TryParse() But lets say the parsing fails, then returns false,
While playing around with the emulator, I noticed that when trying to view a
iam playing around with OPEN CV from Intel with the associated PHP Extensions. Works
Playing around with generating text randomly with each page refresh using php. Is there
Just playing around with java trying to learn it etc. Here is my code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.