├── .gitignore ├── intl ├── VERSION ├── locale.alias ├── osdep.c ├── ref-del.sin ├── ref-add.sin ├── os2compat.h ├── dgettext.c ├── dcgettext.c ├── hash-string.h ├── gettext.c ├── dcngettext.c ├── dngettext.c └── ngettext.c ├── po ├── LINGUAS ├── de.po ├── es.po ├── fr.po ├── quot.sed ├── boldquot.sed ├── remove-potcdate.sin ├── insert-header.sin ├── Makevars ├── en@quot.header ├── en@boldquot.header └── Rules-quot ├── doc ├── es │ └── steghide.1 └── Makefile.am ├── tests ├── data │ ├── rnd100 │ ├── std.jpg │ ├── prog.jpg │ ├── mulaw_std.au │ ├── pcm16_std.au │ ├── pcm8_std.au │ ├── pcm8_std.wav │ ├── os21x1_std.bmp │ ├── os21x4_std.bmp │ ├── os21x8_std.bmp │ ├── pcm16_std.wav │ ├── win3x1_std.bmp │ ├── win3x4_std.bmp │ ├── win3x8_std.bmp │ ├── os21x24_std.bmp │ ├── win3x24_std.bmp │ └── Makefile.am ├── systemtests.pl ├── MHashKeyGenTest.cc ├── utcommon.h ├── TestCategory.h ├── AUtilsTest.h ├── MHashKeyGenTest.h ├── MCryptPPTest.h ├── BmpFileTest.h ├── TestCategoryCaller.h ├── MCryptPPTest.cc ├── JpegSampleValueTest.h ├── SelectorTest.h ├── JpegFileTest.h ├── Test.h ├── BmpRGBSampleValueTest.h ├── AuFileTest.h ├── AudioSampleValueTest.h ├── WavPCMSampleValueTest.h ├── BmpOS2FileTest.h ├── BmpPaletteSampleValueTest.h ├── EmbDataTest.h ├── SampleValueAdjacencyListTest.h ├── AUtilsTest.cc ├── WavFileTest.h ├── MatchingTest.h ├── BmpWinFileTest.h ├── BFSAPHeuristicTest.h ├── DFSAPHeuristicTest.h ├── WKSConstructionHeuristicTest.h ├── BitStringTest.h ├── DummySampleValue.h ├── st_fileformats.pl ├── MHashPPTest.h ├── GraphTest.h ├── TestSuite.h ├── st_embparameters.pl ├── JpegSampleValueTest.cc ├── SampleValueTest.h ├── UnitTest.cc ├── DummySampleValue.cc ├── BmpFileTest.cc └── EdgeIteratorTest.h ├── AUTHORS ├── ChangeLog ├── m4 ├── Makefile.am ├── codeset.m4 ├── inttypes.m4 ├── glibc21.m4 ├── ulonglong.m4 ├── stdint_h.m4 ├── inttypes_h.m4 ├── isc-posix.m4 ├── uintmax_t.m4 ├── inttypes-pri.m4 ├── lcmessage.m4 ├── intdiv0.m4 └── progtest.m4 ├── NEWS ├── Makefile.am ├── BUGS ├── TODO ├── CREDITS ├── steghide.spec.in └── src ├── WavChunk.cc ├── Arg.cc ├── Utils.h ├── PseudoRandomSource.cc ├── Extractor.h ├── SteghideError.h ├── AuSampleValues.h ├── WavChunk.h ├── AssertionFailed.h ├── Utils.cc ├── WavChunkUnused.cc ├── MatchingAlgorithm.cc ├── RGBTriple.cc ├── wrapper_hash_map.h ├── wrapper_hash_set.h ├── Terminal.h ├── WavChunkHeader.h ├── WavChunkUnused.h ├── JpegSampleValue.h ├── SteghideError.cc ├── MatchingAlgorithm.h ├── BmpSampleValue.cc ├── WavChunkHeader.cc ├── AuSampleValues.cc ├── Session.h ├── SampleOccurence.h ├── BmpSampleValue.h ├── MHashKeyGen.h ├── Embedder.h ├── AssertionFailed.cc ├── WavPCMSampleValue.h ├── ColorPalette.h ├── DMDConstructionHeuristic.h ├── RGBTriple.h ├── WavFormatChunk.h ├── SMDConstructionHeuristic.h ├── BmpPaletteSampleValue.h ├── SMDConstructionHeuristic.cc ├── BFSAPHeuristic.h ├── PseudoRandomSource.h ├── Makefile.am ├── Arg.h ├── AuData.h ├── SampleValue.cc ├── BmpPaletteSampleValue.cc ├── ProgressOutput.h ├── EncryptionMode.h ├── DMDConstructionHeuristic.cc ├── RandomSource.h ├── Terminal.cc └── ProgressOutput.cc /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | compile 4 | test-driver 5 | -------------------------------------------------------------------------------- /intl/VERSION: -------------------------------------------------------------------------------- 1 | GNU gettext library from gettext-0.11.5 2 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | # Set of available languages 2 | es de fr ro ru 3 | -------------------------------------------------------------------------------- /po/de.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/po/de.po -------------------------------------------------------------------------------- /po/es.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/po/es.po -------------------------------------------------------------------------------- /po/fr.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/po/fr.po -------------------------------------------------------------------------------- /doc/es/steghide.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/doc/es/steghide.1 -------------------------------------------------------------------------------- /intl/locale.alias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/intl/locale.alias -------------------------------------------------------------------------------- /tests/data/rnd100: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/rnd100 -------------------------------------------------------------------------------- /tests/data/std.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/std.jpg -------------------------------------------------------------------------------- /tests/data/prog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/prog.jpg -------------------------------------------------------------------------------- /tests/data/mulaw_std.au: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/mulaw_std.au -------------------------------------------------------------------------------- /tests/data/pcm16_std.au: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/pcm16_std.au -------------------------------------------------------------------------------- /tests/data/pcm8_std.au: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/pcm8_std.au -------------------------------------------------------------------------------- /tests/data/pcm8_std.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/pcm8_std.wav -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Stefan Hetzl, shetzl@chello.at 2 | many others in between 3 | Onkobu, https://github.com/onkobu/ 4 | -------------------------------------------------------------------------------- /tests/data/os21x1_std.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/os21x1_std.bmp -------------------------------------------------------------------------------- /tests/data/os21x4_std.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/os21x4_std.bmp -------------------------------------------------------------------------------- /tests/data/os21x8_std.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/os21x8_std.bmp -------------------------------------------------------------------------------- /tests/data/pcm16_std.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/pcm16_std.wav -------------------------------------------------------------------------------- /tests/data/win3x1_std.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/win3x1_std.bmp -------------------------------------------------------------------------------- /tests/data/win3x4_std.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/win3x4_std.bmp -------------------------------------------------------------------------------- /tests/data/win3x8_std.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/win3x8_std.bmp -------------------------------------------------------------------------------- /tests/data/os21x24_std.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/os21x24_std.bmp -------------------------------------------------------------------------------- /tests/data/win3x24_std.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StegHigh/steghide-bak/HEAD/tests/data/win3x24_std.bmp -------------------------------------------------------------------------------- /po/quot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | # 0.6.0 2 | 3 | - 18 years later: bump to 0.6.0 4 | - added modern autotools files 5 | - fixed compiler errors due to type/ syntax changes 6 | - fixed libtool tagging 7 | 8 | # 0.5.1 9 | -------------------------------------------------------------------------------- /po/boldquot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | s/“/“/g 8 | s/”/”/g 9 | s/‘/‘/g 10 | s/’/’/g 11 | -------------------------------------------------------------------------------- /m4/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 2 | MAINTAINERCLEANFILES = Makefile.in 3 | -------------------------------------------------------------------------------- /tests/data/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | os21x1_std.bmp os21x4_std.bmp os21x8_std.bmp os21x24_std.bmp \ 3 | win3x1_std.bmp win3x4_std.bmp win3x8_std.bmp win3x24_std.bmp \ 4 | mulaw_std.au pcm8_std.au pcm16_std.au \ 5 | pcm8_std.wav pcm16_std.wav \ 6 | std.jpg prog.jpg \ 7 | rnd100 8 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | # Resurrection 2024-02-20 2 | 3 | Trying to put together a community to maintain Steghide. 4 | 5 | # Resurrection 2021-08-01 6 | 7 | Someone on the internet couldn't resist and made it great again. 8 | 9 | # Release 0.5.1, 2003-10-15 04:53 10 | 11 | Those were the days. 12 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | man_MANS = steghide.1 2 | EXTRA_DIST = steghide.1 es/steghide.1 3 | MAINTAINERCLEANFILES = Makefile.in 4 | 5 | if HAVE_DOXYGEN 6 | noinst_DATA = doxygen 7 | 8 | clean-local: 9 | rm -rf doxygen 10 | 11 | maintainer-clean-local: 12 | rm -rf doxygen 13 | 14 | doxygen: 15 | doxygen ../steghide.doxygen 16 | endif 17 | -------------------------------------------------------------------------------- /tests/systemtests.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | use FileHandle ; 3 | 4 | STDOUT->autoflush(1) ; 5 | 6 | print "-------------------------\n\n" ; 7 | print "Running System Tests.....\n\n" ; 8 | print "-------------------------\n\n" ; 9 | 10 | $exitvalue = 0 ; # 0 -> everything ok, 1 -> an error occured 11 | while () { 12 | # pass command line args to st_*.pl scripts 13 | if (system "./$_ @ARGV") { 14 | $exitvalue = 1 ; 15 | } 16 | } 17 | exit $exitvalue ; 18 | -------------------------------------------------------------------------------- /po/remove-potcdate.sin: -------------------------------------------------------------------------------- 1 | # Sed script that remove the POT-Creation-Date line in the header entry 2 | # from a POT file. 3 | # 4 | # The distinction between the first and the following occurrences of the 5 | # pattern is achieved by looking at the hold space. 6 | /^"POT-Creation-Date: .*"$/{ 7 | x 8 | # Test if the hold space is empty. 9 | s/P/P/ 10 | ta 11 | # Yes it was empty. First occurrence. Remove the line. 12 | g 13 | d 14 | bb 15 | :a 16 | # The hold space was nonempty. Following occurrences. Do nothing. 17 | x 18 | :b 19 | } 20 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = dist-bzip2 dist-zip 2 | SUBDIRS = m4 intl po doc src tests 3 | docdir = $(prefix)/share/doc/$(PACKAGE) 4 | EXTRA_DIST = config.rpath mkinstalldirs ABOUT-NLS BUGS CREDITS HISTORY LEAME depcomp 5 | doc_DATA = ABOUT-NLS BUGS COPYING CREDITS HISTORY INSTALL LEAME README TODO 6 | MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ 7 | config.sub configure depcomp install-sh missing mkinstalldirs steghide.doxygen steghide.spec 8 | 9 | ACLOCAL_AMFLAGS = -I m4 10 | 11 | uninstall-local: 12 | rmdir $(docdir) 13 | -------------------------------------------------------------------------------- /BUGS: -------------------------------------------------------------------------------- 1 | 2 | * .au mu-law audio data is treated as linear 8 bit unsigned value in the neighbourhood relation (with radius 1). 3 | The neighbourhood relation should be defined with respect to the logarithmic nature of mu-law data. 4 | 5 | * steghide uses the classes hash_set and hash_map from sgi's implementation of 6 | the standard template library. These two classes are not part of the official 7 | C++ standard but part of the GNU's libstdc++. If you happen to be on a system 8 | that does not include theses classes you won't be able to compile steghide. 9 | 10 | If you find a bug, please contact us at [StegHigh](https://github.com/StegHigh/steghide) about it. 11 | -------------------------------------------------------------------------------- /po/insert-header.sin: -------------------------------------------------------------------------------- 1 | # Sed script that inserts the file called HEADER before the header entry. 2 | # 3 | # At each occurrence of a line starting with "msgid ", we execute the following 4 | # commands. At the first occurrence, insert the file. At the following 5 | # occurrences, do nothing. The distinction between the first and the following 6 | # occurrences is achieved by looking at the hold space. 7 | /^msgid /{ 8 | x 9 | # Test if the hold space is empty. 10 | s/m/m/ 11 | ta 12 | # Yes it was empty. First occurrence. Read the file. 13 | r HEADER 14 | # Output the file's contents by reading the next line. But don't lose the 15 | # current line while doing this. 16 | g 17 | N 18 | bb 19 | :a 20 | # The hold space was nonempty. Following occurrences. Do nothing. 21 | x 22 | :b 23 | } 24 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | These are things that I plan to implement in the future: 2 | 3 | * partition code into library and frontend 4 | 5 | * graphical user interface 6 | 7 | * user-friendly installer for Windows version (InnoSetup) 8 | 9 | * use libaudiofile for audio file format support 10 | 11 | * make embedding data in audio cds possible (embed markers for synchronization) 12 | 13 | * rewrite memory management such that cover-/stego-file must no longer be kept in memory as a whole 14 | 15 | * support for other file formats (mp3, png, gif, avi) 16 | 17 | * user's guide (sgml?, docbook?, gnu texinfo?) 18 | 19 | * support for RLE-encoded bmps 20 | 21 | * matrix encoding 22 | 23 | ? support for spreading one secret file into a set of >= 1 cover files 24 | 25 | ? support for embedding more than one message into one cover file (different passphrases) 26 | 27 | ? allow PGP encryption of embedded data (gpgme?) 28 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | Stefan Hetzl author, maintainer 2 | 3 | I would like to thank... 4 | 5 | Petra Mutzel for being a great guide trough graph theory 6 | Christine Pippan for designing the logo 7 | Trimbitas Sorin romanian translation 8 | Alberto A. Schiano spanish translation 9 | Cedric Gross french translation 10 | Julien Catanese french translation 11 | Tilman Linneweh freebsd port 12 | Rasputin freebsd port 13 | Brian Russo debian package 14 | Guenter Bechly debian package 15 | 16 | and numerous others who have contributed by sending bug reports 17 | or interesting suggestions. 18 | -------------------------------------------------------------------------------- /steghide.spec.in: -------------------------------------------------------------------------------- 1 | Name: steghide 2 | Summary: a steganography program 3 | Version: @VERSION@ 4 | Release: 1 5 | Copyright: GPL 6 | Group: Applications/File 7 | Source: http://prdownloads.sourceforge.net/steghide/steghide-%{version}.tar.gz 8 | %description 9 | Steghide is a steganography program that is able to hide data in various kinds 10 | of image- and audio-files. The color- respectivly sample-frequencies are not 11 | changed thus making the embedding resistant against first-order statistical 12 | tests. Features of steghide include compression and encryption of embedded data, 13 | embedding of a checksum to verify the integrity of the extracted data and 14 | support for jpeg, bmp, wav and au files. 15 | 16 | %prep 17 | 18 | %setup 19 | ./configure --prefix=/usr 20 | 21 | %build 22 | make 23 | 24 | %install 25 | make install 26 | 27 | %files 28 | %doc ABOUT-NLS BUGS COPYING CREDITS HISTORY INSTALL README TODO 29 | 30 | /usr/bin/steghide 31 | /usr/man/man1/steghide.1 32 | -------------------------------------------------------------------------------- /m4/codeset.m4: -------------------------------------------------------------------------------- 1 | # codeset.m4 serial AM1 (gettext-0.10.40) 2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Bruno Haible. 10 | 11 | AC_DEFUN([AM_LANGINFO_CODESET], 12 | [ 13 | AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, 14 | [AC_TRY_LINK([#include ], 15 | [char* cs = nl_langinfo(CODESET);], 16 | am_cv_langinfo_codeset=yes, 17 | am_cv_langinfo_codeset=no) 18 | ]) 19 | if test $am_cv_langinfo_codeset = yes; then 20 | AC_DEFINE(HAVE_LANGINFO_CODESET, 1, 21 | [Define if you have and nl_langinfo(CODESET).]) 22 | fi 23 | ]) 24 | -------------------------------------------------------------------------------- /intl/osdep.c: -------------------------------------------------------------------------------- 1 | /* OS dependent parts of libintl. 2 | Copyright (C) 2001-2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #if defined __EMX__ 20 | # include "os2compat.c" 21 | #else 22 | /* Avoid AIX compiler warning. */ 23 | typedef int dummy; 24 | #endif 25 | -------------------------------------------------------------------------------- /m4/inttypes.m4: -------------------------------------------------------------------------------- 1 | # inttypes.m4 serial 1 (gettext-0.11.4) 2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Paul Eggert. 10 | 11 | # Define HAVE_INTTYPES_H if exists and doesn't clash with 12 | # . 13 | 14 | AC_DEFUN([gt_HEADER_INTTYPES_H], 15 | [ 16 | AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, 17 | [ 18 | AC_TRY_COMPILE( 19 | [#include 20 | #include ], 21 | [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) 22 | ]) 23 | if test $gt_cv_header_inttypes_h = yes; then 24 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, 25 | [Define if exists and doesn't clash with .]) 26 | fi 27 | ]) 28 | -------------------------------------------------------------------------------- /m4/glibc21.m4: -------------------------------------------------------------------------------- 1 | # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) 2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | # Test for the GNU C Library, version 2.1 or newer. 10 | # From Bruno Haible. 11 | 12 | AC_DEFUN([jm_GLIBC21], 13 | [ 14 | AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, 15 | ac_cv_gnu_library_2_1, 16 | [AC_EGREP_CPP([Lucky GNU user], 17 | [ 18 | #include 19 | #ifdef __GNU_LIBRARY__ 20 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) 21 | Lucky GNU user 22 | #endif 23 | #endif 24 | ], 25 | ac_cv_gnu_library_2_1=yes, 26 | ac_cv_gnu_library_2_1=no) 27 | ] 28 | ) 29 | AC_SUBST(GLIBC21) 30 | GLIBC21="$ac_cv_gnu_library_2_1" 31 | ] 32 | ) 33 | -------------------------------------------------------------------------------- /m4/ulonglong.m4: -------------------------------------------------------------------------------- 1 | # ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40) 2 | dnl Copyright (C) 1999-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Paul Eggert. 10 | 11 | AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], 12 | [ 13 | AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, 14 | [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], 15 | [unsigned long long ullmax = (unsigned long long) -1; 16 | return ull << i | ull >> i | ullmax / ull | ullmax % ull;], 17 | ac_cv_type_unsigned_long_long=yes, 18 | ac_cv_type_unsigned_long_long=no)]) 19 | if test $ac_cv_type_unsigned_long_long = yes; then 20 | AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, 21 | [Define if you have the unsigned long long type.]) 22 | fi 23 | ]) 24 | -------------------------------------------------------------------------------- /tests/MHashKeyGenTest.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include 22 | 23 | #include "MHashKeyGenTest.h" 24 | 25 | #include "BitString.h" 26 | 27 | MHashKeyGenTest::MHashKeyGenTest (TestSuite* s) 28 | : UnitTest ("MHashKeyGen", s) 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /intl/ref-del.sin: -------------------------------------------------------------------------------- 1 | # Remove this package from a list of references stored in a text file. 2 | # 3 | # Copyright (C) 2000 Free Software Foundation, Inc. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Library General Public License as published 7 | # by the Free Software Foundation; either version 2, or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Library General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Library General Public 16 | # License along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | # USA. 19 | # 20 | # Written by Bruno Haible . 21 | # 22 | /^# Packages using this file: / { 23 | s/# Packages using this file:// 24 | s/ @PACKAGE@ / / 25 | s/^/# Packages using this file:/ 26 | } 27 | -------------------------------------------------------------------------------- /tests/utcommon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_UTCOMMON_H 22 | #define SH_UTCOMMON_H 23 | 24 | #define DATADIR "./data/" 25 | #define REMOVE "rm -f" 26 | #define COMPARE "cmp -s" 27 | #define COPY "cp" 28 | 29 | extern bool ArgVerbose ; 30 | 31 | #endif // ndef SH_UTCOMMON_H 32 | -------------------------------------------------------------------------------- /po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = Stefan Hetzl 22 | 23 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 24 | # message catalogs shall be used. It is usually empty. 25 | EXTRA_LOCALE_CATEGORIES = 26 | -------------------------------------------------------------------------------- /m4/stdint_h.m4: -------------------------------------------------------------------------------- 1 | # stdint_h.m4 serial 2 (gettext-0.11.4) 2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Paul Eggert. 10 | 11 | # Define HAVE_STDINT_H_WITH_UINTMAX if exists, 12 | # doesn't clash with , and declares uintmax_t. 13 | 14 | AC_DEFUN([jm_AC_HEADER_STDINT_H], 15 | [ 16 | AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, 17 | [AC_TRY_COMPILE( 18 | [#include 19 | #include ], 20 | [uintmax_t i = (uintmax_t) -1;], 21 | jm_ac_cv_header_stdint_h=yes, 22 | jm_ac_cv_header_stdint_h=no)]) 23 | if test $jm_ac_cv_header_stdint_h = yes; then 24 | AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, 25 | [Define if exists, doesn't clash with , 26 | and declares uintmax_t. ]) 27 | fi 28 | ]) 29 | -------------------------------------------------------------------------------- /src/WavChunk.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "WavChunk.h" 22 | #include "WavChunkHeader.h" 23 | 24 | WavChunk::~WavChunk () 25 | { 26 | if (ChunkHeader != NULL) { 27 | delete ChunkHeader ; 28 | } 29 | } 30 | 31 | void WavChunk::write (BinaryIO *io) 32 | { 33 | ChunkHeader->write (io) ; 34 | } 35 | -------------------------------------------------------------------------------- /tests/TestCategory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_TESTCATEGORY_H 22 | #define SH_TESTCATEGORY_H 23 | 24 | #include "Test.h" 25 | 26 | class TestCategory : public Test { 27 | public: 28 | TestCategory (const std::string& n, TestSuite* s) : Test(n, s) {} ; 29 | } ; 30 | 31 | #endif // ndef SH_TESTCATEGORY_H 32 | -------------------------------------------------------------------------------- /m4/inttypes_h.m4: -------------------------------------------------------------------------------- 1 | # inttypes_h.m4 serial 4 (gettext-0.11.4) 2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Paul Eggert. 10 | 11 | # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, 12 | # doesn't clash with , and declares uintmax_t. 13 | 14 | AC_DEFUN([jm_AC_HEADER_INTTYPES_H], 15 | [ 16 | AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, 17 | [AC_TRY_COMPILE( 18 | [#include 19 | #include ], 20 | [uintmax_t i = (uintmax_t) -1;], 21 | jm_ac_cv_header_inttypes_h=yes, 22 | jm_ac_cv_header_inttypes_h=no)]) 23 | if test $jm_ac_cv_header_inttypes_h = yes; then 24 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, 25 | [Define if exists, doesn't clash with , 26 | and declares uintmax_t. ]) 27 | fi 28 | ]) 29 | -------------------------------------------------------------------------------- /src/Arg.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "Arg.h" 22 | 23 | template Arg::Arg (T v, bool setbyuser) 24 | { 25 | set = false ; 26 | setValue (v, setbyuser) ; 27 | } 28 | 29 | template void Arg::setValue (T v, bool setbyuser) 30 | { 31 | Value = v ; 32 | if (setbyuser) { 33 | set = true ; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /intl/ref-add.sin: -------------------------------------------------------------------------------- 1 | # Add this package to a list of references stored in a text file. 2 | # 3 | # Copyright (C) 2000 Free Software Foundation, Inc. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Library General Public License as published 7 | # by the Free Software Foundation; either version 2, or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Library General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Library General Public 16 | # License along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | # USA. 19 | # 20 | # Written by Bruno Haible . 21 | # 22 | /^# Packages using this file: / { 23 | s/# Packages using this file:// 24 | ta 25 | :a 26 | s/ @PACKAGE@ / @PACKAGE@ / 27 | tb 28 | s/ $/ @PACKAGE@ / 29 | :b 30 | s/^/# Packages using this file:/ 31 | } 32 | -------------------------------------------------------------------------------- /m4/isc-posix.m4: -------------------------------------------------------------------------------- 1 | # isc-posix.m4 serial 2 (gettext-0.11.2) 2 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. 10 | 11 | # This test replaces the one in autoconf. 12 | # Currently this macro should have the same name as the autoconf macro 13 | # because gettext's gettext.m4 (distributed in the automake package) 14 | # still uses it. Otherwise, the use in gettext.m4 makes autoheader 15 | # give these diagnostics: 16 | # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX 17 | # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX 18 | 19 | undefine([AC_ISC_POSIX]) 20 | 21 | AC_DEFUN([AC_ISC_POSIX], 22 | [ 23 | dnl This test replaces the obsolescent AC_ISC_POSIX kludge. 24 | AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) 25 | ] 26 | ) 27 | -------------------------------------------------------------------------------- /m4/uintmax_t.m4: -------------------------------------------------------------------------------- 1 | # uintmax_t.m4 serial 6 (gettext-0.11) 2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Paul Eggert. 10 | 11 | AC_PREREQ(2.13) 12 | 13 | # Define uintmax_t to `unsigned long' or `unsigned long long' 14 | # if does not exist. 15 | 16 | AC_DEFUN([jm_AC_TYPE_UINTMAX_T], 17 | [ 18 | AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) 19 | AC_REQUIRE([jm_AC_HEADER_STDINT_H]) 20 | if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then 21 | AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) 22 | test $ac_cv_type_unsigned_long_long = yes \ 23 | && ac_type='unsigned long long' \ 24 | || ac_type='unsigned long' 25 | AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, 26 | [Define to unsigned long or unsigned long long 27 | if and don't define.]) 28 | fi 29 | ]) 30 | -------------------------------------------------------------------------------- /src/Utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_UTILS_H 22 | #define SH_UTILS_H 23 | 24 | #include 25 | 26 | class Utils { 27 | public: 28 | /** 29 | * gets a number of bytes and returns a human-readable string like e.g. "3,5 KB" 30 | **/ 31 | static std::string formatHRSize (unsigned long size) ; 32 | } ; 33 | 34 | #endif // ndef SH_UTILS_H 35 | -------------------------------------------------------------------------------- /src/PseudoRandomSource.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "PseudoRandomSource.h" 22 | 23 | UWORD32 PseudoRandomSource::getValue (UWORD32 n) 24 | { 25 | // doing the step of the linear congruential method 26 | Value = A * Value + C ; 27 | // scale value to [0...1) and multiply with n 28 | return (UWORD32) (((double) n) * ((double) Value / (double) 4294967296.0)) ; 29 | } 30 | -------------------------------------------------------------------------------- /po/en@quot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | -------------------------------------------------------------------------------- /src/Extractor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_EXTRACTOR_H 22 | #define SH_EXTRACTOR_H 23 | 24 | #include 25 | 26 | class Extractor { 27 | public: 28 | Extractor (std::string stgfn, std::string pp) 29 | : StegoFileName(stgfn), Passphrase(pp) {} ; 30 | 31 | EmbData* extract (void) ; 32 | 33 | private: 34 | std::string StegoFileName ; 35 | std::string Passphrase ; 36 | } ; 37 | 38 | #endif // ndef SH_EXTRACTOR_H 39 | -------------------------------------------------------------------------------- /tests/AUtilsTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_AUTILSTEST_H 22 | #define SH_AUTILSTEST_H 23 | 24 | #include "AUtils.h" 25 | 26 | #include "UnitTest.h" 27 | #include "TestSuite.h" 28 | 29 | class AUtilsTest : public UnitTest { 30 | public: 31 | AUtilsTest (TestSuite* s) ; 32 | 33 | void testLog2 (void) ; 34 | 35 | private: 36 | bool genericTestLog2 (int n, double res) ; 37 | } ; 38 | 39 | #endif // ndef SH_AUTILSTEST_H 40 | -------------------------------------------------------------------------------- /m4/inttypes-pri.m4: -------------------------------------------------------------------------------- 1 | # inttypes-pri.m4 serial 1 (gettext-0.11.4) 2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Bruno Haible. 10 | 11 | # Define PRI_MACROS_BROKEN if exists and defines the PRI* 12 | # macros to non-string values. This is the case on AIX 4.3.3. 13 | 14 | AC_DEFUN([gt_INTTYPES_PRI], 15 | [ 16 | AC_REQUIRE([gt_HEADER_INTTYPES_H]) 17 | if test $gt_cv_header_inttypes_h = yes; then 18 | AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], 19 | gt_cv_inttypes_pri_broken, 20 | [ 21 | AC_TRY_COMPILE([#include 22 | #ifdef PRId32 23 | char *p = PRId32; 24 | #endif 25 | ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) 26 | ]) 27 | fi 28 | if test "$gt_cv_inttypes_pri_broken" = yes; then 29 | AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, 30 | [Define if exists and defines unusable PRI* macros.]) 31 | fi 32 | ]) 33 | -------------------------------------------------------------------------------- /src/SteghideError.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_STEGHIDEERROR_H 22 | #define SH_STEGHIDEERROR_H 23 | 24 | #include 25 | 26 | #include "msg.h" 27 | 28 | class SteghideError : public MessageBase { 29 | public: 30 | SteghideError (void) ; 31 | SteghideError (std::string msg) ; 32 | SteghideError (const char *msgfmt, ...) ; 33 | 34 | virtual void printMessage (void) const ; 35 | } ; 36 | 37 | #endif // ndef SH_STEGHIDEERROR_H 38 | -------------------------------------------------------------------------------- /src/AuSampleValues.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_AUSAMPLEVALUES_H 22 | #define SH_AUSAMPLEVALUES_H 23 | 24 | #include "AudioSampleValue.h" 25 | 26 | typedef AudioSampleValue AuMuLawSampleValue ; 27 | typedef AudioSampleValue AuPCM8SampleValue ; 28 | typedef AudioSampleValue AuPCM16SampleValue ; 29 | typedef AudioSampleValue AuPCM32SampleValue ; 30 | 31 | #endif // ndef SH_AUSAMPLEVALUES_H 32 | -------------------------------------------------------------------------------- /src/WavChunk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_WAVCHUNK_H 22 | #define SH_WAVCHUNK_H 23 | 24 | class BinaryIO ; 25 | class WavChunkHeader ; 26 | 27 | class WavChunk { 28 | public: 29 | WavChunk (void) {} ; 30 | WavChunk (WavChunkHeader *chh) : 31 | ChunkHeader(chh) {} ; 32 | virtual ~WavChunk (void) ; 33 | 34 | virtual void read (BinaryIO *io) = 0 ; 35 | virtual void write (BinaryIO *io) ; 36 | 37 | protected: 38 | WavChunkHeader *ChunkHeader ; 39 | } ; 40 | 41 | #endif // ndef SH_WAVCHUNK_H 42 | -------------------------------------------------------------------------------- /tests/MHashKeyGenTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_MHASHKEYGENTEST_H 22 | #define SH_MHASHKEYGENTEST_H 23 | 24 | #include "BitString.h" 25 | #include "MHashKeyGen.h" 26 | 27 | #include "UnitTest.h" 28 | #include "TestSuite.h" 29 | 30 | class MHashKeyGenTest : public UnitTest { 31 | public: 32 | MHashKeyGenTest (TestSuite* s) ; 33 | 34 | private: 35 | #if 0 36 | // TODO - implement this unit test 37 | bool genericTestReference () ; 38 | #endif 39 | } ; 40 | 41 | #endif // ndef SH_MHASHKEYGENTEST_H 42 | -------------------------------------------------------------------------------- /tests/MCryptPPTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_MCRYPTPPTEST_H 22 | #define SH_MCRYPTPPTEST_H 23 | 24 | #include "BitString.h" 25 | #include "MCryptPP.h" 26 | 27 | #include "UnitTest.h" 28 | #include "TestSuite.h" 29 | 30 | class MCryptPPTest : public UnitTest { 31 | public: 32 | MCryptPPTest (TestSuite* s) ; 33 | 34 | void testEncryption (void) ; 35 | void testDecryption (void) ; 36 | 37 | private: 38 | bool genericTestEncryption () ; 39 | bool genericTestDecryption () ; 40 | } ; 41 | 42 | #endif // ndef SH_MCRYPTPPTEST_H 43 | -------------------------------------------------------------------------------- /src/AssertionFailed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_ASSERTIONFAILED_H 22 | #define SH_ASSERTIONFAILED_H 23 | 24 | #include "common.h" 25 | #include "SteghideError.h" 26 | 27 | class AssertionFailed : public SteghideError { 28 | public: 29 | AssertionFailed (const char* fn, unsigned int l) 30 | : SteghideError(_("assertion failed in %s at line number %d."), stripDir(fn), l) {} ; 31 | 32 | void printMessage (void) const ; 33 | 34 | private: 35 | char* stripDir (const char* fn) ; 36 | } ; 37 | 38 | #endif // ndef SH_ASSERTION_FAILED 39 | -------------------------------------------------------------------------------- /src/Utils.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include 22 | 23 | #include "Utils.h" 24 | 25 | std::string Utils::formatHRSize (unsigned long size) 26 | { 27 | float s = (float) size ; 28 | 29 | std::string unit = "Byte" ; 30 | if (s > 1024.0) { 31 | s /= 1024.0 ; 32 | unit = "KB" ; 33 | } 34 | if (s > 1024.0) { 35 | s /= 1024.0 ; 36 | unit = "MB" ; 37 | } 38 | if (s > 1024.0) { 39 | s /= 1024.0 ; 40 | unit = "GB" ; 41 | } 42 | 43 | char buf[15] ; 44 | sprintf (buf, "%.1f %s", s, unit.c_str()) ; 45 | return std::string (buf) ; 46 | } 47 | -------------------------------------------------------------------------------- /po/en@boldquot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | # This catalog furthermore displays the text between the quotation marks in 24 | # bold face, assuming the VT100/XTerm escape sequences. 25 | # 26 | -------------------------------------------------------------------------------- /src/WavChunkUnused.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "BinaryIO.h" 22 | #include "WavChunkHeader.h" 23 | #include "WavChunkUnused.h" 24 | 25 | void WavChunkUnused::read (BinaryIO *io) 26 | { 27 | Data = std::vector (ChunkHeader->getChunkLength()) ; 28 | for (unsigned int i = 0 ; i < ChunkHeader->getChunkLength() ; i++) { 29 | Data[i] = io->read8() ; 30 | } 31 | } 32 | 33 | void WavChunkUnused::write (BinaryIO *io) 34 | { 35 | WavChunk::write (io) ; 36 | for (std::vector::const_iterator i = Data.begin() ; i != Data.end() ; i++) { 37 | io->write8 (*i) ; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/BmpFileTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_BMPFILETEST_H 22 | #define SH_BMPFILETEST_H 23 | 24 | #include "BmpFile.h" 25 | #include "Selector.h" 26 | 27 | #include "CvrStgFileTest.h" 28 | 29 | class BmpFileTest : public CvrStgFileTest { 30 | public: 31 | BmpFileTest (TestSuite* s) ; 32 | 33 | void setup (void) ; 34 | void cleanup (void) ; 35 | 36 | void testSVALCalculation (void) ; 37 | 38 | private: 39 | CvrStgFile *f1, *f2 ; 40 | Graph *g1, *g2 ; 41 | Selector *s1, *s2 ; 42 | BitString *bs1, *bs2 ; 43 | Globals gl1, gl2 ; 44 | } ; 45 | 46 | #endif // ndef SH_BMPFILETEST_H 47 | -------------------------------------------------------------------------------- /src/MatchingAlgorithm.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "Graph.h" 22 | #include "MatchingAlgorithm.h" 23 | 24 | MatchingAlgorithm::MatchingAlgorithm (Graph* g, Matching* m, float goal) 25 | : TheGraph(g), TheMatching(m) 26 | { 27 | setGoal(goal) ; 28 | } 29 | 30 | void MatchingAlgorithm::setGoal (float goal) 31 | { 32 | // if goal is 100.0 and the graph has an odd number of vertices the algorithm won't spend time 33 | // searching an edge for the last vertex as / rounds down to the next smaller integer 34 | CardinalityGoal = (unsigned long) (((float) TheGraph->getNumVertices()) * (goal / 100.0)) / 2 ; 35 | } 36 | -------------------------------------------------------------------------------- /tests/TestCategoryCaller.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_TESTCALLER_H 22 | #define SH_TESTCALLER_H 23 | 24 | #include "TestCategory.h" 25 | 26 | template class TestCategoryCaller : public TestCategory { 27 | public: 28 | typedef void (UTType::*TCMType)(); 29 | 30 | TestCategoryCaller (std::string n, TestSuite* s, UTType* o, TCMType m) 31 | : TestCategory(n,s), UTObject(o), TestMethod(m) {} ; 32 | 33 | void run (void) 34 | { 35 | (UTObject->*TestMethod)() ; 36 | } 37 | 38 | private: 39 | UTType* UTObject ; 40 | TCMType TestMethod ; 41 | } ; 42 | 43 | #endif // ndef SH_TESTCALLER_H 44 | -------------------------------------------------------------------------------- /tests/MCryptPPTest.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "MCryptPPTest.h" 22 | 23 | MCryptPPTest::MCryptPPTest (TestSuite* s) 24 | : UnitTest ("MCryptPP", s) 25 | { 26 | ADDTESTCATEGORY (MCryptPPTest, testEncryption) ; 27 | ADDTESTCATEGORY (MCryptPPTest, testDecryption) ; 28 | } 29 | 30 | // TODO - implement this unit test 31 | 32 | void MCryptPPTest::testEncryption (void) 33 | { 34 | } 35 | 36 | void MCryptPPTest::testDecryption (void) 37 | { 38 | } 39 | 40 | bool MCryptPPTest::genericTestEncryption () 41 | { 42 | // evaluate test vector 43 | } 44 | 45 | bool MCryptPPTest::genericTestDecryption () 46 | { 47 | } 48 | -------------------------------------------------------------------------------- /src/RGBTriple.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "RGBTriple.h" 22 | 23 | UWORD32 RGBTriple::calcDistance (const RGBTriple& t) const 24 | { 25 | int dr = (int) Red - (int) t.Red ; 26 | int dg = (int) Green - (int) t.Green ; 27 | int db = (int) Blue - (int) t.Blue ; 28 | return (UWORD32) (dr*dr + dg*dg + db*db) ; 29 | } 30 | 31 | bool RGBTriple::operator== (const RGBTriple& t) const 32 | { 33 | return ((Red == t.Red) && (Green == t.Green) && (Blue == t.Blue)) ; 34 | } 35 | 36 | bool RGBTriple::operator!= (const RGBTriple& t) const 37 | { 38 | return ((Red != t.Red) || (Green != t.Green) || (Blue != t.Blue)) ; 39 | } 40 | -------------------------------------------------------------------------------- /src/wrapper_hash_map.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_SGI_HASH_MAP_H 22 | #define SH_SGI_HASH_MAP_H 23 | 24 | // this file is included to get access to a sgi::hash_map implementation 25 | 26 | #ifdef __GNUC__ 27 | # if __GNUC__ < 3 28 | # include 29 | namespace sgi { using ::hash ; using ::hash_map ; } ; 30 | # else 31 | # include 32 | # if __GNUC_MINOR__ == 0 33 | namespace sgi = std ; // GCC 3.0 34 | # else 35 | namespace sgi = __gnu_cxx ; // GCC 3.1 and later 36 | # endif 37 | # endif 38 | #else 39 | namespace sgi = std ; 40 | #endif 41 | 42 | #endif // ndef SH_SGI_HASH_MAP_H 43 | -------------------------------------------------------------------------------- /src/wrapper_hash_set.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_SGI_HASH_SET_H 22 | #define SH_SGI_HASH_SET_H 23 | 24 | 25 | // this file is included to get access to a sgi::hash_set implementation 26 | 27 | #ifdef __GNUC__ 28 | # if __GNUC__ < 3 29 | # include 30 | namespace sgi { using ::hash ; using ::hash_set ; } ; 31 | # else 32 | # include 33 | # if __GNUC_MINOR__ == 0 34 | namespace sgi = std ; // GCC 3.0 35 | # else 36 | namespace sgi = ::__gnu_cxx ; // GCC 3.1 and later 37 | # endif 38 | # endif 39 | #else 40 | namespace sgi = std ; 41 | #endif 42 | 43 | #endif // ndef SH_SGI_HASH_SET_H 44 | -------------------------------------------------------------------------------- /tests/JpegSampleValueTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_JPEGSAMPLEVALUETEST_H 22 | #define SH_JPEGSAMPLEVALUETEST_H 23 | 24 | #include "SampleValueTest.h" 25 | 26 | class JpegSampleValue ; 27 | class CvrStgFile ; 28 | 29 | class JpegSampleValueTest : public SampleValueTest { 30 | public: 31 | JpegSampleValueTest (TestSuite* s) ; 32 | 33 | void setup (void) ; 34 | void cleanup (void) ; 35 | 36 | void testDistance (void) ; 37 | void testIsNeighbour (void) ; 38 | 39 | private: 40 | CvrStgFile *f1 ; 41 | JpegSampleValue *sv_m1, *sv_0, *sv_1 ; 42 | Globals gl1 ; 43 | } ; 44 | 45 | #endif // ndef SH_JPEGSAMPLEVALUETEST_H 46 | -------------------------------------------------------------------------------- /src/Terminal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_TERMINAL_H 22 | #define SH_TERMINAL_H 23 | 24 | #include "common.h" 25 | 26 | #if HAVE_TERMIOS_H 27 | #include 28 | #endif 29 | 30 | /** 31 | * \class Terminal 32 | * \brief provides some terminal access 33 | **/ 34 | class Terminal { 35 | public: 36 | Terminal (void) ; 37 | 38 | void EchoOff (void) ; 39 | void SingleKeyOn (void) ; 40 | void reset (void) ; 41 | 42 | private: 43 | #if HAVE_TERMIOS_H 44 | /// contains the attributes of the terminal when this object was constructed 45 | struct termios InitAttr ; 46 | #endif 47 | } ; 48 | 49 | #endif // ndef SH_TERMINAL_H 50 | -------------------------------------------------------------------------------- /src/WavChunkHeader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_WAVCHUNKHEADER_H 22 | #define SH_WAVCHUNKHEADER_H 23 | 24 | #include "common.h" 25 | 26 | class BinaryIO ; 27 | 28 | class WavChunkHeader { 29 | public: 30 | WavChunkHeader (void) {} ; 31 | WavChunkHeader (char *id, UWORD32 len) ; 32 | WavChunkHeader (BinaryIO *io) ; 33 | 34 | void read (BinaryIO *io) ; 35 | void write (BinaryIO *io) const ; 36 | 37 | UWORD32 getChunkLength (void) const { return ChunkLength ; } ; 38 | const char *getChunkId (void) const { return ChunkId ; } ; 39 | 40 | private: 41 | char ChunkId[4] ; 42 | UWORD32 ChunkLength ; 43 | } ; 44 | 45 | #endif // ndef SH_WAVCHUNKHEADER_H 46 | -------------------------------------------------------------------------------- /m4/lcmessage.m4: -------------------------------------------------------------------------------- 1 | # lcmessage.m4 serial 3 (gettext-0.11.3) 2 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | dnl 9 | dnl This file can can be used in projects which are not available under 10 | dnl the GNU General Public License or the GNU Library General Public 11 | dnl License but which still want to provide support for the GNU gettext 12 | dnl functionality. 13 | dnl Please note that the actual code of the GNU gettext library is covered 14 | dnl by the GNU Library General Public License, and the rest of the GNU 15 | dnl gettext package package is covered by the GNU General Public License. 16 | dnl They are *not* in the public domain. 17 | 18 | dnl Authors: 19 | dnl Ulrich Drepper , 1995. 20 | 21 | # Check whether LC_MESSAGES is available in . 22 | 23 | AC_DEFUN([AM_LC_MESSAGES], 24 | [ 25 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, 26 | [AC_TRY_LINK([#include ], [return LC_MESSAGES], 27 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) 28 | if test $am_cv_val_LC_MESSAGES = yes; then 29 | AC_DEFINE(HAVE_LC_MESSAGES, 1, 30 | [Define if your file defines LC_MESSAGES.]) 31 | fi 32 | ]) 33 | -------------------------------------------------------------------------------- /src/WavChunkUnused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_WAVCHUNKUNUSED_H 22 | #define SH_WAVCHUNKUNUSED_H 23 | 24 | #include "common.h" 25 | #include "WavChunk.h" 26 | 27 | class BinaryIO ; 28 | class WavChunkHeader ; 29 | 30 | class WavChunkUnused : public WavChunk { 31 | public: 32 | WavChunkUnused (void) : 33 | WavChunk() {} ; 34 | WavChunkUnused (WavChunkHeader *chh) : 35 | WavChunk(chh) {} ; 36 | WavChunkUnused (WavChunkHeader *chh, BinaryIO *io) : 37 | WavChunk(chh) { read(io) ; } ; 38 | 39 | void read (BinaryIO *io) ; 40 | void write (BinaryIO *io) ; 41 | 42 | private: 43 | std::vector Data ; 44 | } ; 45 | 46 | #endif // ndef SH_WAVCHUNKUNUSED_H 47 | -------------------------------------------------------------------------------- /src/JpegSampleValue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_JPEGSAMPLE_H 22 | #define SH_JPEGSAMPLE_H 23 | 24 | #include "SampleValue.h" 25 | 26 | class JpegSampleValue : public SampleValue { 27 | public: 28 | JpegSampleValue (int c) ; 29 | 30 | SampleValue* getNearestTargetSampleValue (EmbValue t) const ; 31 | UWORD32 calcDistance (const SampleValue *s) const ; 32 | std::string getName (void) const ; 33 | 34 | SWORD16 getDctCoeff (void) const 35 | { return DctCoeff ; } ; 36 | 37 | static EmbValue calcEValue (SWORD16 dctc) 38 | { return (((dctc >= 0) ? dctc : -dctc) % 2) ; } ; 39 | 40 | private: 41 | SWORD16 DctCoeff ; 42 | } ; 43 | 44 | #endif // ndef SH_JPEGSAMPLE_H 45 | -------------------------------------------------------------------------------- /src/SteghideError.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include 22 | 23 | #include "SteghideError.h" 24 | #include "common.h" 25 | 26 | SteghideError::SteghideError (void) 27 | : MessageBase(_("error, exiting. (no error message defined).")) 28 | { 29 | } 30 | 31 | SteghideError::SteghideError(std::string msg) 32 | : MessageBase(msg) 33 | { 34 | } 35 | 36 | SteghideError::SteghideError (const char *msgfmt, ...) 37 | : MessageBase() 38 | { 39 | va_list ap ; 40 | va_start (ap, msgfmt) ; 41 | setMessage (vcompose (msgfmt, ap)) ; 42 | va_end (ap) ; 43 | } 44 | 45 | void SteghideError::printMessage () const 46 | { 47 | std::cerr << "steghide: " << getMessage() << std::endl ; 48 | } 49 | -------------------------------------------------------------------------------- /tests/SelectorTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_SELECTORTEST_H 22 | #define SH_SELECTORTEST_H 23 | 24 | class Selector ; 25 | 26 | #include "UnitTest.h" 27 | #include "TestSuite.h" 28 | 29 | class SelectorTest : public UnitTest { 30 | public: 31 | SelectorTest (TestSuite* s) ; 32 | 33 | void setup (void) ; 34 | void cleanup (void) ; 35 | 36 | void testIsPermutation (void) ; 37 | void testIsIdentityPermutation (void) ; 38 | 39 | private: 40 | Selector *s1, *s2, *s3, *s4 ; 41 | Selector *sid1, *sid2 ; 42 | 43 | bool genericTestIsPermutation (Selector* s) ; 44 | bool genericTestIsIdentityPermutation (Selector* s) ; 45 | } ; 46 | 47 | #endif // ndef SH_SELECTORTEST_H 48 | -------------------------------------------------------------------------------- /tests/JpegFileTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_JPEGFILETEST_H 22 | #define SH_JPEGFILETEST_H 23 | 24 | #include "JpegFile.h" 25 | 26 | #include "CvrStgFileTest.h" 27 | 28 | class JpegFileTest : public CvrStgFileTest { 29 | public: 30 | JpegFileTest (TestSuite* s) ; 31 | 32 | void setup (void) ; 33 | void cleanup (void) ; 34 | 35 | void testReadEmbedExtract (void) ; 36 | void testReadEmbedWriteReadExtract (void) ; 37 | void testPosition (void) ; 38 | void testReadExtractCompare (void) ; 39 | void testEmbeddedValue (void) ; 40 | 41 | private: 42 | BitString *bs1, *bs2 ; 43 | CvrStgFile *f1, *f2 ; 44 | Globals gl1, gl2 ; 45 | } ; 46 | 47 | #endif // ndef SH_JPEGFILETEST_H 48 | -------------------------------------------------------------------------------- /src/MatchingAlgorithm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_MATCHINGALGORITHM_H 22 | #define SH_MATCHINGALGORITHM_H 23 | 24 | class Graph ; 25 | class Matching ; 26 | 27 | class MatchingAlgorithm { 28 | public: 29 | MatchingAlgorithm (Graph* g, Matching* m, float goal) ; 30 | virtual ~MatchingAlgorithm (void) {} ; 31 | 32 | virtual void run (void) = 0 ; 33 | 34 | Matching* getMatching (void) const 35 | { return TheMatching ; } ; 36 | 37 | void setGoal (float goal) ; 38 | 39 | virtual const char* getName (void) const = 0 ; 40 | 41 | protected: 42 | Graph* TheGraph ; 43 | Matching* TheMatching ; 44 | unsigned long CardinalityGoal ; 45 | } ; 46 | 47 | #endif // ndef SH_MATCHINGALGORITHM 48 | -------------------------------------------------------------------------------- /tests/Test.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_TEST_H 22 | #define SH_TEST_H 23 | 24 | #include 25 | 26 | class TestSuite ; 27 | 28 | class Test { 29 | public: 30 | Test (void) : Name(std::string("unnamed test")), Suite(NULL) {} ; 31 | Test (const std::string& n) : Name(n), Suite(NULL) {} ; 32 | Test (const std::string& n, TestSuite* s) : Name(n), Suite(s) {} ; 33 | 34 | virtual ~Test (void) {} ; 35 | 36 | const std::string& getName (void) 37 | { return Name ; } ; 38 | 39 | TestSuite* getSuite (void) 40 | { return Suite ; } ; 41 | 42 | virtual void run (void) = 0 ; 43 | 44 | private: 45 | std::string Name ; 46 | TestSuite* Suite ; 47 | } ; 48 | 49 | #endif // ndef SH_TEST_H 50 | -------------------------------------------------------------------------------- /src/BmpSampleValue.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "BmpSampleValue.h" 22 | #include "common.h" 23 | 24 | UWORD32 BmpSampleValue::calcDistance (const SampleValue *s) const 25 | { 26 | const BmpSampleValue *sample = (const BmpSampleValue*) s ; 27 | /* If s is not a BmpSampleValue then we get into real trouble here. 28 | But calcDistance is called very often, a dynamic_cast costs a lot of time and 29 | it does not make sense to pass anything but a BmpSampleValue as s anyway. */ 30 | 31 | int dr = (int) getRed() - (int) sample->getRed() ; 32 | int dg = (int) getGreen() - (int) sample->getGreen() ; 33 | int db = (int) getBlue() - (int) sample->getBlue() ; 34 | return (UWORD32) (dr*dr + dg*dg + db*db) ; 35 | } 36 | -------------------------------------------------------------------------------- /tests/BmpRGBSampleValueTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_BMPRGBSAMPLEVALUETEST_H 22 | #define SH_BMPRGBSAMPLEVALUETEST_H 23 | 24 | #include "SampleValueTest.h" 25 | 26 | class CvrStgFile ; 27 | 28 | class BmpRGBSampleValueTest : public SampleValueTest { 29 | public: 30 | BmpRGBSampleValueTest (TestSuite* s) ; 31 | 32 | void setup (void) ; 33 | void cleanup (void) ; 34 | 35 | void testDistance (void) ; 36 | void testIsNeighbour (void) ; 37 | 38 | private: 39 | CvrStgFile *f_win, *f_os2 ; 40 | SampleValue *sv_0_0_0, *sv_1_1_1, *sv_0_3_4, *sv_10_10_10, *sv_12_13_14, *sv_128_128_128, *sv_210_0_120, *sv_255_255_255 ; 41 | Globals gl_win, gl_os2 ; 42 | } ; 43 | 44 | #endif // ndef SH_BMPRGBSAMPLEVALUETEST_H 45 | -------------------------------------------------------------------------------- /tests/AuFileTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_AUFILETEST_H 22 | #define SH_AUFILETEST_H 23 | 24 | #include "AuFile.h" 25 | 26 | #include "CvrStgFileTest.h" 27 | 28 | class AuFileTest : public CvrStgFileTest { 29 | public: 30 | AuFileTest (TestSuite* s) ; 31 | 32 | void setup (void) ; 33 | void cleanup (void) ; 34 | 35 | void testReadWrite (void) ; 36 | void testReadEmbedExtract (void) ; 37 | void testReadEmbedWriteReadExtract (void) ; 38 | void testPosition (void) ; 39 | void testReadExtractCompare (void) ; 40 | void testEmbeddedValue (void) ; 41 | 42 | private: 43 | BitString *bs1, *bs2, *bs3 ; 44 | CvrStgFile *f1, *f2, *f3 ; 45 | Globals gl1, gl2, gl3 ; 46 | } ; 47 | 48 | #endif // ndef SH_AUFILETEST_H 49 | -------------------------------------------------------------------------------- /tests/AudioSampleValueTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_AUDIOSAMPLEVALUETEST_H 22 | #define SH_AUDIOSAMPLEVALUETEST_H 23 | 24 | #include "SampleValueTest.h" 25 | 26 | class CvrStgFile ; 27 | 28 | class AudioSampleValueTest : public SampleValueTest { 29 | public: 30 | AudioSampleValueTest (TestSuite* s) ; 31 | 32 | void setup (void) ; 33 | void cleanup (void) ; 34 | 35 | void testDistance (void) ; 36 | void testIsNeighbour (void) ; 37 | 38 | private: 39 | CvrStgFile *f_AuMuLaw, *f_AuPCM16 ; 40 | SampleValue *sv_AuMuLaw_0, *sv_AuMuLaw_1, *sv_AuMuLaw_45, *sv_AuPCM16_m32768, *sv_AuPCM16_32767, *sv_AuPCM16_0, *sv_AuPCM16_15 ; 41 | Globals gl_AuMuLaw, gl_AuPCM16 ; 42 | } ; 43 | 44 | #endif // ndef SH_AUDIOSAMPLEVALUETEST_H 45 | -------------------------------------------------------------------------------- /tests/WavPCMSampleValueTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_WAVPCMSAMPLEVALUETEST_H 22 | #define SH_WAVPCMSAMPLEVALUETEST_H 23 | 24 | #include "SampleValueTest.h" 25 | 26 | class CvrStgFile ; 27 | 28 | class WavPCMSampleValueTest : public SampleValueTest { 29 | public: 30 | WavPCMSampleValueTest (TestSuite* s) ; 31 | 32 | void setup (void) ; 33 | void cleanup (void) ; 34 | 35 | void testDistance (void) ; 36 | void testIsNeighbour (void) ; 37 | 38 | private: 39 | CvrStgFile *f_WavPCM8, *f_WavPCM16 ; 40 | SampleValue *sv_WavPCM8_0, *sv_WavPCM8_1, *sv_WavPCM8_45, *sv_WavPCM16_m32768, *sv_WavPCM16_32767, *sv_WavPCM16_0, *sv_WavPCM16_15 ; 41 | Globals gl_WavPCM8, gl_WavPCM16 ; 42 | } ; 43 | 44 | #endif // ndef SH_WAVPCMSAMPLEVALUETEST_H 45 | -------------------------------------------------------------------------------- /src/WavChunkHeader.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "BinaryIO.h" 22 | #include "WavChunkHeader.h" 23 | 24 | WavChunkHeader::WavChunkHeader (char *id, UWORD32 len) 25 | { 26 | for (unsigned int i = 0 ; i < 4 ; i++) { 27 | ChunkId[i] = id[i] ; 28 | } 29 | ChunkLength = len ; 30 | } 31 | 32 | WavChunkHeader::WavChunkHeader (BinaryIO *io) 33 | { 34 | read (io) ; 35 | } 36 | 37 | void WavChunkHeader::read (BinaryIO *io) 38 | { 39 | for (unsigned int i = 0 ; i < 4 ; i++) { 40 | ChunkId[i] = io->read8() ; 41 | } 42 | ChunkLength = io->read32_le() ; 43 | } 44 | 45 | void WavChunkHeader::write (BinaryIO *io) const 46 | { 47 | for (unsigned int i = 0 ; i < 4 ; i++) { 48 | io->write8 (ChunkId[i]) ; 49 | } 50 | io->write32_le (ChunkLength) ; 51 | } 52 | -------------------------------------------------------------------------------- /src/AuSampleValues.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "AuSampleValues.h" 22 | 23 | // AuMuLawSampleValue 24 | template <> const BYTE AuMuLawSampleValue::MinValue = 0 ; 25 | template <> const BYTE AuMuLawSampleValue::MaxValue = BYTE_MAX ; 26 | 27 | // AuPCM8SampleValue 28 | template <> const SBYTE AuPCM8SampleValue::MinValue = SBYTE_MIN ; 29 | template <> const SBYTE AuPCM8SampleValue::MaxValue = SBYTE_MAX ; 30 | 31 | // AuPCM16SampleValue 32 | template <> const SWORD16 AuPCM16SampleValue::MinValue = SWORD16_MIN ; 33 | template <> const SWORD16 AuPCM16SampleValue::MaxValue = SWORD16_MAX ; 34 | 35 | // AuPCM32SampleValue 36 | template <> const SWORD32 AuPCM32SampleValue::MinValue = SWORD32_MIN ; 37 | template <> const SWORD32 AuPCM32SampleValue::MaxValue = SWORD32_MAX ; 38 | -------------------------------------------------------------------------------- /tests/BmpOS2FileTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_BMPOS2FILETEST_H 22 | #define SH_BMPOS2FILETEST_H 23 | 24 | #include "BmpFile.h" 25 | 26 | #include "CvrStgFileTest.h" 27 | 28 | class BmpOS2FileTest : public CvrStgFileTest { 29 | public: 30 | BmpOS2FileTest (TestSuite* s) ; 31 | 32 | void setup (void) ; 33 | void cleanup (void) ; 34 | 35 | void testReadWrite (void) ; 36 | void testReadEmbedExtract (void) ; 37 | void testReadEmbedWriteReadExtract (void) ; 38 | void testPosition (void) ; 39 | void testReadExtractCompare (void) ; 40 | void testEmbeddedValue (void) ; 41 | 42 | private: 43 | BitString *bs1, *bs2, *bs3, *bs4 ; 44 | CvrStgFile *f1, *f2, *f3, *f4 ; 45 | Globals gl1, gl2, gl3, gl4 ; 46 | } ; 47 | 48 | #endif // ndef SH_BMPOS2FILETEST_H 49 | -------------------------------------------------------------------------------- /tests/BmpPaletteSampleValueTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_BMPPALETTESAMPLEVALUETEST_H 22 | #define SH_BMPPALETTESAMPLEVALUETEST_H 23 | 24 | #include "SampleValueTest.h" 25 | 26 | class CvrStgFile ; 27 | 28 | class BmpPaletteSampleValueTest : public SampleValueTest { 29 | public: 30 | BmpPaletteSampleValueTest (TestSuite* s) ; 31 | 32 | void setup (void) ; 33 | void cleanup (void) ; 34 | 35 | void testDistance (void) ; 36 | void testIsNeighbour (void) ; 37 | 38 | private: 39 | CvrStgFile *f1, *f2 ; 40 | Globals gl1, gl2 ; 41 | SampleValue *sv1_0, *sv1_3, *sv1_7, *sv1_15 ; 42 | SampleValue *sv2_3_49_96_5, *sv2_10_11_99_203, *sv2_48_18_106_194, *sv2_68_73_104_15, *sv2_171_61_97_25 ; 43 | } ; 44 | 45 | #endif // ndef SH_BMPPALETTESAMPLEVALUETEST_H 46 | -------------------------------------------------------------------------------- /tests/EmbDataTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_EMBDATATEST_H 22 | #define SH_EMBDATATEST_H 23 | 24 | class BitString ; 25 | #define private public 26 | #include "EmbData.h" 27 | #undef private 28 | 29 | #include "UnitTest.h" 30 | #include "TestSuite.h" 31 | 32 | class EmbDataTest : public UnitTest { 33 | public: 34 | EmbDataTest (TestSuite* s) ; 35 | 36 | void testEmbedding (void) ; 37 | void testExtracting (void) ; 38 | 39 | private: 40 | bool genericTestEmbedding (EmbData emb, BitString shouldbe) ; 41 | /** 42 | * pass the BitString bs to emb using getNumBitsNeeded and addBits 43 | * \return true iff emb took exactly the (number of) bits from bs 44 | **/ 45 | bool feed_to (const BitString& bs, EmbData& emb) ; 46 | } ; 47 | 48 | #endif // ndef SH_EMBDATATEST_H 49 | -------------------------------------------------------------------------------- /tests/SampleValueAdjacencyListTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_SAMPLEVALUEOPPOSITENEIGHBOURHOODTEST_H 22 | #define SH_SAMPLEVALUEOPPOSITENEIGHBOURHOODTEST_H 23 | 24 | #define private public 25 | #define protected public 26 | #include "SampleValueAdjacencyList.h" 27 | #undef private 28 | #undef protected 29 | 30 | #include "UnitTest.h" 31 | #include "TestSuite.h" 32 | 33 | class SampleValueAdjacencyListTest : public UnitTest { 34 | public: 35 | SampleValueAdjacencyListTest (TestSuite* s) ; 36 | 37 | void setup (void) ; 38 | 39 | void testEquality (void) ; 40 | void testQuicksort (void) ; 41 | 42 | private: 43 | SampleValueAdjacencyList DummySVAL ; 44 | std::vector SVEmpty ; 45 | } ; 46 | 47 | #endif // ndef SH_SAMPLEVALUEOPPOSITENEIGHBOURHOODTEST_H 48 | -------------------------------------------------------------------------------- /tests/AUtilsTest.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "common.h" 22 | 23 | #include "AUtilsTest.h" 24 | #include "TestCategoryCaller.h" 25 | 26 | AUtilsTest::AUtilsTest (TestSuite* s) 27 | : UnitTest ("AUtils", s) 28 | { 29 | ADDTESTCATEGORY (AUtilsTest, testLog2) ; 30 | } 31 | 32 | void AUtilsTest::testLog2 () 33 | { 34 | addTestResult (genericTestLog2 (2, 1.0)) ; 35 | addTestResult (genericTestLog2 (8, 3.0)) ; 36 | addTestResult (genericTestLog2 (5, 2.321928)) ; 37 | addTestResult (genericTestLog2 (21, 4.392317)) ; 38 | } 39 | 40 | bool AUtilsTest::genericTestLog2 (int n, double res) 41 | { 42 | // to avoid failing because of numeric problems 43 | double tmp = log2 (n) ; 44 | double lb = res - 0.000001 ; 45 | double ub = res + 0.000001 ; 46 | return (lb < tmp && tmp < ub) ; 47 | } 48 | -------------------------------------------------------------------------------- /src/Session.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_SESSION_H 22 | #define SH_SESSION_H 23 | 24 | #include 25 | #include 26 | 27 | #include "common.h" 28 | 29 | class Session { 30 | public: 31 | Session (void) {} ; 32 | 33 | void run (void) ; 34 | 35 | private: 36 | std::string stripDir (std::string s) const ; 37 | void printInfo (void) ; 38 | void printEncInfo (void) ; 39 | void printVersion (void) ; 40 | void printHelp (void) ; 41 | void printLicense (void) ; 42 | #ifdef DEBUG 43 | void printFrequencies (void) ; 44 | /** 45 | * add the frequencies in f2 to those in f1 (changing only f1 - like f1 += f2) 46 | **/ 47 | void addFrequencies (std::map* f1, const std::map* f2) ; 48 | #endif 49 | } ; 50 | #endif //ndef SH_SESSION_H 51 | -------------------------------------------------------------------------------- /tests/WavFileTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_WAVFILETEST_H 22 | #define SH_WAVFILETEST_H 23 | 24 | #include "CvrStgFileTest.h" 25 | 26 | #include "Selector.h" 27 | 28 | class WavFileTest : public CvrStgFileTest { 29 | public: 30 | WavFileTest (TestSuite* s) ; 31 | 32 | void setup (void) ; 33 | void cleanup (void) ; 34 | 35 | void testReadWrite (void) ; 36 | void testReadEmbedExtract (void) ; 37 | void testReadEmbedWriteReadExtract (void) ; 38 | void testPosition (void) ; 39 | void testReadExtractCompare (void) ; 40 | void testSVALCalculation (void) ; 41 | void testEmbeddedValue (void) ; 42 | 43 | private: 44 | BitString *bs1, *bs2 ; 45 | CvrStgFile *f1, *f2 ; 46 | Graph *g1, *g2 ; 47 | Selector *s1, *s2 ; 48 | Globals gl1, gl2 ; 49 | } ; 50 | 51 | #endif // ndef SH_BMPWINFILETEST_H 52 | -------------------------------------------------------------------------------- /tests/MatchingTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_MATCHINGTEST_H 22 | #define SH_MATCHINGTEST_H 23 | 24 | #define private public 25 | #define protected public 26 | #include "Matching.h" 27 | #undef private 28 | #undef protected 29 | class BitString ; 30 | class CvrStgFile ; 31 | class Selector ; 32 | 33 | #include "UnitTest.h" 34 | #include "TestSuite.h" 35 | 36 | class MatchingTest : public UnitTest { 37 | public: 38 | MatchingTest (TestSuite* s) ; 39 | 40 | void setup (void) ; 41 | void cleanup (void) ; 42 | 43 | void testAddRemoveEdge (void) ; 44 | void testAugmentingPath (void) ; 45 | 46 | private: 47 | BitString *bs1, *bs2 ; 48 | CvrStgFile *f1, *f2 ; 49 | Selector *s1, *s2 ; 50 | Graph *g1, *g2 ; 51 | Matching *m1, *m2 ; 52 | Globals gl1, gl2 ; 53 | } ; 54 | 55 | #endif // ndef SH_MATCHINGTEST_H 56 | -------------------------------------------------------------------------------- /src/SampleOccurence.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_SAMPLEOCCURENCE_H 22 | #define SH_SAMPLEOCCURENCE_H 23 | 24 | #include "Vertex.h" 25 | 26 | class SampleOccurence { 27 | public: 28 | SampleOccurence (Vertex *v, unsigned short i) 29 | : TheVertex(v), Index(i) {} ; 30 | 31 | Vertex *getVertex (void) const 32 | { return TheVertex ; } ; 33 | 34 | void setVertex (Vertex* v) 35 | { TheVertex = v ; } ; 36 | 37 | unsigned short getIndex (void) const 38 | { return Index ; } ; 39 | 40 | void setIndex (unsigned short i) 41 | { Index = i ; } ; 42 | 43 | bool operator== (const SampleOccurence& soc) const 44 | { return ((TheVertex->getLabel() == soc.TheVertex->getLabel()) && (Index == soc.Index)) ; } ; 45 | 46 | private: 47 | Vertex *TheVertex ; 48 | unsigned short Index ; 49 | } ; 50 | 51 | #endif // ndef SH_SAMPLEOCCURENCE_H 52 | -------------------------------------------------------------------------------- /src/BmpSampleValue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_BMPSAMPLE_H 22 | #define SH_BMPSAMPLE_H 23 | 24 | #include "SampleValue.h" 25 | #include "common.h" 26 | 27 | /** 28 | * \class BmpSampleValue 29 | * \brief an (abstract) sample value in a bmp file 30 | **/ 31 | class BmpSampleValue : public SampleValue { 32 | public: 33 | BmpSampleValue (void) : SampleValue() {} ; 34 | 35 | virtual UWORD32 calcDistance (const SampleValue *s) const ; 36 | 37 | /** 38 | * get the red color component 39 | **/ 40 | virtual unsigned char getRed (void) const = 0 ; 41 | 42 | /** 43 | * get the green color component 44 | **/ 45 | virtual unsigned char getGreen (void) const = 0 ; 46 | 47 | /** 48 | * get the blue color component 49 | **/ 50 | virtual unsigned char getBlue (void) const = 0 ; 51 | } ; 52 | 53 | 54 | #endif // ndef SH_BMPSAMPLE_H 55 | -------------------------------------------------------------------------------- /tests/BmpWinFileTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_BMPWINFILETEST_H 22 | #define SH_BMPWINFILETEST_H 23 | 24 | #define private public 25 | #define protected public 26 | #include "BmpFile.h" 27 | #undef private 28 | #undef protected 29 | #include "CvrStgFileTest.h" 30 | 31 | class BmpWinFileTest : public CvrStgFileTest { 32 | public: 33 | BmpWinFileTest (TestSuite* s) ; 34 | 35 | void setup (void) ; 36 | void cleanup (void) ; 37 | 38 | void testReadWrite (void) ; 39 | void testReadEmbedExtract (void) ; 40 | void testReadEmbedWriteReadExtract (void) ; 41 | void testPosition (void) ; 42 | void testReadExtractCompare (void) ; 43 | void testEmbeddedValue (void) ; 44 | 45 | private: 46 | BitString *bs1, *bs2, *bs3, *bs4 ; 47 | CvrStgFile *f1, *f2, *f3, *f4 ; 48 | Globals gl1, gl2, gl3, gl4 ; 49 | } ; 50 | 51 | #endif // ndef SH_BMPWINFILETEST_H 52 | -------------------------------------------------------------------------------- /intl/os2compat.h: -------------------------------------------------------------------------------- 1 | /* OS/2 compatibility defines. 2 | This file is intended to be included from config.h 3 | Copyright (C) 2001-2002 Free Software Foundation, Inc. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 18 | USA. */ 19 | 20 | /* When included from os2compat.h we need all the original definitions */ 21 | #ifndef OS2_AWARE 22 | 23 | #undef LIBDIR 24 | #define LIBDIR _nlos2_libdir 25 | extern char *_nlos2_libdir; 26 | 27 | #undef LOCALEDIR 28 | #define LOCALEDIR _nlos2_localedir 29 | extern char *_nlos2_localedir; 30 | 31 | #undef LOCALE_ALIAS_PATH 32 | #define LOCALE_ALIAS_PATH _nlos2_localealiaspath 33 | extern char *_nlos2_localealiaspath; 34 | 35 | #endif 36 | 37 | #undef HAVE_STRCASECMP 38 | #define HAVE_STRCASECMP 1 39 | #define strcasecmp stricmp 40 | #define strncasecmp strnicmp 41 | 42 | /* We have our own getenv() which works even if library is compiled as DLL */ 43 | #define getenv _nl_getenv 44 | 45 | /* Older versions of gettext used -1 as the value of LC_MESSAGES */ 46 | #define LC_MESSAGES_COMPAT (-1) 47 | -------------------------------------------------------------------------------- /src/MHashKeyGen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_MHASHKEYGEN_H 22 | #define SH_MHASHKEYGEN_H 23 | 24 | #include 25 | 26 | #include 27 | 28 | class MHashKeyGen { 29 | public: 30 | MHashKeyGen (void) ; 31 | MHashKeyGen (keygenid kgalgo, hashid halgo, unsigned int keysize) ; 32 | ~MHashKeyGen (void) ; 33 | 34 | void setKeySize (unsigned int KeySize) ; 35 | void setKeyGenAlgorithm (keygenid algo) ; 36 | void setHashAlgorithm (hashid hashalgo) ; 37 | void setHashAlgorithms (std::vector hashalgos) ; 38 | void setSalt (std::vector salt) ; 39 | 40 | std::vector createKey (std::string password) ; 41 | 42 | private: 43 | bool ready ; 44 | keygenid Algorithm ; 45 | KEYGEN AlgorithmData ; 46 | unsigned int KeySize ; 47 | 48 | void *s_malloc (size_t size) ; 49 | } ; 50 | 51 | #endif // ndef SH_MHASHKEYGEN_H 52 | -------------------------------------------------------------------------------- /tests/BFSAPHeuristicTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_BFSAPHEURISTICTEST_H 22 | #define SH_BFSAPHEURISTICTEST_H 23 | 24 | class BFSAPHeuristic ; 25 | class BitString ; 26 | class CvrStgFile ; 27 | class Matching ; 28 | class Selector ; 29 | 30 | #include "UnitTest.h" 31 | #include "TestSuite.h" 32 | 33 | class BFSAPHeuristicTest : public UnitTest { 34 | public: 35 | BFSAPHeuristicTest (TestSuite* s) ; 36 | 37 | void setup (void) ; 38 | void cleanup (void) ; 39 | 40 | void testAlgorithm (void) ; 41 | 42 | private: 43 | BitString *bs1, *bs2, *bs3, *bs4, *bs5 ; 44 | CvrStgFile *f1, *f2, *f3, *f4, *f5 ; 45 | Selector *s1, *s2, *s3, *s4, *s5 ; 46 | Graph *g1, *g2, *g3, *g4, *g5 ; 47 | Matching *m1, *m2, *m3, *m4, *m5 ; 48 | BFSAPHeuristic *aph1, *aph2, *aph3, *aph4, *aph5 ; 49 | Globals gl1, gl2, gl3, gl4, gl5 ; 50 | } ; 51 | 52 | #endif // ndef SH_BFSAPHEURISTICTEST_H 53 | -------------------------------------------------------------------------------- /tests/DFSAPHeuristicTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_DFSAPHEURISTICTEST_H 22 | #define SH_DFSAPHEURISTICTEST_H 23 | 24 | class DFSAPHeuristic ; 25 | class BitString ; 26 | class CvrStgFile ; 27 | class Matching ; 28 | class Selector ; 29 | 30 | #include "UnitTest.h" 31 | #include "TestSuite.h" 32 | 33 | class DFSAPHeuristicTest : public UnitTest { 34 | public: 35 | DFSAPHeuristicTest (TestSuite* s) ; 36 | 37 | void setup (void) ; 38 | void cleanup (void) ; 39 | 40 | void testAlgorithm (void) ; 41 | 42 | private: 43 | BitString *bs1, *bs2, *bs3, *bs4, *bs5 ; 44 | CvrStgFile *f1, *f2, *f3, *f4, *f5 ; 45 | Selector *s1, *s2, *s3, *s4, *s5 ; 46 | Graph *g1, *g2, *g3, *g4, *g5 ; 47 | Matching *m1, *m2, *m3, *m4, *m5 ; 48 | DFSAPHeuristic *aph1, *aph2, *aph3, *aph4, *aph5 ; 49 | Globals gl1, gl2, gl3, gl4, gl5 ; 50 | } ; 51 | 52 | #endif // ndef SH_DFSAPHEURISTICTEST_H 53 | -------------------------------------------------------------------------------- /tests/WKSConstructionHeuristicTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganogrchy program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_WKSCONSTRUCTIONHEURISTICTEST_H 22 | #define SH_WKSCONSTRUCTIONHEURISTICTEST_H 23 | 24 | class BitString ; 25 | class WKSConstructionHeuristic ; 26 | class CvrStgFile ; 27 | class Graph ; 28 | class Matching ; 29 | class Selector ; 30 | 31 | #include "UnitTest.h" 32 | #include "TestSuite.h" 33 | 34 | class WKSConstructionHeuristicTest : public UnitTest { 35 | public: 36 | WKSConstructionHeuristicTest (TestSuite* s) ; 37 | 38 | void setup (void) ; 39 | void cleanup (void) ; 40 | 41 | void testAlgorithm (void) ; 42 | 43 | private: 44 | BitString *bs1, *bs2, *bs3 ; 45 | CvrStgFile *f1, *f2, *f3 ; 46 | Selector *s1, *s2, *s3 ; 47 | Graph *g1, *g2, *g3 ; 48 | WKSConstructionHeuristic *ch1, *ch2, *ch3 ; 49 | Matching *m1, *m2, *m3 ; 50 | Globals gl1, gl2, gl3 ; 51 | } ; 52 | 53 | #endif // ndef SH_WKSCONSTRUCTIONHEURISTICTEST_H 54 | -------------------------------------------------------------------------------- /src/Embedder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_EMBEDDER_H 22 | #define SH_EMBEDDER_H 23 | 24 | #include "BitString.h" 25 | class Edge ; 26 | class CvrStgFile ; 27 | class Graph ; 28 | class Matching ; 29 | class ProgressOutput ; 30 | class Vertex ; 31 | 32 | class Embedder { 33 | public: 34 | Embedder (void) ; 35 | 36 | ~Embedder (void) ; 37 | 38 | void embed (void) ; 39 | 40 | private: 41 | static const unsigned int Default_NConstrHeur = 1 ; 42 | 43 | BitString ToEmbed ; 44 | 45 | /** 46 | * do the matching algorithms 47 | **/ 48 | const Matching* calculateMatching (ProgressOutput* prout) ; 49 | 50 | /** 51 | * embed the two bits represented by the two vertices adjacent to e 52 | **/ 53 | void embedEdge (Edge *e) ; 54 | 55 | /** 56 | * embed the bit represented by the Vertex v 57 | **/ 58 | void embedExposedVertex (Vertex *v) ; 59 | } ; 60 | 61 | #endif // ndef SH_EMBEDDER_H 62 | -------------------------------------------------------------------------------- /tests/BitStringTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_BITSTRINGTEST_H 22 | #define SH_BITSTRINGTEST_H 23 | 24 | #define private public 25 | #define protected public 26 | #include "BitString.h" 27 | #undef private 28 | #undef protected 29 | 30 | #include "UnitTest.h" 31 | #include "TestSuite.h" 32 | 33 | class BitStringTest : public UnitTest { 34 | public: 35 | BitStringTest (TestSuite* s) ; 36 | 37 | void setup (void) ; 38 | void cleanup (void) ; 39 | 40 | void testBitInputOutput (void) ; 41 | void testLength (void) ; 42 | void testDatatypeInput (void) ; 43 | void testDatatypeOutput (void) ; 44 | void testEquality (void) ; 45 | void testCutting (void) ; 46 | void testCompression (void) ; 47 | void testArity (void) ; 48 | 49 | private: 50 | BitString *bs_0, *bs_1, *bs_10, *bs_001, *bs_100, *bs_1010, *bs_1110, *bs_01011, *bs_10010, *bs_10101110, *bs_101011101 ; 51 | } ; 52 | 53 | #endif // ndef SH_BITSTRINGTEST_H 54 | -------------------------------------------------------------------------------- /tests/DummySampleValue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_DUMMYSAMPLEVALUE_H 22 | #define SH_DUMMYSAMPLEVALUE_H 23 | 24 | #include "SampleValue.h" 25 | #include "common.h" 26 | 27 | class DummySampleValue : public SampleValue { 28 | public: 29 | DummySampleValue (UWORD16 v) 30 | : SampleValue(), Value(v) 31 | { EValue = (v % 2) ; Key = v ; } ; 32 | 33 | UWORD16 getValue (void) const 34 | { return Value ; } ; 35 | 36 | /** 37 | * calculate the distance as | Value - s->Value | 38 | **/ 39 | UWORD32 calcDistance (const SampleValue* s) const ; 40 | 41 | /** 42 | * return from the contents of the SampleValueAdjacencyMatrix in the DummyFile 43 | **/ 44 | bool isNeighbour (const SampleValue* s) const ; 45 | 46 | SampleValue* getNearestTargetSampleValue (EmbValue t) const ; 47 | 48 | std::string getName (void) const ; 49 | 50 | private: 51 | UWORD16 Value ; 52 | } ; 53 | 54 | #endif // ndef SH_DUMMYSAMPLEVALUE_H 55 | -------------------------------------------------------------------------------- /src/AssertionFailed.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include 22 | #include "AssertionFailed.h" 23 | 24 | void AssertionFailed::printMessage () const 25 | { 26 | printf ("\n") ; 27 | SteghideError::printMessage() ; 28 | printf (_("This means that you have found a bug. Please let me (shetzl@chello.at)\n" 29 | "know this if you have a way to reproduce the error.\n" 30 | "Steghide has to exit now. Sorry.\n")) ; 31 | } 32 | 33 | char* AssertionFailed::stripDir (const char *fn) 34 | { 35 | int i = 0, j = 0, start = 0, end = 0 ; 36 | 37 | end = i = strlen (fn) - 1 ; 38 | while ((i >= 0) && (fn[i] != '\\') && (fn[i] != '/')) { 39 | i-- ; 40 | } 41 | start = i + 1 ; 42 | 43 | char* retval = (char *) malloc (end - start + 2) ; 44 | 45 | j = 0 ; 46 | for (i = start ; i <= end ; i++, j++) { 47 | retval[j] = fn [i] ; 48 | } 49 | retval[j] = '\0' ; 50 | 51 | return retval ; 52 | } 53 | -------------------------------------------------------------------------------- /po/Rules-quot: -------------------------------------------------------------------------------- 1 | # Special Makefile rules for English message catalogs with quotation marks. 2 | 3 | DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot 4 | 5 | .SUFFIXES: .insert-header .po-update-en 6 | 7 | en@quot.po-update: en@quot.po-update-en 8 | en@boldquot.po-update: en@boldquot.po-update-en 9 | 10 | .insert-header.po-update-en: 11 | @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ 12 | if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ 13 | tmpdir=`pwd`; \ 14 | echo "$$lang:"; \ 15 | ll=`echo $$lang | sed -e 's/@.*//'`; \ 16 | LC_ALL=C; export LC_ALL; \ 17 | cd $(srcdir); \ 18 | if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ 19 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 20 | rm -f $$tmpdir/$$lang.new.po; \ 21 | else \ 22 | if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ 23 | :; \ 24 | else \ 25 | echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ 26 | exit 1; \ 27 | fi; \ 28 | fi; \ 29 | else \ 30 | echo "creation of $$lang.po failed!" 1>&2; \ 31 | rm -f $$tmpdir/$$lang.new.po; \ 32 | fi 33 | 34 | en@quot.insert-header: insert-header.sin 35 | sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header 36 | 37 | en@boldquot.insert-header: insert-header.sin 38 | sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header 39 | 40 | mostlyclean: mostlyclean-quot 41 | mostlyclean-quot: 42 | rm -f *.insert-header 43 | -------------------------------------------------------------------------------- /src/WavPCMSampleValue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_WAVSAMPLE_H 22 | #define SH_WAVSAMPLE_H 23 | 24 | #include 25 | 26 | #include "SampleValue.h" 27 | 28 | class CvrStgFile ; 29 | 30 | class WavPCMSampleValue : public SampleValue { 31 | public: 32 | WavPCMSampleValue (int v) ; 33 | 34 | SampleValue* getNearestTargetSampleValue (EmbValue t) const ; 35 | UWORD32 calcDistance (const SampleValue *s) const ; 36 | std::string getName (void) const ; 37 | 38 | int getValue (void) const 39 | { return Value ; } ; 40 | 41 | private: 42 | int Value ; 43 | int MaxValue ; 44 | int MinValue ; 45 | 46 | EmbValue calcEValue (int v) const 47 | { return (v & 1) ; } 48 | } ; 49 | 50 | class WavPCMSmaller : public std::binary_function { 51 | public: 52 | bool operator() (const WavPCMSampleValue *v, const WavPCMSampleValue *w) { return v->getValue() < w->getValue() ; } ; 53 | } ; 54 | 55 | #endif // ndef SH_WAVSAMPLE_H 56 | -------------------------------------------------------------------------------- /src/ColorPalette.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_COLORPALETTE_H 22 | #define SH_COLORPALETTE_H 23 | 24 | #include 25 | 26 | #include "RGBTriple.h" 27 | #include "common.h" 28 | 29 | /** 30 | * \class ColorPalette 31 | * \brief a color palette 32 | * 33 | * This class is essentially a vector with 34 | * some wrappers for exisiting methods. 35 | **/ 36 | class ColorPalette : public std::vector { 37 | public: 38 | /** 39 | * get the size, i.e. the number of entries of this color palette 40 | **/ 41 | unsigned int getSize (void) const 42 | { return size() ; } ; 43 | 44 | /** 45 | * add (a copy of) rgb to the end of this color palette 46 | **/ 47 | void addEntry (RGBTriple rgb) 48 | { push_back (rgb) ; } ; 49 | 50 | /** 51 | * add the color r/g/b to the end of this color palette 52 | **/ 53 | void addEntry (BYTE r, BYTE g, BYTE b) 54 | { push_back (RGBTriple (r, g, b)) ; } ; 55 | } ; 56 | 57 | #endif // ndef SH_COLORPALETTE_H 58 | -------------------------------------------------------------------------------- /tests/st_fileformats.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | use STSupport; 3 | 4 | use constant EMPTY => {e => "none", Z => "", K => "", "-check" => ""} ; 5 | 6 | sub runAu { 7 | startSubCategory("au") ; 8 | addTestResult(runEmbExtCmp(DATADIR . "mulaw_std.au", DATADIR . RND100, EMPTY)); 9 | addTestResult(runEmbExtCmp(DATADIR . "pcm8_std.au", DATADIR . RND100, EMPTY)); 10 | addTestResult(runEmbExtCmp(DATADIR . "pcm16_std.au", DATADIR . RND100, EMPTY)); 11 | endSubCategory() ; 12 | } 13 | 14 | sub runBmp { 15 | startSubCategory("bmp") ; 16 | addTestResult(runEmbExtCmp(DATADIR . "os21x1_std.bmp", DATADIR . RND100, EMPTY)); 17 | addTestResult(runEmbExtCmp(DATADIR . "os21x4_std.bmp", DATADIR . RND100, EMPTY)); 18 | addTestResult(runEmbExtCmp(DATADIR . "os21x8_std.bmp", DATADIR . RND100, EMPTY)); 19 | addTestResult(runEmbExtCmp(DATADIR . "os21x24_std.bmp", DATADIR . RND100, EMPTY)); 20 | addTestResult(runEmbExtCmp(DATADIR . "win3x1_std.bmp", DATADIR . RND100, EMPTY)); 21 | addTestResult(runEmbExtCmp(DATADIR . "win3x4_std.bmp", DATADIR . RND100, EMPTY)); 22 | addTestResult(runEmbExtCmp(DATADIR . "win3x8_std.bmp", DATADIR . RND100, EMPTY)); 23 | addTestResult(runEmbExtCmp(DATADIR . "win3x24_std.bmp", DATADIR . RND100, EMPTY)); 24 | endSubCategory() ; 25 | } 26 | 27 | sub runJpeg { 28 | startSubCategory("jpeg") ; 29 | addTestResult(runEmbExtCmp(DATADIR . "std.jpg", DATADIR . RND100, EMPTY)); 30 | addTestResult(runEmbExtCmp(DATADIR . "prog.jpg", DATADIR . RND100, EMPTY)); 31 | endSubCategory() ; 32 | } 33 | 34 | sub runWav { 35 | startSubCategory("wav") ; 36 | addTestResult(runEmbExtCmp(DATADIR . "pcm8_std.wav", DATADIR . RND100, EMPTY)); 37 | addTestResult(runEmbExtCmp(DATADIR . "pcm16_std.wav", DATADIR . RND100, EMPTY)); 38 | endSubCategory() ; 39 | } 40 | 41 | startCategory("File Formats", @ARGV) ; 42 | runAu() ; 43 | runBmp() ; 44 | runJpeg() ; 45 | runWav() ; 46 | exit endCategory() ; 47 | -------------------------------------------------------------------------------- /src/DMDConstructionHeuristic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_DMDCONSTRUCTIONHEURISTIC_H 22 | #define SH_DMDCONSTRUCTIONHEURISTIC_H 23 | 24 | #include "MatchingAlgorithm.h" 25 | class Vertex ; 26 | #include "common.h" 27 | 28 | /** 29 | * \class DMDConstructionHeuristic 30 | * \brief an implementation of the "dynamic minimum degree" heuristic for contruction a matching 31 | **/ 32 | class DMDConstructionHeuristic : public MatchingAlgorithm { 33 | public: 34 | DMDConstructionHeuristic (Graph* g, Matching* m, float goal = 100.0) ; 35 | 36 | virtual ~DMDConstructionHeuristic (void) {} ; 37 | 38 | const char* getName (void) const 39 | { return "Dynamic Minimum Degree Construction Heuristic" ; } ; 40 | 41 | void run (void) ; 42 | 43 | private: 44 | static const VertexLabel MinDegNotFound = VERTEXLABEL_MAX ; 45 | 46 | std::vector AvailableVertices ; 47 | 48 | VertexLabel findMinDegIndex (const std::vector& vertices) ; 49 | } ; 50 | 51 | #endif // ndef SH_DMDCONSTRUCTIONHEURISTIC_H 52 | -------------------------------------------------------------------------------- /src/RGBTriple.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_RGBTRIPLE_H 22 | #define SH_RGBTRIPLE_H 23 | 24 | #include "common.h" 25 | 26 | class RGBTriple { 27 | public: 28 | RGBTriple (void) 29 | : Red(0), Green(0), Blue(0) {} ; 30 | RGBTriple (BYTE r, BYTE g, BYTE b) 31 | : Red(r), Green(g), Blue(b) {} ; 32 | 33 | /** 34 | * get the squared distance in the RGB cube between this triple and the triple t 35 | * \param t another RGB triple 36 | * \return the square of the euclidean distance between this and t 37 | **/ 38 | UWORD32 calcDistance (const RGBTriple& t) const ; 39 | 40 | /** 41 | * returns true iff this triple and t are equal (i.e. have the same rgb values) 42 | **/ 43 | bool operator== (const RGBTriple& t) const ; 44 | 45 | /** 46 | * return true iff this triple and t are not equal (i.e. have different rgb values) 47 | **/ 48 | bool operator!= (const RGBTriple& t) const ; 49 | 50 | BYTE Red ; 51 | BYTE Green ; 52 | BYTE Blue ; 53 | } ; 54 | 55 | #endif // ndef SH_RGBTRIPLE_H 56 | -------------------------------------------------------------------------------- /src/WavFormatChunk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_WAVFORMATCHUNK_H 22 | #define SH_WAVFORMATCHUNK_H 23 | 24 | #include "common.h" 25 | #include "WavChunk.h" 26 | 27 | class BinaryIO ; 28 | 29 | class WavFormatChunk : public WavChunk { 30 | public: 31 | WavFormatChunk (void) : 32 | WavChunk() {} ; 33 | WavFormatChunk (WavChunkHeader *chh) : 34 | WavChunk(chh) {} ; 35 | WavFormatChunk (WavChunkHeader *chh, BinaryIO *io) : 36 | WavChunk(chh) { read(io) ; } ; 37 | 38 | void read (BinaryIO *io) ; 39 | void write (BinaryIO *io) ; 40 | 41 | UWORD16 getFormatTag (void) const 42 | { return FormatTag ; } ; 43 | 44 | UWORD16 getBitsPerSample (void) const 45 | { return BitsPerSample ; } ; 46 | 47 | static const UWORD16 FormatPCM = 0x0001 ; 48 | 49 | private: 50 | UWORD16 FormatTag ; 51 | UWORD16 Channels ; 52 | UWORD32 SamplesPerSec ; 53 | UWORD32 AvgBytesPerSec ; 54 | UWORD16 BlockAlign ; 55 | UWORD16 BitsPerSample ; 56 | UWORD16 AdditionalSize ; 57 | } ; 58 | 59 | #endif // ndef SH_WAVCHUNKFORMAT_H 60 | -------------------------------------------------------------------------------- /src/SMDConstructionHeuristic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_SMDCONSTRUCTIONHEURISTIC_H 22 | #define SH_SMDCONSTRUCTIONHEURISTIC_H 23 | 24 | #include "MatchingAlgorithm.h" 25 | #include "Vertex.h" 26 | #include "common.h" 27 | 28 | /** 29 | * \class SMDConstructionHeuristic 30 | * \brief an implementation of the "static minimum degree" heuristic for contructing a matching 31 | **/ 32 | class SMDConstructionHeuristic : public MatchingAlgorithm { 33 | public: 34 | SMDConstructionHeuristic (Graph* g, Matching* m, float goal = 100.0) ; 35 | 36 | virtual ~SMDConstructionHeuristic (void) {} ; 37 | 38 | const char* getName (void) const 39 | { return "Static Minimum Degree Construction Heuristic" ; } ; 40 | 41 | void run (void) ; 42 | 43 | private: 44 | class SmallerVertexDegree { 45 | public: 46 | bool operator() (const Vertex* v1, const Vertex* v2) 47 | { return (v1->getDegree() < v2->getDegree()) ; } ; 48 | } ; 49 | 50 | std::vector Vertices ; 51 | } ; 52 | 53 | #endif // ndef SH_SMDCONSTRUCTIONHEURISTIC_H 54 | -------------------------------------------------------------------------------- /src/BmpPaletteSampleValue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_BMPPALETTESAMPLEVALUE_H 22 | #define SH_BMPPALETTESAMPLEVALUE_H 23 | 24 | #include "BmpSampleValue.h" 25 | #include "CvrStgFile.h" 26 | #include "ColorPalette.h" 27 | #include "common.h" 28 | 29 | /** 30 | * \class BmpPaletteSampleValue 31 | * \brief a sample in a bmp palette (i.e. in a 1-,4- or 8-bit) file 32 | **/ 33 | class BmpPaletteSampleValue : public BmpSampleValue { 34 | public: 35 | BmpPaletteSampleValue (BYTE i) ; 36 | 37 | SampleValue* getNearestTargetSampleValue (EmbValue t) const ; 38 | std::string getName (void) const ; 39 | 40 | BYTE getIndex (void) const { return Index ; } ; 41 | BYTE getRed (void) const { return (*Palette)[Index].Red ; } ; 42 | BYTE getGreen (void) const { return (*Palette)[Index].Green ; } ; 43 | BYTE getBlue (void) const { return (*Palette)[Index].Blue ; } ; 44 | 45 | private: 46 | ColorPalette* Palette ; 47 | BYTE Index ; 48 | 49 | EmbValue calcEValue (BYTE idx) const 50 | { return (idx % Globs.TheCvrStgFile->getEmbValueModulus()) ; } ; 51 | } ; 52 | 53 | #endif // ndef SH_BMPPALETTESAMPLEVALUE_H 54 | -------------------------------------------------------------------------------- /tests/MHashPPTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_MHASHPPTEST_H 22 | #define SH_MHASHPPTEST_H 23 | 24 | #define private public 25 | #define protected public 26 | #include "MHashPP.h" 27 | #undef private 28 | #undef protected 29 | 30 | #include "BitString.h" 31 | #include "UnitTest.h" 32 | #include "TestSuite.h" 33 | 34 | class MHashPPTest : public UnitTest { 35 | public: 36 | MHashPPTest (TestSuite* s) ; 37 | 38 | /** 39 | * test output of MHashPP class with MD5 algorithm against the test vectors given in RFC 1321 40 | **/ 41 | void testMD5 (void) ; 42 | 43 | void testCRC32 (void) ; 44 | 45 | private: 46 | /** 47 | * compute a hash using MHashPP and compare it to a reference value 48 | * \param a the hash algorithm that should be used by MHashPP 49 | * \param data the input of the hash algorithm 50 | * \param shouldbe the reference value of the result of the hash algorithm 51 | * \return true iff shouldbe is the result of the hash algorithm a applied to data by MHashPP 52 | **/ 53 | bool genericTestMHashPP (hashid a, BitString data, BYTE* shouldbe) ; 54 | } ; 55 | 56 | #endif // ndef SH_MHASHPPTEST_H 57 | -------------------------------------------------------------------------------- /tests/GraphTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_GRAPHTEST_H 22 | #define SH_GRAPHTEST_H 23 | 24 | #include "UnitTest.h" 25 | 26 | class TestSuite ; 27 | class CvrStgFile ; 28 | class BitString ; 29 | class Selector ; 30 | class Graph ; 31 | 32 | class GraphTest : public UnitTest { 33 | public: 34 | GraphTest (TestSuite* s) ; 35 | 36 | void setup (void) ; 37 | void cleanup (void) ; 38 | 39 | void testVertices (void) ; 40 | void testSampleValues (void) ; 41 | void testSampleOccurences (void) ; 42 | void testSampleValueAdjacencyLists (void) ; 43 | 44 | private: 45 | CvrStgFile *f1, *f2, *f3, *f4, *f5, *f6, *f7, *f8, *f9, *f10, *f11, *f12, *f13, *f14, *f15, *f_f ; 46 | BitString *bs1, *bs2, *bs3, *bs4, *bs5, *bs6, *bs7, *bs8, *bs9, *bs10, *bs11, *bs12, *bs13, *bs14, *bs15, *bs_f ; 47 | Selector *s1, *s2, *s3, *s4, *s5, *s6, *s7, *s8, *s9, *s10, *s11, *s12, *s13, *s14, *s15, *s_f ; 48 | Graph *g1, *g2, *g3, *g4, *g5, *g6, *g7, *g8, *g9, *g10, *g11, *g12, *g13, *g14, *g15, *g_f ; 49 | Globals gl1, gl2, gl3, gl4, gl5, gl6, gl7, gl8, gl9, gl10, gl11, gl12, gl13, gl14, gl15, gl_f ; 50 | } ; 51 | 52 | #endif // ndef SH_GRAPHTEST_H 53 | -------------------------------------------------------------------------------- /src/SMDConstructionHeuristic.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "Edge.h" 22 | #include "Graph.h" 23 | #include "Matching.h" 24 | #include "SMDConstructionHeuristic.h" 25 | #include "Vertex.h" 26 | 27 | SMDConstructionHeuristic::SMDConstructionHeuristic (Graph* g, Matching* m, float goal) 28 | : MatchingAlgorithm (g, m, goal) 29 | { 30 | Vertices = std::vector (g->getNumVertices()) ; 31 | for (VertexLabel l = 0 ; l < g->getNumVertices() ; l++) { 32 | Vertices[l] = g->getVertex(l) ; 33 | myassert (m->isExposed (Vertices[l])) ; 34 | } 35 | 36 | sort (Vertices.begin(), Vertices.end(), SmallerVertexDegree()) ; 37 | } 38 | 39 | void SMDConstructionHeuristic::run (void) 40 | { 41 | for (VertexLabel l = 0 ; l < Vertices.size() ; l++) { 42 | if (TheMatching->isExposed(Vertices[l]) && Vertices[l]->getDegree() > 0) { 43 | Vertex* v1 = Vertices[l] ; 44 | v1->updateShortestEdge() ; 45 | Edge* e = v1->getShortestEdge() ; 46 | Vertex* v2 = e->getOtherVertex (v1) ; 47 | 48 | TheMatching->addEdge(*e) ; 49 | 50 | v1->markDeleted() ; 51 | v2->markDeleted() ; 52 | } 53 | } 54 | 55 | TheGraph->unmarkDeletedAllVertices() ; 56 | } 57 | -------------------------------------------------------------------------------- /intl/dgettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dgettext(3) function. 2 | Copyright (C) 1995-1997, 2000, 2001, 2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include 24 | 25 | #include "gettextP.h" 26 | #ifdef _LIBC 27 | # include 28 | #else 29 | # include "libgnuintl.h" 30 | #endif 31 | 32 | /* @@ end of prolog @@ */ 33 | 34 | /* Names for the libintl functions are a problem. They must not clash 35 | with existing names and they should follow ANSI C. But this source 36 | code is also used in GNU C Library where the names have a __ 37 | prefix. So we have to make a difference here. */ 38 | #ifdef _LIBC 39 | # define DGETTEXT __dgettext 40 | # define DCGETTEXT INTUSE(__dcgettext) 41 | #else 42 | # define DGETTEXT libintl_dgettext 43 | # define DCGETTEXT libintl_dcgettext 44 | #endif 45 | 46 | /* Look up MSGID in the DOMAINNAME message catalog of the current 47 | LC_MESSAGES locale. */ 48 | char * 49 | DGETTEXT (domainname, msgid) 50 | const char *domainname; 51 | const char *msgid; 52 | { 53 | return DCGETTEXT (domainname, msgid, LC_MESSAGES); 54 | } 55 | 56 | #ifdef _LIBC 57 | /* Alias for function name in GNU C Library. */ 58 | weak_alias (__dgettext, dgettext); 59 | #endif 60 | -------------------------------------------------------------------------------- /intl/dcgettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dcgettext(3) function. 2 | Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "gettextP.h" 24 | #ifdef _LIBC 25 | # include 26 | #else 27 | # include "libgnuintl.h" 28 | #endif 29 | 30 | /* @@ end of prolog @@ */ 31 | 32 | /* Names for the libintl functions are a problem. They must not clash 33 | with existing names and they should follow ANSI C. But this source 34 | code is also used in GNU C Library where the names have a __ 35 | prefix. So we have to make a difference here. */ 36 | #ifdef _LIBC 37 | # define DCGETTEXT __dcgettext 38 | # define DCIGETTEXT __dcigettext 39 | #else 40 | # define DCGETTEXT libintl_dcgettext 41 | # define DCIGETTEXT libintl_dcigettext 42 | #endif 43 | 44 | /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY 45 | locale. */ 46 | char * 47 | DCGETTEXT (domainname, msgid, category) 48 | const char *domainname; 49 | const char *msgid; 50 | int category; 51 | { 52 | return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category); 53 | } 54 | 55 | #ifdef _LIBC 56 | /* Alias for function name in GNU C Library. */ 57 | INTDEF(__dcgettext) 58 | weak_alias (__dcgettext, dcgettext); 59 | #endif 60 | -------------------------------------------------------------------------------- /tests/TestSuite.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_TESTSUITE_H 22 | #define SH_TESTSUITE_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "Test.h" 29 | #include "UnitTest.h" 30 | 31 | class TestSuite : public Test { 32 | public: 33 | enum TESTRESULT { NOTINSTALLED, // when something that is needed for the test is not installed on the current system 34 | KNOWNEXCEPTION, 35 | UNKNOWNEXCEPTION } ; 36 | 37 | TestSuite (void) ; 38 | 39 | void addUnitTest (UnitTest* ut) ; 40 | 41 | void run (void) ; 42 | 43 | /** 44 | * \return true iff all tests were ok 45 | **/ 46 | bool getResult (void) 47 | { return SuiteOk ; } ; 48 | 49 | // used during testing 50 | void startUnit (std::string n) ; 51 | void endUnit (std::string n) ; 52 | void startCategory (std::string n) ; 53 | void endCategory (std::string n) ; 54 | void addTestResult (bool r) ; 55 | void addTestResult (TESTRESULT r) ; 56 | 57 | private: 58 | std::vector UnitTests ; 59 | 60 | std::string runningUnit ; 61 | std::string runningCategory ; 62 | bool runningCategoryOk ; 63 | bool SuiteOk ; 64 | unsigned short TestNumber ; 65 | std::ostream* OutStream ; 66 | } ; 67 | 68 | #endif // ndef SH_TESTSUITE_H 69 | -------------------------------------------------------------------------------- /src/BFSAPHeuristic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_BFSAPHeuristic 22 | #define SH_BFSAPHeuristic 23 | 24 | #include "EdgeIterator.h" 25 | #include "MatchingAlgorithm.h" 26 | #include "Vertex.h" 27 | 28 | class Edge ; 29 | #include "Graph.h" 30 | class Matching ; 31 | 32 | /** 33 | * \class BFSAPHeuristic 34 | * \brief a matching algorithm implementing a heuristic breadth-first-search for augmenting paths 35 | **/ 36 | class BFSAPHeuristic : public MatchingAlgorithm { 37 | public: 38 | /** 39 | * construct an BFSAPHeuristic object 40 | * \param g the graph on which this heuristic should run 41 | * \param m the matching to start with 42 | **/ 43 | BFSAPHeuristic (Graph* g, Matching* m) ; 44 | 45 | virtual ~BFSAPHeuristic (void) ; 46 | 47 | const char* getName (void) const 48 | { return "BFS Augmenting Path Heuristic" ; } ; 49 | 50 | void run (void) ; 51 | 52 | private: 53 | /** 54 | * \param v0 an exposed vertex 55 | * \param path an array of Edge pointers where the path will be put 56 | * \return the length of the path (the number of valid edges in path) 57 | **/ 58 | unsigned long searchAugmentingPath (Vertex* v0, const Edge** path) ; 59 | 60 | bool* VertexVisited ; 61 | Edge* BackEdge ; 62 | } ; 63 | 64 | #endif // ndef SH_BFSAPHeuristic 65 | -------------------------------------------------------------------------------- /src/PseudoRandomSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_PSEUDORANDOMSOURCE_H 22 | #define SH_PSEUDORANDOMSOURCE_H 23 | 24 | #include "common.h" 25 | /** 26 | * \class PseudoRandomSource 27 | * \brief this class serves as a source of reproducible (pseudo-)random numbers 28 | * 29 | * To generate the random numbers, the linear congruetial method is used. 30 | * 2^32 is used as modulus. The overflow in the implementation is intended (and 31 | * controlled, as UWORD32 is used as datatype which always is 32 bits wide). 32 | **/ 33 | class PseudoRandomSource { 34 | public: 35 | /** 36 | * construct a PseudoRandomSource object 37 | * \param s the seed 38 | **/ 39 | PseudoRandomSource (UWORD32 s) : Value(s) {} ; 40 | 41 | /** 42 | * get a pseudo-random value from {0,...,n-1} 43 | * \param n the range of the random value to be returned 44 | * \return a number >= 0 and <= n - 1 45 | * 46 | * After calling getValue, the next getValue call will use the next state 47 | * of the random number generator (analogous to the C rand() function) 48 | **/ 49 | UWORD32 getValue (UWORD32 n) ; 50 | 51 | private: 52 | static const UWORD32 A = 1367208549 ; 53 | static const UWORD32 C = 1 ; 54 | UWORD32 Value ; 55 | } ; 56 | 57 | #endif // ndef SH_PSEUDORANDOMSOURCE_H 58 | -------------------------------------------------------------------------------- /intl/hash-string.h: -------------------------------------------------------------------------------- 1 | /* Description of GNU message catalog format: string hashing function. 2 | Copyright (C) 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | /* @@ end of prolog @@ */ 20 | 21 | #ifndef PARAMS 22 | # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES 23 | # define PARAMS(Args) Args 24 | # else 25 | # define PARAMS(Args) () 26 | # endif 27 | #endif 28 | 29 | /* We assume to have `unsigned long int' value with at least 32 bits. */ 30 | #define HASHWORDBITS 32 31 | 32 | 33 | /* Defines the so called `hashpjw' function by P.J. Weinberger 34 | [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 35 | 1986, 1987 Bell Telephone Laboratories, Inc.] */ 36 | static unsigned long int hash_string PARAMS ((const char *__str_param)); 37 | 38 | static inline unsigned long int 39 | hash_string (str_param) 40 | const char *str_param; 41 | { 42 | unsigned long int hval, g; 43 | const char *str = str_param; 44 | 45 | /* Compute the hash value for the given string. */ 46 | hval = 0; 47 | while (*str != '\0') 48 | { 49 | hval <<= 4; 50 | hval += (unsigned long int) *str++; 51 | g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); 52 | if (g != 0) 53 | { 54 | hval ^= g >> (HASHWORDBITS - 8); 55 | hval ^= g; 56 | } 57 | } 58 | return hval; 59 | } 60 | -------------------------------------------------------------------------------- /intl/gettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of gettext(3) function. 2 | Copyright (C) 1995, 1997, 2000, 2001, 2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #ifdef _LIBC 24 | # define __need_NULL 25 | # include 26 | #else 27 | # include /* Just for NULL. */ 28 | #endif 29 | 30 | #include "gettextP.h" 31 | #ifdef _LIBC 32 | # include 33 | #else 34 | # include "libgnuintl.h" 35 | #endif 36 | 37 | /* @@ end of prolog @@ */ 38 | 39 | /* Names for the libintl functions are a problem. They must not clash 40 | with existing names and they should follow ANSI C. But this source 41 | code is also used in GNU C Library where the names have a __ 42 | prefix. So we have to make a difference here. */ 43 | #ifdef _LIBC 44 | # define GETTEXT __gettext 45 | # define DCGETTEXT INTUSE(__dcgettext) 46 | #else 47 | # define GETTEXT libintl_gettext 48 | # define DCGETTEXT libintl_dcgettext 49 | #endif 50 | 51 | /* Look up MSGID in the current default message catalog for the current 52 | LC_MESSAGES locale. If not found, returns MSGID itself (the default 53 | text). */ 54 | char * 55 | GETTEXT (msgid) 56 | const char *msgid; 57 | { 58 | return DCGETTEXT (NULL, msgid, LC_MESSAGES); 59 | } 60 | 61 | #ifdef _LIBC 62 | /* Alias for function name in GNU C Library. */ 63 | weak_alias (__gettext, gettext); 64 | #endif 65 | -------------------------------------------------------------------------------- /tests/st_embparameters.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | use STSupport; 3 | 4 | use constant EMPTY => {e => "none", Z => "", K => "", "-check" => ""} ; 5 | 6 | sub runEncryption { 7 | startSubCategory("Encryption") ; 8 | $ref = EMPTY ; 9 | %args = %$ref ; 10 | $args{e} = "des ecb" ; 11 | addTestResult(runEmbExtCmp(DATADIR . "os21x8_std.bmp", DATADIR . RND100, \%args)); 12 | $args{e} = "arcfour stream" ; 13 | addTestResult(runEmbExtCmp(DATADIR . "mulaw_std.au", DATADIR . RND100, \%args)); 14 | $args{e} = "nofb gost" ; 15 | addTestResult(runEmbExtCmp(DATADIR . "pcm8_std.wav", DATADIR . RND100, \%args)); 16 | $args{e} = "blowfish" ; 17 | addTestResult(runEmbExtCmp(DATADIR . "win3x24_std.bmp", DATADIR . RND100, \%args)); 18 | $args{e} = "serpent ncfb" ; 19 | addTestResult(runEmbExtCmp(DATADIR . "pcm16_std.au", DATADIR . RND100, \%args)); 20 | $args{e} = "ofb" ; 21 | addTestResult(runEmbExtCmp(DATADIR . "win3x4_std.bmp", DATADIR . RND100, \%args)); 22 | endSubCategory() ; 23 | } 24 | 25 | sub runCompression { 26 | startSubCategory("Compression") ; 27 | $ref = EMPTY ; 28 | %args = %$ref ; 29 | delete $args{Z} ; 30 | addTestResult(runEmbExtCmp(DATADIR . "mulaw_std.au", DATADIR . RND100, \%args)); 31 | $args{z} = "1" ; 32 | addTestResult(runEmbExtCmp(DATADIR . "pcm16_std.au", DATADIR . RND100, \%args)); 33 | $args{z} = "7" ; 34 | addTestResult(runEmbExtCmp(DATADIR . "os21x1_std.bmp", DATADIR . RND100, \%args)); 35 | endSubCategory() ; 36 | } 37 | 38 | sub runChecksum { 39 | startSubCategory("Checksum") ; 40 | $ref = EMPTY ; 41 | %args = %$ref ; 42 | delete $args{K} ; 43 | addTestResult(runEmbExtCmp(DATADIR . "mulaw_std.au", DATADIR . RND100, \%args)); 44 | addTestResult(runEmbExtCmp(DATADIR . "pcm16_std.au", DATADIR . RND100, \%args)); 45 | addTestResult(runEmbExtCmp(DATADIR . "os21x1_std.bmp", DATADIR . RND100, \%args)); 46 | addTestResult(runEmbExtCmp(DATADIR . "win3x24_std.bmp", DATADIR . RND100, \%args)); 47 | addTestResult(runEmbExtCmp(DATADIR . "pcm8_std.wav", DATADIR . RND100, \%args)); 48 | endSubCategory() ; 49 | } 50 | 51 | startCategory("Embedding Parameters", @ARGV) ; 52 | runEncryption() ; 53 | runCompression() ; 54 | runChecksum() ; 55 | exit endCategory() ; 56 | -------------------------------------------------------------------------------- /intl/dcngettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dcngettext(3) function. 2 | Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "gettextP.h" 24 | #ifdef _LIBC 25 | # include 26 | #else 27 | # include "libgnuintl.h" 28 | #endif 29 | 30 | /* @@ end of prolog @@ */ 31 | 32 | /* Names for the libintl functions are a problem. They must not clash 33 | with existing names and they should follow ANSI C. But this source 34 | code is also used in GNU C Library where the names have a __ 35 | prefix. So we have to make a difference here. */ 36 | #ifdef _LIBC 37 | # define DCNGETTEXT __dcngettext 38 | # define DCIGETTEXT __dcigettext 39 | #else 40 | # define DCNGETTEXT libintl_dcngettext 41 | # define DCIGETTEXT libintl_dcigettext 42 | #endif 43 | 44 | /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY 45 | locale. */ 46 | char * 47 | DCNGETTEXT (domainname, msgid1, msgid2, n, category) 48 | const char *domainname; 49 | const char *msgid1; 50 | const char *msgid2; 51 | unsigned long int n; 52 | int category; 53 | { 54 | return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category); 55 | } 56 | 57 | #ifdef _LIBC 58 | /* Alias for function name in GNU C Library. */ 59 | INTDEF(__dcngettext) 60 | weak_alias (__dcngettext, dcngettext); 61 | #endif 62 | -------------------------------------------------------------------------------- /tests/JpegSampleValueTest.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "JpegSampleValueTest.h" 22 | #include "utcommon.h" 23 | 24 | #include "JpegSampleValue.h" 25 | #include "CvrStgFile.h" 26 | 27 | JpegSampleValueTest::JpegSampleValueTest (TestSuite* s) 28 | : SampleValueTest ("JpegSampleValue", s) 29 | { 30 | ADDTESTCATEGORY (JpegSampleValueTest, testDistance) ; 31 | ADDTESTCATEGORY (JpegSampleValueTest, testIsNeighbour) ; 32 | } 33 | 34 | void JpegSampleValueTest::setup () 35 | { 36 | UnitTest::setup() ; 37 | 38 | Globs.reset() ; 39 | f1 = CvrStgFile::readFile (std::string(DATADIR) + "std.jpg") ; 40 | sv_m1 = new JpegSampleValue (-1) ; 41 | sv_0 = new JpegSampleValue (0) ; 42 | sv_1 = new JpegSampleValue (1) ; 43 | gl1 = Globs ; 44 | } 45 | 46 | void JpegSampleValueTest::cleanup () 47 | { 48 | UnitTest::cleanup() ; 49 | delete f1 ; 50 | delete sv_m1 ; delete sv_0 ; delete sv_1 ; 51 | } 52 | 53 | void JpegSampleValueTest::testDistance () 54 | { 55 | Globs = gl1 ; 56 | addTestResult (genericTestDistance (sv_0, sv_1, 1)) ; 57 | addTestResult (genericTestDistance (sv_m1, sv_1, 2)) ; 58 | } 59 | 60 | void JpegSampleValueTest::testIsNeighbour () 61 | { 62 | Globs = gl1 ; 63 | addTestResult (genericTestIsNeighbour (sv_m1, sv_0, true)) ; 64 | addTestResult (genericTestIsNeighbour (sv_1, sv_m1, false)) ; 65 | } 66 | -------------------------------------------------------------------------------- /tests/SampleValueTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_SAMPLEVALUETEST_H 22 | #define SH_SAMPLEVALUETEST_H 23 | 24 | #include 25 | 26 | #include "UnitTest.h" 27 | 28 | class SampleValue ; 29 | 30 | class SampleValueTest : public UnitTest { 31 | public: 32 | SampleValueTest (std::string n, TestSuite* s) : UnitTest(n, s) {} ; 33 | 34 | protected: 35 | /** 36 | * generic distance test 37 | * \param s1 a sample value 38 | * \param s2 another sample value 39 | * \param dist this should be the distance between s1 and s2 40 | * \return true iff distance is commutative and return dist 41 | **/ 42 | bool genericTestDistance (SampleValue* s1, SampleValue* s2, UWORD32 dist) ; 43 | 44 | /** 45 | * generic neighbourhood test 46 | * \param s1 a sample value 47 | * \param s2 another sample value 48 | * \param res true iff they are neighbours 49 | * \return true iff calling isNeighbour (with reflexivity) equals res 50 | **/ 51 | bool genericTestIsNeighbour (SampleValue* s1, SampleValue* s2, bool res) ; 52 | 53 | /** 54 | * generic evalue test 55 | * \param s a sample value 56 | * \param ev an embedded value 57 | * \return true iff s->getEmbeddedValue() == ev 58 | **/ 59 | bool genericTestEValue (SampleValue* s, EmbValue ev) ; 60 | } ; 61 | 62 | #endif // ndef SH_SAMPLEVALUETEST_H 63 | -------------------------------------------------------------------------------- /intl/dngettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dngettext(3) function. 2 | Copyright (C) 1995-1997, 2000, 2001, 2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include 24 | 25 | #include "gettextP.h" 26 | #ifdef _LIBC 27 | # include 28 | #else 29 | # include "libgnuintl.h" 30 | #endif 31 | 32 | /* @@ end of prolog @@ */ 33 | 34 | /* Names for the libintl functions are a problem. They must not clash 35 | with existing names and they should follow ANSI C. But this source 36 | code is also used in GNU C Library where the names have a __ 37 | prefix. So we have to make a difference here. */ 38 | #ifdef _LIBC 39 | # define DNGETTEXT __dngettext 40 | # define DCNGETTEXT INTUSE(__dcngettext) 41 | #else 42 | # define DNGETTEXT libintl_dngettext 43 | # define DCNGETTEXT libintl_dcngettext 44 | #endif 45 | 46 | /* Look up MSGID in the DOMAINNAME message catalog of the current 47 | LC_MESSAGES locale and skip message according to the plural form. */ 48 | char * 49 | DNGETTEXT (domainname, msgid1, msgid2, n) 50 | const char *domainname; 51 | const char *msgid1; 52 | const char *msgid2; 53 | unsigned long int n; 54 | { 55 | return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES); 56 | } 57 | 58 | #ifdef _LIBC 59 | /* Alias for function name in GNU C Library. */ 60 | weak_alias (__dngettext, dngettext); 61 | #endif 62 | -------------------------------------------------------------------------------- /tests/UnitTest.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "SteghideError.h" 22 | 23 | #include "TestCategory.h" 24 | #include "UnitTest.h" 25 | #include "TestSuite.h" 26 | 27 | UnitTest::~UnitTest() 28 | { 29 | for (std::vector::const_iterator it = TestCategories.begin() ; it != TestCategories.end() ; it++) { 30 | delete *it ; 31 | } 32 | } 33 | 34 | void UnitTest::setup () 35 | { 36 | GlobsBackup = Globs ; 37 | } 38 | 39 | void UnitTest::run() 40 | { 41 | getSuite()->startUnit (getName()) ; 42 | for (std::vector::const_iterator it = TestCategories.begin() ; it != TestCategories.end() ; it++) { 43 | getSuite()->startCategory ((*it)->getName()) ; 44 | try { 45 | (*it)->run() ; 46 | } 47 | catch (SteghideError& e) { 48 | getSuite()->addTestResult (TestSuite::KNOWNEXCEPTION) ; 49 | e.printMessage() ; 50 | } 51 | catch (...) { 52 | getSuite()->addTestResult (TestSuite::UNKNOWNEXCEPTION) ; 53 | } 54 | getSuite()->endCategory ((*it)->getName()) ; 55 | } 56 | getSuite()->endUnit (getName()) ; 57 | } 58 | 59 | void UnitTest::cleanup () 60 | { 61 | Globs = GlobsBackup ; 62 | } 63 | 64 | void UnitTest::addTestCategory (TestCategory* tc) 65 | { 66 | TestCategories.push_back (tc) ; 67 | } 68 | 69 | void UnitTest::addTestResult (bool r) 70 | { 71 | getSuite()->addTestResult (r) ; 72 | } 73 | -------------------------------------------------------------------------------- /m4/intdiv0.m4: -------------------------------------------------------------------------------- 1 | # intdiv0.m4 serial 1 (gettext-0.11.3) 2 | dnl Copyright (C) 2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | 9 | dnl From Bruno Haible. 10 | 11 | AC_DEFUN([gt_INTDIV0], 12 | [ 13 | AC_REQUIRE([AC_PROG_CC])dnl 14 | AC_REQUIRE([AC_CANONICAL_HOST])dnl 15 | 16 | AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], 17 | gt_cv_int_divbyzero_sigfpe, 18 | [ 19 | AC_TRY_RUN([ 20 | #include 21 | #include 22 | 23 | static void 24 | #ifdef __cplusplus 25 | sigfpe_handler (int sig) 26 | #else 27 | sigfpe_handler (sig) int sig; 28 | #endif 29 | { 30 | /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ 31 | exit (sig != SIGFPE); 32 | } 33 | 34 | int x = 1; 35 | int y = 0; 36 | int z; 37 | int nan; 38 | 39 | int main () 40 | { 41 | signal (SIGFPE, sigfpe_handler); 42 | /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ 43 | #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) 44 | signal (SIGTRAP, sigfpe_handler); 45 | #endif 46 | /* Linux/SPARC yields signal SIGILL. */ 47 | #if defined (__sparc__) && defined (__linux__) 48 | signal (SIGILL, sigfpe_handler); 49 | #endif 50 | 51 | z = x / y; 52 | nan = y / y; 53 | exit (1); 54 | } 55 | ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, 56 | [ 57 | # Guess based on the CPU. 58 | case "$host_cpu" in 59 | alpha* | i[34567]86 | m68k | s390*) 60 | gt_cv_int_divbyzero_sigfpe="guessing yes";; 61 | *) 62 | gt_cv_int_divbyzero_sigfpe="guessing no";; 63 | esac 64 | ]) 65 | ]) 66 | case "$gt_cv_int_divbyzero_sigfpe" in 67 | *yes) value=1;; 68 | *) value=0;; 69 | esac 70 | AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, 71 | [Define if integer division by zero raises signal SIGFPE.]) 72 | ]) 73 | -------------------------------------------------------------------------------- /tests/DummySampleValue.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "CvrStgFile.h" 22 | 23 | #include "DummyFile.h" 24 | #include "DummySampleValue.h" 25 | 26 | UWORD32 DummySampleValue::calcDistance (const SampleValue* s) const 27 | { 28 | DummySampleValue *sample = (DummySampleValue*) s ; 29 | return ((sample->Value > Value) ? (sample->Value - Value) : (Value - sample->Value)) ; 30 | } 31 | 32 | bool DummySampleValue::isNeighbour (const SampleValue* s) const 33 | { 34 | DummyFile *f = (DummyFile*) Globs.TheCvrStgFile ; 35 | DummySampleValue *sample = (DummySampleValue*) s ; 36 | std::vector >* svam = f->getSampleValueAdjacencyMatrix() ; 37 | return (*svam)[Value][sample->getValue()] ; 38 | } 39 | 40 | SampleValue* DummySampleValue::getNearestTargetSampleValue (EmbValue t) const 41 | { 42 | UWORD16 n_value = 0 ; 43 | if (Value == 0) { 44 | n_value = 1 ; 45 | } 46 | else if (Value == UWORD16_MAX) { 47 | n_value = UWORD16_MAX - 1 ; 48 | } 49 | else { 50 | if (RndSrc.getBool()) { 51 | n_value = Value - 1 ; 52 | } 53 | else { 54 | n_value = Value + 1 ; 55 | } 56 | } 57 | myassert (n_value % 2 == t) ; 58 | return ((SampleValue *) new DummySampleValue (n_value)) ; 59 | } 60 | 61 | std::string DummySampleValue::getName (void) const 62 | { 63 | char buf[128] ; 64 | sprintf (buf, "%d", Value) ; 65 | return std::string (buf) ; 66 | } 67 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | if USE_INTLDIR 2 | AM_CPPFLAGS = -I../intl -DLOCALEDIR=\"$(localedir)\" 3 | else 4 | AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" 5 | endif 6 | bin_PROGRAMS = steghide 7 | noinst_HEADERS = \ 8 | AUtils.h Arg.h Arguments.h AssertionFailed.h AuData.h AuFile.h \ 9 | AuSampleValues.h AudioData.h AudioSampleValue.h DFSAPHeuristic.h BFSAPHeuristic.h \ 10 | BinaryIO.h BitString.h BmpFile.h BmpPaletteSampleValue.h BmpRGBSampleValue.h \ 11 | BmpSampleValue.h ColorPalette.h WKSConstructionHeuristic.h CvrStgFile.h \ 12 | CvrStgObject.h Edge.h EdgeIterator.h DMDConstructionHeuristic.h \ 13 | EmbData.h Embedder.h EncryptionAlgorithm.h EncryptionMode.h Extractor.h \ 14 | Globals.h Graph.h JpegFile.h JpegSampleValue.h MCryptPP.h MHashKeyGen.h \ 15 | MHashPP.h Matching.h MatchingAlgorithm.h ProgressOutput.h PseudoRandomSource.h \ 16 | RGBTriple.h RandomSource.h SampleOccurence.h SampleValue.h \ 17 | SampleValueAdjacencyList.h Selector.h Session.h SteghideError.h Terminal.h \ 18 | Utils.h Vertex.h WavChunk.h WavChunkHeader.h WavChunkUnused.h WavFile.h \ 19 | WavFormatChunk.h WavPCMSampleValue.h common.h error.h msg.h wrapper_hash_map.h \ 20 | wrapper_hash_set.h SMDConstructionHeuristic.h gettext.h 21 | steghide_SOURCES = \ 22 | Arg.cc Arguments.cc AssertionFailed.cc AuFile.cc AuSampleValues.cc \ 23 | DFSAPHeuristic.cc BFSAPHeuristic.cc BinaryIO.cc BitString.cc BmpFile.cc \ 24 | BmpPaletteSampleValue.cc BmpRGBSampleValue.cc BmpSampleValue.cc \ 25 | WKSConstructionHeuristic.cc DMDConstructionHeuristic.cc CvrStgFile.cc \ 26 | Edge.cc EdgeIterator.cc EmbData.cc Embedder.cc \ 27 | EncryptionAlgorithm.cc EncryptionMode.cc Extractor.cc Graph.cc JpegFile.cc \ 28 | JpegSampleValue.cc MCryptPP.cc MHashKeyGen.cc MHashPP.cc Matching.cc \ 29 | MatchingAlgorithm.cc ProgressOutput.cc PseudoRandomSource.cc RGBTriple.cc \ 30 | RandomSource.cc SampleValue.cc SampleValueAdjacencyList.cc Selector.cc \ 31 | Session.cc SteghideError.cc Terminal.cc Utils.cc Vertex.cc WavChunk.cc \ 32 | WavChunkHeader.cc WavChunkUnused.cc WavFile.cc WavFormatChunk.cc \ 33 | WavPCMSampleValue.cc error.cc main.cc msg.cc SMDConstructionHeuristic.cc 34 | AM_LIBTOOLFLAGS = --tag=CXX 35 | 36 | LIBS = @LIBINTL@ @LIBS@ 37 | localedir = $(datadir)/locale 38 | LIBTOOL = $(SHELL) libtool 39 | MAINTAINERCLEANFILES = Makefile.in 40 | -------------------------------------------------------------------------------- /intl/ngettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of ngettext(3) function. 2 | Copyright (C) 1995, 1997, 2000, 2001, 2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #ifdef _LIBC 24 | # define __need_NULL 25 | # include 26 | #else 27 | # include /* Just for NULL. */ 28 | #endif 29 | 30 | #include "gettextP.h" 31 | #ifdef _LIBC 32 | # include 33 | #else 34 | # include "libgnuintl.h" 35 | #endif 36 | 37 | #include 38 | 39 | /* @@ end of prolog @@ */ 40 | 41 | /* Names for the libintl functions are a problem. They must not clash 42 | with existing names and they should follow ANSI C. But this source 43 | code is also used in GNU C Library where the names have a __ 44 | prefix. So we have to make a difference here. */ 45 | #ifdef _LIBC 46 | # define NGETTEXT __ngettext 47 | # define DCNGETTEXT INTUSE(__dcngettext) 48 | #else 49 | # define NGETTEXT libintl_ngettext 50 | # define DCNGETTEXT libintl_dcngettext 51 | #endif 52 | 53 | /* Look up MSGID in the current default message catalog for the current 54 | LC_MESSAGES locale. If not found, returns MSGID itself (the default 55 | text). */ 56 | char * 57 | NGETTEXT (msgid1, msgid2, n) 58 | const char *msgid1; 59 | const char *msgid2; 60 | unsigned long int n; 61 | { 62 | return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES); 63 | } 64 | 65 | #ifdef _LIBC 66 | /* Alias for function name in GNU C Library. */ 67 | weak_alias (__ngettext, ngettext); 68 | #endif 69 | -------------------------------------------------------------------------------- /src/Arg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_ARG_H 22 | #define SH_ARG_H 23 | 24 | #include 25 | #include 26 | 27 | #include "EncryptionAlgorithm.h" 28 | #include "EncryptionMode.h" 29 | 30 | // to include DEBUG if defined 31 | #ifdef HAVE_CONFIG_H 32 | #include 33 | #endif 34 | 35 | template class Arg { 36 | public: 37 | Arg (void) : set(false) {} ; 38 | Arg (T v, bool setbyuser = true) ; 39 | 40 | T getValue (void) const 41 | { return Value ; } ; 42 | 43 | void setValue (T v, bool setbyuser = true) ; 44 | 45 | bool is_set (void) const 46 | { return set ; } ; 47 | 48 | private: 49 | T Value ; 50 | bool set ; 51 | } ; 52 | 53 | enum COMMAND { EMBED, EXTRACT, INFO, ENCINFO, SHOWVERSION, SHOWLICENSE, SHOWHELP, PRINTFREQS } ; 54 | enum VERBOSITY { QUIET, NORMAL, VERBOSE, STATS } ; 55 | enum DEBUGCOMMAND { NONE, PRINTGRAPH, PRINTGMLGRAPH, PRINTGMLVERTEX } ; 56 | 57 | typedef Arg ArgCommand ; 58 | typedef Arg ArgVerbosity ; 59 | typedef Arg ArgBool ; 60 | typedef Arg ArgString ; 61 | typedef Arg ArgULong ; 62 | typedef Arg ArgInt ; 63 | typedef Arg ArgFloat ; 64 | typedef Arg ArgEncAlgo ; 65 | typedef Arg ArgEncMode ; 66 | typedef Arg ArgUInt ; 67 | typedef Arg > ArgStringList ; 68 | typedef Arg ArgDebugCommand ; 69 | 70 | #endif // ndef SH_ARG_H 71 | -------------------------------------------------------------------------------- /src/AuData.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_AUDATA_H 22 | #define SH_AUDATA_H 23 | 24 | #include "BinaryIO.h" 25 | #include "AudioData.h" 26 | 27 | // AuMuLawAudioData 28 | typedef AudioDataImpl AuMuLawAudioData ; 29 | template <> inline BYTE AuMuLawAudioData::readValue (BinaryIO* io) const { return (io->read8()) ; } 30 | template <> inline void AuMuLawAudioData::writeValue (BinaryIO* io, BYTE v) const { io->write8(v) ; } 31 | 32 | // AuPCM8AudioData 33 | typedef AudioDataImpl AuPCM8AudioData ; 34 | template <> inline SBYTE AuPCM8AudioData::readValue (BinaryIO* io) const { return ((SBYTE) io->read8()) ; } 35 | template <> inline void AuPCM8AudioData::writeValue (BinaryIO* io, SBYTE v) const { io->write8((BYTE) v) ; } 36 | 37 | // AuPCM16AudioData 38 | typedef AudioDataImpl AuPCM16AudioData ; 39 | template <> inline SWORD16 AuPCM16AudioData::readValue (BinaryIO* io) const { return ((SWORD16) io->read16_be()) ; } 40 | template <> inline void AuPCM16AudioData::writeValue (BinaryIO* io, SWORD16 v) const { io->write16_be((UWORD16) v) ; } 41 | 42 | // AuPCM32AudioData 43 | typedef AudioDataImpl AuPCM32AudioData ; 44 | template <> inline SWORD32 AuPCM32AudioData::readValue (BinaryIO* io) const { return ((SWORD32) io->read32_be()) ; } 45 | template <> inline void AuPCM32AudioData::writeValue (BinaryIO* io, SWORD32 v) const { io->write32_be((UWORD32) v) ; } 46 | 47 | #endif // ndef SH_AUDATA_H 48 | -------------------------------------------------------------------------------- /src/SampleValue.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "common.h" 22 | #include "SampleValue.h" 23 | #include "CvrStgFile.h" 24 | 25 | SampleValue::SampleValue () 26 | : Label(0) 27 | { 28 | NumEdges = new UWORD32[Globs.TheCvrStgFile->getEmbValueModulus()] ; 29 | } 30 | 31 | SampleValue::~SampleValue () 32 | { 33 | delete[] NumEdges ; 34 | } 35 | 36 | void SampleValue::incNumEdges (EmbValue t) 37 | { 38 | NumEdges[t]++ ; 39 | } 40 | 41 | void SampleValue::decNumEdges (EmbValue t) 42 | { 43 | myassert (NumEdges[t] > 0) ; 44 | NumEdges[t]-- ; 45 | } 46 | 47 | bool SampleValue::isNeighbour (const SampleValue *s) const 48 | { 49 | #ifdef DEBUG 50 | printDebug (5, "SampleValue::isNeighbour: Distance: %lu, Radius: %lu\n", calcDistance(s), Globs.TheCvrStgFile->getRadius()) ; 51 | #endif 52 | return (calcDistance (s) <= Globs.TheCvrStgFile->getRadius()) ; 53 | } 54 | 55 | void SampleValue::print (unsigned short spc) const 56 | { 57 | char* space = new char[spc + 1] ; 58 | for (unsigned short i = 0 ; i < spc ; i++) { 59 | space[i] = ' ' ; 60 | } 61 | space[spc] = '\0' ; 62 | std::cerr << space << "SampleValue:" << std::endl ; 63 | std::cerr << space << " Label: " << getLabel() << std::endl ; 64 | std::cerr << space << " Name: " << getName() << std::endl ; 65 | std::cerr << space << " Key(hex): " << std::hex << getKey() << std::dec << std::endl ; 66 | std::cerr << space << " EValue: " << (unsigned int) getEmbeddedValue() << std::endl ; 67 | } 68 | -------------------------------------------------------------------------------- /m4/progtest.m4: -------------------------------------------------------------------------------- 1 | # progtest.m4 serial 2 (gettext-0.10.40) 2 | dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. 3 | dnl This file is free software, distributed under the terms of the GNU 4 | dnl General Public License. As a special exception to the GNU General 5 | dnl Public License, this file may be distributed as part of a program 6 | dnl that contains a configuration script generated by Autoconf, under 7 | dnl the same distribution terms as the rest of that program. 8 | dnl 9 | dnl This file can can be used in projects which are not available under 10 | dnl the GNU General Public License or the GNU Library General Public 11 | dnl License but which still want to provide support for the GNU gettext 12 | dnl functionality. 13 | dnl Please note that the actual code of the GNU gettext library is covered 14 | dnl by the GNU Library General Public License, and the rest of the GNU 15 | dnl gettext package package is covered by the GNU General Public License. 16 | dnl They are *not* in the public domain. 17 | 18 | dnl Authors: 19 | dnl Ulrich Drepper , 1996. 20 | 21 | # Search path for a program which passes the given test. 22 | 23 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, 24 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) 25 | AC_DEFUN([AM_PATH_PROG_WITH_TEST], 26 | [# Extract the first word of "$2", so it can be a program name with args. 27 | set dummy $2; ac_word=[$]2 28 | AC_MSG_CHECKING([for $ac_word]) 29 | AC_CACHE_VAL(ac_cv_path_$1, 30 | [case "[$]$1" in 31 | /*) 32 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. 33 | ;; 34 | *) 35 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" 36 | for ac_dir in ifelse([$5], , $PATH, [$5]); do 37 | test -z "$ac_dir" && ac_dir=. 38 | if test -f $ac_dir/$ac_word; then 39 | if [$3]; then 40 | ac_cv_path_$1="$ac_dir/$ac_word" 41 | break 42 | fi 43 | fi 44 | done 45 | IFS="$ac_save_ifs" 46 | dnl If no 4th arg is given, leave the cache variable unset, 47 | dnl so AC_PATH_PROGS will keep looking. 48 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" 49 | ])dnl 50 | ;; 51 | esac])dnl 52 | $1="$ac_cv_path_$1" 53 | if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then 54 | AC_MSG_RESULT([$]$1) 55 | else 56 | AC_MSG_RESULT(no) 57 | fi 58 | AC_SUBST($1)dnl 59 | ]) 60 | -------------------------------------------------------------------------------- /tests/BmpFileTest.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include 22 | 23 | #include "Graph.h" 24 | 25 | #include "utcommon.h" 26 | #include "BmpFileTest.h" 27 | 28 | BmpFileTest::BmpFileTest (TestSuite* s) 29 | : CvrStgFileTest("BmpFile", s) 30 | { 31 | ADDTESTCATEGORY (BmpFileTest, testSVALCalculation) ; 32 | } 33 | 34 | void BmpFileTest::setup () 35 | { 36 | UnitTest::setup() ; 37 | 38 | Globs.reset() ; 39 | f1 = CvrStgFile::readFile (std::string(DATADIR) + "win3x24_std.bmp") ; 40 | bs1 = new BitString (std::string ("this BitString will be embedded")) ; 41 | s1 = new Selector (bs1->getLength() * f1->getSamplesPerVertex(), std::string ("a passphrase")) ; 42 | g1 = new Graph (f1, *bs1, *s1) ; 43 | gl1 = Globs ; 44 | 45 | Globs.reset() ; 46 | f2 = CvrStgFile::readFile (std::string(DATADIR) + "os21x24_std.bmp") ; 47 | bs2 = new BitString (std::string ("this BitString will be embedded too")) ; 48 | s2 = new Selector (bs2->getLength() * f2->getSamplesPerVertex(), std::string ("another passphrase")) ; 49 | g2 = new Graph (f2, *bs2, *s2) ; 50 | gl2 = Globs ; 51 | } 52 | 53 | void BmpFileTest::cleanup () 54 | { 55 | UnitTest::cleanup() ; 56 | 57 | delete g1 ; delete g2 ; 58 | delete s1 ; delete s2 ; 59 | delete bs1 ; delete bs2 ; 60 | delete f1 ; delete f2 ; 61 | } 62 | 63 | void BmpFileTest::testSVALCalculation () 64 | { 65 | Globs = gl1 ; addTestResult (genericTestSVALCalculation (f1, g1)) ; 66 | Globs = gl2 ; addTestResult (genericTestSVALCalculation (f2, g2)) ; 67 | } 68 | -------------------------------------------------------------------------------- /src/BmpPaletteSampleValue.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "BmpFile.h" 22 | #include "BmpPaletteSampleValue.h" 23 | #include "ColorPalette.h" 24 | 25 | BmpPaletteSampleValue::BmpPaletteSampleValue (unsigned char i) 26 | : BmpSampleValue(), Index(i) 27 | { 28 | const BmpFile* bmpfile = dynamic_cast (Globs.TheCvrStgFile) ; 29 | myassert (bmpfile) ; 30 | Palette = bmpfile->getPalette() ; 31 | Key = ((unsigned long) getIndex() << 24) | ((unsigned long) getRed() << 16) | 32 | ((unsigned long) getGreen() << 8) | ((unsigned long) getBlue()) ; 33 | EValue = calcEValue(getIndex()) ; 34 | } 35 | 36 | SampleValue* BmpPaletteSampleValue::getNearestTargetSampleValue (EmbValue t) const 37 | { 38 | BmpPaletteSampleValue* sv_mindist = NULL ; 39 | UWORD32 mindist = UWORD32_MAX ; 40 | for (unsigned int i = 0 ; i < Palette->getSize() ; i++) { 41 | if (calcEValue(i) == t) { 42 | BmpPaletteSampleValue* destsv = new BmpPaletteSampleValue (i) ; 43 | UWORD32 curdist = calcDistance (destsv) ; 44 | if (curdist < mindist) { 45 | delete sv_mindist ; 46 | sv_mindist = destsv ; 47 | mindist = curdist ; 48 | } 49 | else { 50 | delete destsv ; 51 | } 52 | } 53 | } 54 | myassert (sv_mindist != NULL) ; 55 | return ((SampleValue*) sv_mindist) ; 56 | } 57 | 58 | std::string BmpPaletteSampleValue::getName () const 59 | { 60 | char buf[128] ; 61 | sprintf (buf, "i%ur%ug%ub%u", getIndex(), getRed(), getGreen(), getBlue()) ; 62 | return std::string (buf) ; 63 | } 64 | -------------------------------------------------------------------------------- /tests/EdgeIteratorTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_EDGEITERATORTEST_H 22 | #define SH_EDGEITERATORTEST_H 23 | 24 | #include "BitString.h" 25 | #include "CvrStgFile.h" 26 | #define private public 27 | #define protected public 28 | #include "Graph.h" 29 | #undef protected 30 | #undef private 31 | #include "EdgeIterator.h" 32 | #include "Selector.h" 33 | 34 | #include "UnitTest.h" 35 | #include "TestSuite.h" 36 | 37 | class EdgeIteratorTest : public UnitTest { 38 | public: 39 | EdgeIteratorTest (TestSuite* s) ; 40 | 41 | void setup (void) ; 42 | void cleanup (void) ; 43 | 44 | void testReferenceIteration (void) ; 45 | void testIterationLength (void) ; 46 | 47 | private: 48 | BitString *bs1, *bs2 ; 49 | CvrStgFile *f1, *f2 ; 50 | Selector *s1, *s2 ; 51 | Graph *g1, *g2 ; 52 | Globals gl1, gl2 ; 53 | 54 | BitString *bs10, *bs11, *bs12 ; 55 | CvrStgFile *f10, *f11, *f12 ; 56 | Selector *s10, *s11, *s12 ; 57 | Graph *g10, *g11, *g12 ; 58 | Globals gl10, gl11, gl12 ; 59 | 60 | bool genericTestGraphIteration (Graph* g, EdgeIterator::ITERATIONMODE m) ; 61 | 62 | /** 63 | * check if an edge iterator for srcvertex with m iterates exactly through edges 64 | **/ 65 | bool genericTestVertexIteration (Vertex* srcvertex, EdgeIterator::ITERATIONMODE m, const std::vector& edges) ; 66 | 67 | /** 68 | * for all vertices in the graph test if getDegree() returns exactly the number of edges EdgeIterator iterates through 69 | **/ 70 | bool genericTestIterationLength (Graph* g) ; 71 | } ; 72 | 73 | #endif // ndef SH_EDGEITERATORTEST_H 74 | -------------------------------------------------------------------------------- /src/ProgressOutput.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_PROGRESSOUTPUT_H 22 | #define SH_PROGRESSOUTPUT_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | /** 29 | * \class ProgressOutput 30 | * \brief prints the progress to stdout 31 | **/ 32 | class ProgressOutput { 33 | public: 34 | /** 35 | * create an empty ProgressOutput object 36 | **/ 37 | ProgressOutput (void) ; 38 | 39 | /** 40 | * create a ProgressOutput object 41 | * \param m the message to be displayed 42 | **/ 43 | ProgressOutput (const std::string& m) ; 44 | 45 | void setMessage (const std::string& m) 46 | { Message = m ; } ; 47 | 48 | void setMessage (const char *msgfmt, ...) ; 49 | 50 | /** 51 | * update the output (taking update frequency into account) with rate as percentage 52 | **/ 53 | void update (float rate) ; 54 | 55 | /** 56 | * update the output appending "done" and a newline (no rate nor average weight) 57 | **/ 58 | void done (void) const ; 59 | 60 | /** 61 | * update the output appending rate, [average edge weight], "done" and a newline 62 | * \param rate the rate of matched vertices 63 | * \param avgweight the average edge weight (is not printed if not given) 64 | **/ 65 | void done (float rate, float avgweight = NoAvgWeight) const ; 66 | 67 | static constexpr float NoAvgWeight = -1.0 ; 68 | 69 | protected: 70 | std::string vcompose (const char *msgfmt, va_list ap) const ; 71 | 72 | private: 73 | std::string Message ; 74 | time_t LastUpdate ; 75 | } ; 76 | 77 | #endif // ndef SH_PROGRESSOUTPUT_H 78 | -------------------------------------------------------------------------------- /src/EncryptionMode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_ENCMODE_H 22 | #define SH_ENCMODE_H 23 | 24 | #include 25 | 26 | class EncryptionMode { 27 | public: 28 | /// number of bits needed to code the mode 29 | static const unsigned int IRep_size = 3 ; 30 | 31 | /// integer representation of encryption mode 32 | enum IRep { 33 | ECB = 0, 34 | CBC = 1, 35 | OFB = 2, 36 | CFB = 3, 37 | NOFB = 4, 38 | NCFB = 5, 39 | CTR = 6, 40 | STREAM = 7 41 | } ; 42 | 43 | /** 44 | * construct a new EncryptionMode object setting Value to ECB 45 | **/ 46 | EncryptionMode (void) ; 47 | EncryptionMode (IRep irep) ; 48 | /** 49 | * construct a new EncryptionMode object from a std::string representation 50 | * \param srep a valid(!) std::string representation 51 | **/ 52 | EncryptionMode (std::string srep) ; 53 | 54 | void setValue (IRep irep) ; 55 | 56 | std::string getStringRep (void) const ; 57 | IRep getIntegerRep (void) const ; 58 | 59 | bool operator== (const EncryptionMode& mode) const 60 | { return (Value == mode.Value) ; } ; 61 | 62 | static bool isValidStringRep (std::string srep) ; 63 | static bool isValidIntegerRep (unsigned int irep) ; 64 | 65 | static std::string translate (IRep irep) ; 66 | static IRep translate (std::string srep) ; 67 | 68 | private: 69 | static const unsigned int NumValues = 8 ; 70 | IRep Value ; 71 | 72 | typedef struct struct_Translation { 73 | IRep irep ; 74 | char* srep ; 75 | } Translation ; 76 | static const Translation Translations[] ; 77 | } ; 78 | 79 | #endif // ndef SH_ENCMODE_H 80 | -------------------------------------------------------------------------------- /src/DMDConstructionHeuristic.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include "DMDConstructionHeuristic.h" 22 | #include "Edge.h" 23 | #include "Graph.h" 24 | #include "Matching.h" 25 | #include "Vertex.h" 26 | 27 | DMDConstructionHeuristic::DMDConstructionHeuristic (Graph* g, Matching* m, float goal) 28 | : MatchingAlgorithm (g, m, goal) 29 | { 30 | AvailableVertices = std::vector (g->getNumVertices()) ; 31 | for (VertexLabel l = 0 ; l < g->getNumVertices() ; l++) { 32 | AvailableVertices[l] = g->getVertex(l) ; 33 | } 34 | } 35 | 36 | void DMDConstructionHeuristic::run (void) 37 | { 38 | VertexLabel mdi = MinDegNotFound ; 39 | while ((mdi = findMinDegIndex (AvailableVertices)) != MinDegNotFound) { 40 | Vertex* v1 = AvailableVertices[mdi] ; 41 | v1->updateShortestEdge() ; 42 | Edge* e = v1->getShortestEdge() ; 43 | Vertex* v2 = e->getOtherVertex(v1) ; 44 | 45 | TheMatching->addEdge(*e) ; 46 | 47 | v1->markDeleted() ; 48 | v2->markDeleted() ; 49 | AvailableVertices[v1->getLabel()] = NULL ; 50 | AvailableVertices[v2->getLabel()] = NULL ; 51 | } 52 | 53 | TheGraph->unmarkDeletedAllVertices() ; 54 | } 55 | 56 | VertexLabel DMDConstructionHeuristic::findMinDegIndex (const std::vector& vertices) 57 | { 58 | VertexLabel mdi = MinDegNotFound ; 59 | UWORD32 mindeg = UWORD32_MAX ; 60 | for (VertexLabel l = 0 ; l < vertices.size() ; l++) { 61 | if (vertices[l] != NULL) { 62 | UWORD32 curdeg = vertices[l]->getDegree() ; 63 | if (0 < curdeg && curdeg < mindeg) { 64 | mdi = l ; 65 | mindeg = curdeg ; 66 | } 67 | } 68 | } 69 | return mdi ; 70 | } 71 | -------------------------------------------------------------------------------- /src/RandomSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #ifndef SH_RANDOMSOURCE_H 22 | #define SH_RANDOMSOURCE_H 23 | 24 | #include 25 | #include 26 | 27 | class BitString ; 28 | 29 | /** 30 | * \class RandomSource 31 | * \brief objects of this class are used as a source of random (non reproduceable) data 32 | **/ 33 | class RandomSource { 34 | public: 35 | RandomSource (void) ; 36 | ~RandomSource (void) ; 37 | 38 | /** 39 | * get a random byte 40 | * \return a random byte 41 | **/ 42 | BYTE getByte (void) ; 43 | 44 | /** 45 | * get n random bytes 46 | * \param n the number of requested random bytes 47 | * \return n random bytes 48 | **/ 49 | std::vector getBytes (unsigned int n) ; 50 | 51 | /** 52 | * get n random bits 53 | * \param n the number of requested random bits 54 | * \return a BitString containing n random bits 55 | **/ 56 | BitString getBits (unsigned int n) ; 57 | 58 | /** 59 | * get a boolean value 60 | * \return true of false with equal probability 61 | **/ 62 | bool getBool (void) ; 63 | 64 | /** 65 | * get a random value 66 | * \param n the range of the random value to be returned 67 | * \return a random number in {0,...,n-1} 68 | **/ 69 | unsigned long getValue (unsigned long n) ; 70 | 71 | private: 72 | unsigned int RandomBytePos ; 73 | BYTE RandomByte ; 74 | /** 75 | * determines the random input - is either opened file pointer to 76 | * /dev/urandom or NULL (the rand() function is then used as random source) 77 | **/ 78 | FILE *RandomInput ; 79 | } ; 80 | 81 | #endif // ndef SH_RANDOMSOURCE_H 82 | -------------------------------------------------------------------------------- /src/Terminal.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include 22 | 23 | #include "common.h" 24 | #include "error.h" 25 | #include "Terminal.h" 26 | 27 | #ifdef HAVE_TERMIOS_H 28 | Terminal::Terminal () 29 | { 30 | if ((tcgetattr (STDIN_FILENO, &InitAttr)) != 0) { 31 | throw SteghideError (_("could not get terminal attributes.")) ; 32 | } 33 | } 34 | 35 | void Terminal::EchoOff () 36 | { 37 | struct termios curattr ; 38 | if ((tcgetattr (STDIN_FILENO, &curattr)) != 0) { 39 | throw SteghideError (_("could not get terminal attributes.")) ; 40 | } 41 | 42 | curattr.c_lflag &= ~ECHO ; 43 | 44 | if ((tcsetattr (STDIN_FILENO, TCSAFLUSH, &curattr)) != 0) { 45 | throw SteghideError (_("could not set terminal attributes.")) ; 46 | } 47 | } 48 | 49 | void Terminal::SingleKeyOn () 50 | { 51 | struct termios curattr ; 52 | if ((tcgetattr (STDIN_FILENO, &curattr)) != 0) { 53 | throw SteghideError (_("could not get terminal attributes.")) ; 54 | } 55 | 56 | curattr.c_lflag &= ~ICANON ; 57 | curattr.c_cc[VTIME] = 0 ; 58 | curattr.c_cc[VMIN] = 1 ; 59 | 60 | if ((tcsetattr (STDIN_FILENO, TCSAFLUSH, &curattr)) != 0) { 61 | throw SteghideError (_("could not set terminal attributes.")) ; 62 | } 63 | } 64 | 65 | void Terminal::reset () 66 | { 67 | if ((tcsetattr (STDIN_FILENO, TCSANOW, &InitAttr)) != 0) { 68 | throw SteghideError (_("could not set terminal attributes.")) ; 69 | } 70 | } 71 | #else 72 | // TODO - do something that makes more sense - especially on Windows systems 73 | Terminal::Terminal() {} 74 | void Terminal::EchoOff() {} 75 | void Terminal::SingleKeyOn() {} 76 | void Terminal::reset() {} 77 | #endif // def HAVE_TERMIOS_H 78 | -------------------------------------------------------------------------------- /src/ProgressOutput.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * steghide 0.5.1 - a steganography program 3 | * Copyright (C) 1999-2003 Stefan Hetzl 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | * 19 | */ 20 | 21 | #include 22 | 23 | #include "ProgressOutput.h" 24 | #include "common.h" 25 | 26 | ProgressOutput::ProgressOutput () 27 | : Message("__nomessage__") 28 | { 29 | LastUpdate = time(NULL) - 1 ; // -1 to ensure that message is written first time 30 | } 31 | 32 | ProgressOutput::ProgressOutput (const std::string& m) 33 | : Message(m) 34 | { 35 | LastUpdate = time(NULL) - 1 ; // -1 to ensure that message is written first time 36 | } 37 | 38 | void ProgressOutput::setMessage (const char *msgfmt, ...) 39 | { 40 | va_list ap ; 41 | va_start (ap, msgfmt) ; 42 | setMessage (vcompose (msgfmt, ap)) ; 43 | va_end (ap) ; 44 | } 45 | 46 | std::string ProgressOutput::vcompose (const char *msgfmt, va_list ap) const 47 | { 48 | char *str = new char[200] ; 49 | vsnprintf (str, 200, msgfmt, ap) ; 50 | std::string retval (str) ; 51 | delete[] str ; 52 | return retval ; 53 | } 54 | 55 | void ProgressOutput::update (float rate) 56 | { 57 | time_t now = time(NULL) ; 58 | if (LastUpdate < now) { 59 | LastUpdate = now ; 60 | printf ("\r%s %.1f%%", Message.c_str(), 100.0 * rate) ; 61 | fflush (stdout) ; 62 | } 63 | } 64 | 65 | void ProgressOutput::done (float rate, float avgweight) const 66 | { 67 | printf ("\r%s %.1f%%", Message.c_str(), 100.0 * rate) ; 68 | if (avgweight != NoAvgWeight) { 69 | printf (" (%.1f)", avgweight) ; 70 | } 71 | printf (_(" done")) ; 72 | printf (" \n") ; // be sure to overwrite old line (even in a language with one-letter done) 73 | fflush (stdout) ; 74 | } 75 | 76 | void ProgressOutput::done () const 77 | { 78 | printf ("\r%s", Message.c_str()) ; 79 | printf (_(" done\n")) ; 80 | } 81 | --------------------------------------------------------------------------------