removing object file
[mnenc] / main.cpp
1 //      main.cpp
2 //      
3 //      Copyright 2010 Micke Nordin <mickewiki@gmail.com>
4 //      
5 //      This program is free software; you can redistribute it and/or modify
6 //      it under the terms of the GNU General Public License as published by
7 //      the Free Software Foundation; either version 3 of the License, or
8 //      (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., 51 Franklin Street, Fifth Floor, Boston,
18 //      MA 02110-1301, USA.
19
20
21
22 #include "mnenc.hpp"
23 #include "password.hpp"
24
25 int main(int argc, char** argv)
26 {
27         mnenc menc = mnenc();
28         if(argc == 1) {
29                 menc.genkey("MittMaster lösenord0092992££$$€");
30                 std::cout << "Genererar key från hårdkodad lösenord\n";
31         } else {
32                 menc.genkey(argv[1]);
33                 std::cout << "Genererar key från medskickat lösenord\n";
34
35         }
36         std::string dec ="HarTestarJag LITE0123456789]][[[++++099";
37         std::string key = menc.get_key();
38         std::string enc = menc.encrypt(key, dec);
39         password pw = password(enc, dec, key);
40         pw.to_string();
41         pw.to_file("Passwdtest.txt");
42         pw.from_file("Passwdtest.txt"),
43         pw.to_string();
44         return 0;
45 }