I want to create a C program for image steganography.
What I have tried:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main(){
FILE *image;
char fpath[1000],mydata[100];
BITMAPINFOHEADER bih;
int i=0,b[8],g[8],r[8];
double asciiTobinary;
printf("Enter BMP file path");
scanf("%s",fpath);
image=fopen(fpath,"rb");
while(image==NULL){
printf("Error! Enter path again:");
scanf("%s",fpath);
}
fseek(image,2,SEEK_SET);
fread(&bih.size,4,1,image);
printf("\n \n Size of the image=%d\n",bih.size);
fseek(image,18,SEEK_SET);
fread(&bih.width,4,1,image);
fseek(image,22,SEEK_SET);
fread(&bih.height,4,1,image);
printf("\n \n Width of the image =%d \n Height of the image =%d \n pixel = b | g | r \n \n",bih.width,bih.height);
PIXEL pic[bih.width*bih.height*2],p;
while(!feof(image)){
fread(&p.blue,sizeof(p.blue),1,image);
fread(&p.green,sizeof(p.green),1,image);
fread(&p.red,sizeof(p.red),1,image);
pic[i]=p;
printf(" %d= %u | %u | %u ",i+54,pic[i].blue,pic[i].green,pic[i].red);
i++;
}
fclose(image);
return 0;
}