Commit 32e639d2 authored by Jan Möbius's avatar Jan Möbius

More for keygen

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6663 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ff5b7b77
#include <qapplication.h>
#include <QtGui>
#include <QFile>
#include <iostream>
#include "salt.hh"
int main(int argc, char **argv)
{
QFile bla();
QApplication a( argc, argv );
if (argc == 2) {
std::cerr << " Call ./keygen <InfoFile> <Output Key File>" << std::endl;
exit(1);
}
QFile file(argv[1]);
if (!file.open(QIODevice::ReadOnly|QIODevice::Text))
std::cerr << "Unable to open file " << std::endl;
QString name = file.readLine();
QString coreHash = file.readLine();
QString pluginHash = file.readLine();
QString macHash = file.readLine();
std::cerr << "Generating key for Plugin : " << name.toStdString() << std::endl;
QString saltPre;
ADD_SALT_PRE(saltPre);
QString saltPost;
ADD_SALT_POST(saltPost);
QString keyClear = coreHash + saltPre + pluginHash + saltPost + macHash;
QString keyHash = QCryptographicHash::hash ( keyClear.toAscii() , QCryptographicHash::Sha1 ).toHex();
std::cerr << "key is: " << keyHash.toStdString() << std::endl;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment