您的位置:首页 >> 编程开发 >> Visual C++ >> 文件系统 >> 正文
RSS
 

在BMP文件中隐藏信息

http://www.rdxx.com 04年02月14日 12:12 PConline 我要投稿

关键词: 隐藏 , BMP , 信息 , 文件
作者: John Collomosse
关键字: BMP 加密
原作者姓名: John Collomosse
文章原始出处: http://www.blindside.co.uk/

介绍

Blindside is a steganography application that hides
information inside .BMP (bitmap) images. It is
a command-line utility, for which source code and
precompiled Unix binaries are available.

The Blindside homepage is located at:

http://www.blindside.co.uk/

正文

#include < stdio.h >
#include < stdlib.h >
#include < string.h >

/************************************\
* B L I N D S I D E *
* *
* Image stego/crypto tool, please *
* see http://www.blindside.co.uk *
* *
* Compile with GCC or equiv ANSI C *
* *
* John Collomosse (mapjpc@bath.ac.uk)*
* Freeware/public domain *
* *
\************************************/

#define HEAP_UNITSIZE (102400)
#define HEAP_INITUNITS (1)
#define LOOKUP_INITLEN (2048)
#define FALSE (0)
#define TRUE (-1)
#define PATH_SEP ('\\') /* OS Specific Path Seperator */
#define BANNER ("BlindSide BMP Cryptographic Tool - (c) John Collomosse 2000\nRelease v0.9. All Rights Reserved, contact: ma7jpc@bath.ac.uk\n\n")
#define THIS_PROTO_VER (1)

/* Heap Structure (memory storage class for uchars) */
typedef struct heapstruct {
unsigned int heapunits; /* Heap size to nearest 'unit' */
unsigned char *dataspace; /* Dataspace where data stored */
unsigned char *nextchar; /* Pointer to end of dataspace */
unsigned long heaplen; /* Length of data in heap */
} HEAP;

typedef struct lookupstruct {
unsigned long int* dataspace;
unsigned long int currentlen;
unsigned long int curitem;
} LOOKUP;

/* Bitmap Structure */
typedef struct bmpstruct {
char* signature;
long filesize;
long x_size;
long y_size;
int bitplanes;
int bpp;
long compression;
long compresssize;
long x_pix_per_metre;
long y_pix_per_metre;
long colours;
long cols_important;
HEAP* palette;
HEAP* raster;
} BITMAP;

typedef struct pixstruct {
unsigned char red;
unsigned char green;
unsigned char blue;
} PIXEL;

/* Function prototypes */
int initialiseHeap (HEAP*);
int expandHeap (int, HEAP*);
void removeHeap (HEAP*);
int putToHeap (unsigned char,HEAP*);
int streamFileToHeap (FILE*, HEAP*);
int readBitmapFile (FILE*, BITMAP*);
void promoteTo24 (BITMAP*, BITMAP*);
unsigned long resolveMaxEncode (BITMAP*, LOOKUP*);
void writeBitmapFile (FILE*, BITMAP*);
unsigned int biggest_of_3 (unsigned int,unsigned int,unsigned int);
void longToStream (FILE*,unsigned long int);
unsigned long streamToLong (FILE*);
void process24gotpixel (unsigned char, unsigned char*,HEAP*);
unsigned int calcEOLpad (int, long);
PIXEL getIndexedPixel (unsigned long int, BITMAP*);
void encodeData (BITMAP*, HEAP*, LOOKUP*);
void setIndexedPixel (unsigned long int, BITMAP*, PIXEL);
unsigned char getNextHeapBit (unsigned long int, int, HEAP*);
int decodeData (BITMAP*, HEAP*);
void cryptoData (HEAP* data, unsigned char* key);
unsigned char xor (unsigned char, unsigned char);
int rotl4 (int);
int hash_func (unsigned char*);
int pow (int,int);
int stricmp (const char*, const char*);
int formatDataspace (BITMAP*, HEAP*);
void dumpFileDirectory (HEAP*);
void dumpFileStats (BITMAP*, HEAP*);
void addFileToArchive (HEAP*, FILE*, char*);

 
 
标签: 隐藏 , BMP , 信息 , 文件 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站