⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hide4pgp.doc

📁 把信息隐藏到图片中
💻 DOC
📖 第 1 页 / 共 2 页
字号:
as if you would copy <file 1> to <file 2>. Likewise, use  UnHide <file 1> <file 2> [options ...]to extract (the secret data in) <file 1> to <file 2>. Any options MUSTfollow behind the filenames (unlike with Hide4PGP itself, where optionsmay appear anywhere on the command line).3 - TechnicalHide4PGP works only on real data in the data file and leaves unusedspace untouched. This allows the data file to be converted into otherpicture or sound formats and leave the data intact.Hide4PGP now spreads the secret data evenly over the whole multimediafile. With real quantitative data it is able to use more than one bitper data point. It has built-in limits how many bits it may use: withpalettized SVGA BMP files 1 bit, with true grey-scale BMP files 2 bitsand with true color BMP files 6 bits per pixel (2 bits per channel),with VOC and 8 bit WAV files 1 bit and with 12 or 16 bit WAV files 4bit per sample. The limits should guarantee that no change of themultimedia file contents will be evident to the normal viewer orlistener. The new format is incompatible to the versions before 2.0:you need version 1.1 to recover hidden data stored with Hide4PGP 1.x.256 colors bitmaps often have only 100 or less colors. The remainingpalette entries are still present but unused. Hide4PGP may use someof them as partners for used colors whose first assigned partnerlacks enough similarity. For this purpose the color in question iscopied to the unused entry, resulting in two (nearly) identicalentries; only 'nearly' because partner colors always differ in theleast significant bit of one channel. Graphic programs or convertersthat rearrange the palette will respect the small difference, butscanning programs may search for those nearly identical entries.Hide4PGP uses unused entries only on rare occasions, but this also maybe suppressed with the '-nu' switch.Finding a suitable partner for each of the entries of a 256 colorpalette needs a measure of similarity. As distances in the RGBcolorspace do not correlate very good with the human perception Idecided to convert the RGB coordinates into the CIE L*a*b* coordinatesas their distances give a much better correlation. Conversion formulasfor the proposed sRGB standard by HP/Microsoft are used, taking alsoin account the nonlinearity of the typical monitor.The DOS executable has been compiled using the Microsoft Quick C 2.5Compiler in the compact model (code near, data far), the 32 bit OS/2code is produced by IBM's C Set with a single thread and staticlinkage for the 386 target processor, and the Win32 consoleapplication was built using the lcc-win32/wedit C IDE by Jacob Navia,available at http://www.cs.virginia.edu/~lcc-win32. The Linuxexecutable has been compiled with gcc (egcs-2.91.66 and glibc 2.0/2.1)with help of Matthias Dort <mdort@inz2cl01.rzffm.db.de> and a Makefileprovided mainly by Thomas Hertweck <ubtj@rz.uni-karlsruhe.de>. If youwonder why the Win32 executable is so small compared to the DOS andOS/2 ones: the reason is that the Win32 systems have a standard Clibrary already included: crtdll.dll holds all standard c functions(and some non standard ones too), so practically no libraries have tobe statically linked.4 - Source CodeThis program is written in ANSI C with the following exceptions:On non UNIX systems the stdin/stdout streams are usually working intext mode, i.e. they translate 0x0A to 0x0D 0x0A and vice versa. Thisdestroys the encrypted message when Hide4PGP reads and writes throughthese channels. In ANSI C there is no way to switch the mode of thealready redirected stdin or stdout to binary operation withoutloosing the redirection. The SAA 2 extension allows the use of thefreopen() function with an empty string as the first parameter(redirection target). This worked with the IBM C Set Compiler, but notwith the MS Quick C I used for the DOS version or lcc for Win32. Thedocumentation of the Quick C recommends the use of the low levelsetmode() function, which in turn doesn't work with the ICC. Thefunctionality is essential in the Hide4PGP.C module, so I decided toimplement both possibilities and use a preprocessor switch to activateone of them. You can activate the freopen() method by defining themacro USE_FREOPEN, and the setmode() alternative likewise by definingUSE_SETMODE. By default no constant is defined and the compiler willabort with an error message on non UNIX systems. The macro definitionshould be added to the compiler's options (e.g. /DUSE_FREOPEN). Sotake a look at your compiler's specification if you can use one ofthese possibilities. If not, you would have to substitute this linewith own code (in the middle of main() at the bottom of Hide4PGP.C).On UNIX systems the UNIX macro has to be defined to avoid the errorabort.The low level fstat and utime are used to reset the file modificationtime to the pre-write state. It is assumed that the struct utimbuf isdefined and has the same types in the same order as the componentsst_atime and st_mtime of struct stat. Otherwise additionally avariable of type struct utimbuf would have to be defined and thevalues assigned for each component.The header file Hide4PGP.H defines types for several integer sizes.They should work for most compilers provided that:   char is 8 bit   short int is 16 bit   long int is 32 bitIf this is not true for you, you only will have to replace the defini-tions in the header file with appropriate types for your compiler.The program assumes that all integers are stored in the little-endianformat, which is true for all intel prozessors. For big-endianmachines there may be a compiler switch to simulate little-endianbehaviour. If your system only writes or reads 16 or 32 bit values inthe order MSB first, you will have to change all appearances of'fread' and 'fwrite' with more than 8 bit datasize too.The Makefiles provided are for MS Quick C 2.5 for DOS, for the IBMC Set 2.1 for OS/2, for Jacob Navia's lcc-win32 version 3.1 and forgcc under Linux and may have to be be changed for other compilers.Generally spoken you need all *.c and the *.h file to compile to *.oor similar and to be linked to one executable Hide4PGP(.EXE).Please send me an email if you successfully ported this program toanother operating system. My email address is Heinz.Repp@online.de.This is also the address for bug reports, recommendations or improve-ments!5 - Other sourcesInformation about the structure of WAV and VOC files I found in anarticle by Kai Schwirtzke in c't 1/93, p. 213. The BMP Windows formatwas described in a file named BMP.DOC in one CompuServe graphics forum- thanks to the unknown author. Infos about the OS/2 BMP structures Ifound in the OS/2 header files of the compiler - and by looking at theBMP files themselves. Information about the CIE colorspaces andconversion formulas I found in the Color spaces FAQ by David Bourgin(attention: the conversion formula XYZ -> Lab for L* is faulty!)  andan article by Michael Haas and Todd Newman of the International ColorConsortium, 'Color Management: Current Practice and The Adoption of aNew Standard'. Some of the algorithms are modified from RobertSedgewick's 'Algorithms.'6 - Historyv1.0  first public release (Dec 20, 1996)v1.1  second public release (May 22, 1997)      - allows now any number of bits from 1 to 8      - added OS/2 32 bit executable and makefile      - increased portability with much more strict typing      - minor change in split_pair routine (BMP.C)      - fixed: out of memory error handler      - removed a former second pairing method      - removed the former -d '=' modifier      - changed the former -v- option to -q (Quiet)v2.0  third public release (Feb 10, 2000)      - new: 'spyder'-derived method for palettized bitmaps      - removed: former duplicating and pairing method      - removed: -d and -p options      - new: -u/-nu option (unused palette entries)      - new: -nc option (suppress color adjustments)      - removed: -# (number of bits) option      - new: spreads secret data over whole multimedia file      - new: saves and restores exact length      - new: scrambles data before hiding      - changed: completely new format, incompatible to versions 1.x      - new: resets modification timestamp of multimedia file      - new: -nf option (suppress timestamp faking)      - new: optional filename for secret data instead of streaming      - changed: return codes (now all defined in Hide4PGP.H)7 - Legal StuffYou may freely use this software in any environment. You may makecopies and freely distribute this software provided the archivecontains all files of the original distribution and is not modified inany way. You may distribute it in any Freeware / Shareware / PDcollection provided the charge for the data carrier is only nominaland covers only the media and copying costs. You may not sell thisprogram or include it into a for profit product without writtenconsent of the author. You may compile the source on any othercomputer system. You may change the source code and distribute themodified version only if you clearly state all differences, leave thecopyright notice intact and inform the author.THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND.UNDER NO CIRCUMSTANCES SHALL THE AUTHOR BE LIABLE FOR ANY INCIDENTAL,SPECIAL OR CONSEQUENTIAL DAMAGES (INCLUDING DAMAGES FOR LOSS OFBUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATIONAND THE LIKE) ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWAREOR ITS DOCUMENTATION.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -