Files
dbtool/cipher.h
2015-05-14 18:34:10 +02:00

78 lines
1.8 KiB
C++

/*
* 'dbtool' is a simple but powerful commandline interface to the
* GNU gdbm system (or, alternatively the Berkeley DB), useful for
* shellscripts which needs a database for data storage.
*/
/*
*
* This file is part of the DBTOOL program.
*
* By accessing this software, DBTOOL, you are duly informed
* of and agree to be bound by the conditions described below
* in this notice:
*
* This software product, DBTOOL, is developed by T.v. Dein
* and copyrighted (C) 2001-2015 by T.v. Dein, with all
* rights reserved.
*
* There is no charge for DBTOOL software. You can redistribute
* it and/or modify it under the terms of the GNU General Public
* License, which is incorporated by reference herein.
*
* DBTOOL is distributed WITHOUT ANY WARRANTY, IMPLIED OR EXPRESS,
* OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE or that
* the use of it will not infringe on any third party's intellec-
* tual property rights.
*
* You should have received a copy of the GNU General Public
* License along with DBTOOL. Copies can also be obtained from:
*
* http://www.gnu.org/licenses/gpl.txt
*
* or by writing to:
*
* Free Software Foundation, Inc.
* 59 Temple Place, Suite 330
* Boston, MA 02111-1307
* USA
*
* Or contact:
*
* "T.v. Dein" <tlinden@cpan.org>
*
*
*/
#ifndef CIPHER_H
#define CIPHER_H
#include <string>
#include <iostream>
#include <sstream>
#include "rijndael.h"
#include "digest.h"
using namespace std;
class cipher {
private:
Rijndael rijn;
MD5Digest dig;
unsigned char key[32];
string blah;
const char* error(int num);
public:
cipher() {};
~cipher() {};
void init(const string & phrase);
string encrypt(const string& source);
string decrypt(const string& source);
};
string get_my_phrase();
#endif