SourceForge Logo
Main Page   Compound List   File List   Compound Members   File Members  

FPMEncryptionManager.h

Go to the documentation of this file.
00001 /*!
00002  * \file FPMEncryptionManager.h
00003  * \brief C++ implementation of the FPM encryption functions taken from 
00004  *   the FPM's files fpm_crypt.c/h
00005  *
00006  * \author Frederic RUAUDEL <grumz@users.sf.net>
00007  *
00008  * $Revision: 1.1 $
00009  * $Date: 2003/03/07 10:55:42 $
00010  *
00011  * \b FPMBlowfishPlugin
00012  * Copyleft (c) 2003 Frederic RUAUDEL, all rights reversed
00013  *
00014  * This program is free software which I release under the GNU General Public
00015  * License. You may redistribute and/or modify this program under the terms
00016  * of that license as published by the Free Software Foundation; either
00017  * version 2 of the License, or (at your option) any later version.
00018  *
00019  * This program is distributed in the hope that it will be useful,
00020  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  * GNU General Public License for more details.  Version 2 is in the
00023  * COPYING file in the top level directory of this distribution.
00024  *
00025  * To get a copy of the GNU General Public License, write to the Free Software
00026  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027  **/
00028 
00029 #ifndef FPM_ENCRYPTION_MANAGER_H
00030 #define FPM_ENCRYPTION_MANAGER_H
00031 
00032 #include <iostream>
00033 #include <string>
00034 
00035 #include <Blowfish.h>
00036 #include <MD5.h>
00037 
00038 using namespace std;
00039 
00040 class FPMEncryptionManager
00041 {
00042         public:
00043                 FPMEncryptionManager (string password, string salt);
00044                 ~FPMEncryptionManager ();
00045 
00046                 bool decrypt_field (string& plaintext, string cipher_field);
00047                 
00048                 static void hex_to_bin (byte* out, string in, int len);
00049         private:
00050                 bool unrotate (char* field, int len);
00051                 
00052                 Blowfish _blowfish_context;
00053                 string _password;
00054                 string _salt;
00055 };
00056 /*
00057 void fpm_crypt_init(gchar* password);
00058 
00059 int (*fpm_setkey) (void *c, byte *key, unsigned keylen );
00060 
00061 
00062 gchar* get_new_salt(void);
00063 
00064 void
00065 fpm_decrypt_field(      void* context,
00066                         gchar* plaintext,
00067                         gchar* cipher_field,
00068                         gint len);
00069 void
00070 fpm_encrypt_field(      void* context,
00071                         gchar* cipher_field,
00072                         gchar* plaintext,
00073                         gint len);
00074 
00075 gchar*
00076 fpm_encrypt_field_var(  void* context,
00077                         gchar* plaintext);
00078 
00079 gchar*
00080 fpm_decrypt_field_var(  void* context,
00081                         gchar* cipher_field);
00082 
00083 
00084 void fpm_decrypt_all(void);
00085 */
00086 #endif /* FPM_ENCRYPTION_MANAGER_H */

Generated on Sun Mar 9 11:13:59 2003 for FPMBlowfishPlugin by doxygen1.2.15