MCryptPP.h
Go to the documentation of this file.
/*
* steghide 0.5.1 - a steganography program
* Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#include "common.h"
#ifdef USE_LIBMCRYPT
#ifndef SH_MCRYPTPP_H
#define SH_MCRYPTPP_H
#include <string>
#include <mcrypt.h>
class BitString ;
class EncryptionAlgorithm ;
class EncryptionMode ;
#ifdef WIN32
#define MCRYPTPP_LIBDIR "./modules/"
#else
#define MCRYPTPP_LIBDIR NULL
#endif
class MCryptPP {
public:
MCryptPP (void) ;
MCryptPP (EncryptionAlgorithm a, EncryptionMode m) ;
~MCryptPP (void) ;
void open (EncryptionAlgorithm a, EncryptionMode m) ;
void close (void) ;
BitString encrypt (BitString p, std::string pp) ;
BitString decrypt (BitString c, std::string pp) ;
EncryptionAlgorithm getAlgorithm (void) const ;
EncryptionMode getMode (void) const ;
static unsigned long getEncryptedSize (EncryptionAlgorithm a, EncryptionMode m, unsigned long plnsize) ;
static std::vector<std::string> getListModes (void) ;
static std::vector<std::string> getListAlgorithms (void) ;
static bool AlgoSupportsMode (EncryptionAlgorithm a, EncryptionMode m) ;
protected:
void *createKey (std::string pp) ;
std::vector<BYTE> _encrypt (std::vector<unsigned char> p, std::string pp) ;
std::vector<BYTE> _decrypt (std::vector<unsigned char> c, std::string pp) ;
private:
bool ModuleOpen ;
MCRYPT MCryptD ;
void *s_malloc (size_t size) ;
} ;
#endif // ndef SH_MCRYPTPP_H
#endif // def USE_LIBMCRYPT
EncryptionAlgorithm
Definition: EncryptionAlgorithm.h:26
EncryptionMode
Definition: EncryptionMode.h:26
BitString
a string of bits
Definition: BitString.h:42
common.h