This application generates strong passwords using cryptographic hashes. The initial version uses
MD5 checksums.
add_subdirectory(libs)
add_subdirectory(main)
add_subdirectory(plugins)
+add_subdirectory(apps)
--- /dev/null
+add_subdirectory(PswGen)
--- /dev/null
+set(eVaf_INCLUDE ${eVaf_INCLUDE} ${CMAKE_SOURCE_DIR}/src/apps/PswGen)
+
+add_subdirectory(GUI)
+add_subdirectory(Generator)
+#add_subdirectory(Storage)
--- /dev/null
+# Name of the target
+set(TARGET PswGui)
+
+# Qt modules
+include(${QT_USE_FILE})
+
+# Needed for exporting/importing symbols
+add_definitions(-DPSWGEN_GUI_LIBRARY)
+
+# Include files
+include_directories(${eVaf_INCLUDE})
+
+# Required eVaf libraries
+set(eVaf_LIBRARIES CommonLib PluginsLib SdiWindow PswGen)
+
+# Source files
+set(SRCS
+ gui.cpp
+)
+
+# Header files for the meta-object compiler
+set(MOC_HDRS
+ gui.h
+)
+
+# Version info resource file for Windows builds
+if(WIN32)
+ set(SRCS ${SRCS} version.rc)
+endif(WIN32)
+
+qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
+
+add_library(${TARGET} SHARED ${SRCS} ${MOC_SRCS})
+
+target_link_libraries(${TARGET} ${QT_LIBRARIES} ${eVaf_LIBRARIES})
+
+install(TARGETS ${TARGET} DESTINATION bin)
--- /dev/null
+/**
+ * @file PswGen/GUI/gui.cpp
+ * @brief GUI for the PswGen application
+ * @author Enar Vaikene
+ *
+ * Copyright (c) 2011 Enar Vaikene
+ *
+ * This file is part of the eVaf C++ cross-platform application development framework.
+ *
+ * This file can be used under the terms of the GNU General Public License
+ * version 3.0 as published by the Free Software Foundation and appearing in
+ * the file LICENSE included in the packaging of this file. Please review the
+ * the following information to ensure the GNU General Public License version
+ * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * Alternatively, this file may be used in accordance with the Commercial License
+ * Agreement provided with the Software.
+ */
+
+#include "gui.h"
+#include "version.h"
+
+#include "Generator/iGenerator"
+
+#include <Common/Globals>
+#include <Common/iLogger>
+#include <Common/iRegistry>
+#include <SdiWindow/iSdiWindow>
+
+#include <QtGui>
+
+
+using namespace eVaf;
+
+VER_EXPORT_VERSION_INFO()
+Q_EXPORT_PLUGIN2(VER_MODULE_NAME_STR, PswGen::GUI::Module)
+
+
+//-------------------------------------------------------------------
+
+using namespace eVaf::PswGen::GUI;
+
+Module::Module()
+ : Plugins::iPlugin()
+ , mReady(false)
+ , mGenerator(0)
+{
+ setObjectName(QString("%1.%2").arg(VER_MODULE_NAME_STR).arg(__FUNCTION__));
+
+ EVAF_INFO("%s created", qPrintable(objectName()));
+}
+
+Module::~Module()
+{
+ EVAF_INFO("%s destroyed", qPrintable(objectName()));
+}
+
+bool Module::init(QString const & args)
+{
+ Q_UNUSED(args);
+
+ // Get the iGenerator interface
+ EVAF_TEST_X((mGenerator = evafQueryInterface<PswGen::iGenerator>("iGenerator")), "No iGenerator interface");
+
+ // Get the main window interface and fill it with the widgets
+ SdiWindow::iSdiWindow * win = evafQueryInterface<SdiWindow::iSdiWindow>("iSdiWindow");
+ EVAF_TEST_X(win, "No iSdiWindow interface");
+
+ QVBoxLayout * v = new QVBoxLayout;
+ win->widget()->setLayout(v);
+
+ QGridLayout * g = new QGridLayout;
+ v->addLayout(g);
+ g->setColumnStretch(2, 2);
+
+ QLabel * l = new QLabel(tr("Web site or application &name:", VER_MODULE_NAME_STR));
+ l->setAlignment(Qt::AlignRight);
+ g->addWidget(l, 0, 0);
+
+ wName = new QLineEdit;
+ l->setBuddy(wName);
+ connect(wName, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString)));
+ g->addWidget(wName, 0, 1, 1, 2);
+ win->widget()->setFocusProxy(wName);
+
+ l = new QLabel(tr("Master &password:", VER_MODULE_NAME_STR));
+ l->setAlignment(Qt::AlignRight);
+ g->addWidget(l, 1, 0);
+
+ wMasterPassword = new QLineEdit;
+ l->setBuddy(wMasterPassword);
+ connect(wMasterPassword, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString)));
+ wMasterPassword->setEchoMode(QLineEdit::Password);
+ g->addWidget(wMasterPassword, 1, 1, 1, 2);
+
+ l = new QLabel(tr("&Length of the password:", VER_MODULE_NAME_STR));
+ l->setAlignment(Qt::AlignRight);
+ g->addWidget(l, 2, 0);
+
+ wLength = new QSpinBox;
+ l->setBuddy(wLength);
+ wLength->setRange(0, mGenerator->maxLength());
+ wLength->setValue(PswGen::iGenerator::DEFAULT_LENGTH);
+ wLength->setSpecialValueText(tr("Maximum", VER_MODULE_NAME_STR));
+ g->addWidget(wLength, 2, 1);
+
+ l = new QLabel(tr("Password:"));
+ l->setAlignment(Qt::AlignRight);
+ g->addWidget(l, 3, 0);
+
+ wPassword = new QLineEdit;
+ wPassword->setReadOnly(true);
+ g->addWidget(wPassword, 3, 1, 1, 2);
+
+ v->addStretch();
+
+ QHBoxLayout * h = new QHBoxLayout;
+ h->addStretch();
+ v->addLayout(h);
+
+ wGenerate = new QPushButton(tr("&Generate", VER_MODULE_NAME_STR));
+ wGenerate->setDisabled(true);
+ wGenerate->setDefault(true);
+ connect(wGenerate, SIGNAL(clicked()), this, SLOT(generateClicked()));
+ h->addWidget(wGenerate);
+
+ wCopy = new QPushButton(tr("&Copy to Clipboard", VER_MODULE_NAME_STR));
+ wCopy->setDisabled(true);
+ connect(wCopy, SIGNAL(clicked()), this, SLOT(copyClicked()));
+ h->addWidget(wCopy);
+
+ QAction * a = new QAction(win->widget());
+ a->setShortcut(Qt::Key_Return);
+ connect(a, SIGNAL(triggered()), this, SLOT(generateClicked()));
+ win->widget()->addAction(a);
+
+ a = new QAction(win->widget());
+ a->setShortcut(Qt::Key_Escape);
+ connect(a, SIGNAL(triggered()), qApp, SLOT(quit()));
+ win->widget()->addAction(a);
+
+ mReady = true;
+
+ EVAF_INFO("%s initialized", qPrintable(objectName()));
+
+ return true;
+}
+
+void Module::done()
+{
+ mReady = false;
+
+ EVAF_INFO("%s finalized", qPrintable(objectName()));
+}
+
+void Module::textChanged(QString const &)
+{
+ wGenerate->setDisabled(wMasterPassword->text().isEmpty() || wName->text().isEmpty());
+}
+
+void Module::generateClicked()
+{
+ if (wMasterPassword->text().isEmpty() || wName->text().isEmpty())
+ return;
+ wPassword->setText(mGenerator->generatePassword(wName->text().toLatin1().constData(), wMasterPassword->text().toLatin1().constData(), wLength->value()));
+ wCopy->setEnabled(true);
+}
+
+void Module::copyClicked()
+{
+ QClipboard * clipboard = QApplication::clipboard();
+ if (clipboard)
+ clipboard->setText(wPassword->text());
+}
--- /dev/null
+/**
+ * @file PswGen/GUI/gui.h
+ * @brief GUI for the PswGen application
+ * @author Enar Vaikene
+ *
+ * Copyright (c) 2011 Enar Vaikene
+ *
+ * This file is part of the eVaf C++ cross-platform application development framework.
+ *
+ * This file can be used under the terms of the GNU General Public License
+ * version 3.0 as published by the Free Software Foundation and appearing in
+ * the file LICENSE included in the packaging of this file. Please review the
+ * the following information to ensure the GNU General Public License version
+ * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * Alternatively, this file may be used in accordance with the Commercial License
+ * Agreement provided with the Software.
+ */
+
+#ifndef __PSWGEN_GUI_GUI_H
+#define __PSWGEN_GUI_GUI_H
+
+#include <Plugins/iPlugin>
+
+#include <QObject>
+#include <QString>
+
+class QLineEdit;
+class QSpinBox;
+class QPushButton;
+
+namespace eVaf {
+namespace PswGen {
+ class iGenerator;
+namespace GUI {
+
+/**
+ * Graphical User Interface for the PswGen application.
+ *
+ * This module adds a GUI window to the pswGen application using the SdiWindow module.
+ */
+class Module : public Plugins::iPlugin
+{
+ Q_OBJECT
+
+public:
+
+ Module();
+
+ virtual ~Module();
+
+ virtual bool init(const QString & args);
+
+ virtual void done();
+
+ virtual bool isReady() const { return mReady; }
+
+
+private slots:
+
+ /// Master password or name changed
+ void textChanged(QString const &);
+
+ /// 'Generate' button clicked
+ void generateClicked();
+
+ /// 'Copy' button clicked
+ void copyClicked();
+
+
+private: // Members
+
+ /// Flag indicating that the module is ready
+ bool mReady;
+
+ /// The iGenerator interface
+ eVaf::PswGen::iGenerator * mGenerator;
+
+ /// Widgets on the screen
+ QLineEdit * wName;
+ QLineEdit * wMasterPassword;
+ QSpinBox * wLength;
+ QLineEdit * wPassword;
+ QPushButton * wGenerate;
+ QPushButton * wCopy;
+
+};
+
+} // namespace eVaf::PswGen::GUI
+} // namespace eVaf::PswGen
+} // namespace eVaf
+
+#endif // gui.h
--- /dev/null
+/**
+ * @file PswGen/GUI/lib.h
+ * @author Enar Vaikene
+ *
+ * Copyright (c) 2011 Enar Vaikene
+ *
+ * This file is part of the eVaf C++ cross-platform application development framework.
+ *
+ * This file can be used under the terms of the GNU General Public License
+ * version 3.0 as published by the Free Software Foundation and appearing in
+ * the file LICENSE included in the packaging of this file. Please review the
+ * the following information to ensure the GNU General Public License version
+ * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * Alternatively, this file may be used in accordance with the Commercial License
+ * Agreement provided with the Software.
+ */
+
+#ifndef __PSWGEN_GUI_LIB_H
+# define __PSWGEN_GUI_LIB_H
+
+#include <QtCore/qglobal.h>
+
+#if defined(PSWGEN_GUI_LIBRARY)
+# define PSWGEN_GUI_EXPORT Q_DECL_EXPORT
+#else
+# define PSWGEN_GUI_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // lib.h
--- /dev/null
+/**
+ * @file PswGen/GUI/version.h
+ * @brief Version information for eVaf modules
+ * @author Enar Vaikene
+ *
+ * Copyright (c) 2011 Enar Vaikene
+ *
+ * This file is part of the eVaf C++ cross-platform application development framework.
+ *
+ * This file can be used under the terms of the GNU General Public License
+ * version 3.0 as published by the Free Software Foundation and appearing in
+ * the file LICENSE included in the packaging of this file. Please review the
+ * the following information to ensure the GNU General Public License version
+ * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * Alternatively, this file may be used in accordance with the Commercial License
+ * Agreement provided with the Software.
+ */
+
+#ifndef __PSWGEN_GUI_VERSION_H
+#define __PSWGEN_GUI_VERSION_H
+
+#include <version_rc.h>
+
+/**
+ * Module/library version number in the form major,minor,release,build
+ */
+#define VER_FILE_VERSION 0,1,1,1
+
+/**
+ * Module/library version number in the string format (shall end with \0)
+ */
+#define VER_FILE_VERSION_STR "0.1.1.1\0"
+
+/**
+ * Module/library name (shall end with \0)
+ */
+#define VER_MODULE_NAME_STR "pswGui\0"
+
+/**
+ * Module type (see version_rc.h for all the types)
+ */
+#define VER_MODULE_TYPE MT_GENERIC
+
+/**
+ * Module type in the string format (see version_rc for all the types)
+ */
+#define VER_MODULE_TYPE_STR MT_GENERIC
+
+/**
+ * Original file name for windows (shall end with \0)
+ */
+#define VER_ORIGINAL_FILE_NAME_STR "pswGui.dll\0"
+
+/**
+ * Description of the module/library (shall end with \0)
+ */
+#define VER_FILE_DESCRIPTION_STR "User interface for the PswGen application.\0"
+
+#endif // version.h
--- /dev/null
+/**
+ * @file PswGen/GUI/version.rc
+ * @brief Windows resource file with module/library version information.
+ * @author Enar Vaikene
+ *
+ * Copyright (c) 2011 Enar Vaikene
+ *
+ * This file is part of the eVaf C++ cross-platform application development framework.
+ *
+ * This file can be used under the terms of the GNU General Public License
+ * version 3.0 as published by the Free Software Foundation and appearing in
+ * the file LICENSE included in the packaging of this file. Please review the
+ * the following information to ensure the GNU General Public License version
+ * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * Alternatively, this file may be used in accordance with the Commercial License
+ * Agreement provided with the Software.
+ */
+
+#include "version.h"
+#include <version_rc.h>
+#include <winver.h>
+
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION VER_FILE_VERSION
+ PRODUCTVERSION VER_PRODUCT_VERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0x0L
+ BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "CompanyName", VER_COMPANY_NAME_STR
+ VALUE "FileDescription", VER_FILE_DESCRIPTION_STR
+ VALUE "FileVersion", VER_FILE_VERSION_STR
+ VALUE "LegalCopyright", VER_LEGAL_COPYRIGHT_STR
+ VALUE "OriginalFilename", VER_ORIGINAL_FILE_NAME_STR
+ VALUE "ProductName", VER_PRODUCT_NAME_STR
+ VALUE "ProductVersion", VER_PRODUCT_VERSION_STR
+ VALUE "Build Date", VER_PRODUCT_DATE_STR
+ VALUE "Module Name", VER_MODULE_NAME_STR
+ VALUE "Module Type", VER_MODULE_TYPE_STR
+ END
+ END
+ END
--- /dev/null
+# Name of the target
+set(TARGET PswGen)
+
+# Qt modules
+set(QT_DONT_USE_QTGUI TRUE)
+include(${QT_USE_FILE})
+
+# Needed for exporting/importing symbols
+add_definitions(-DPSWGEN_GENERATOR_LIBRARY)
+
+# Include files
+include_directories(${eVaf_INCLUDE})
+
+# Required eVaf libraries
+set(eVaf_LIBRARIES CommonLib PluginsLib)
+
+# Source files
+set(SRCS
+ generator.cpp
+)
+
+# Header files for the meta-object compiler
+set(MOC_HDRS
+ igenerator.h
+ generator.h
+)
+
+# Version info resource file for Windows builds
+if(WIN32)
+ set(SRCS ${SRCS} version.rc)
+endif(WIN32)
+
+qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
+
+add_library(${TARGET} SHARED ${SRCS} ${MOC_SRCS})
+
+target_link_libraries(${TARGET} ${QT_LIBRARIES} ${eVaf_LIBRARIES})
+
+install(TARGETS ${TARGET} DESTINATION bin)
--- /dev/null
+/**
+ * @file PswGen/Generator/generator.cpp
+ * @brief Implementation of the iGenerator interface
+ * @author Enar Vaikene
+ *
+ * Copyright (c) 2011 Enar Vaikene
+ *
+ * This file is part of the eVaf C++ cross-platform application development framework.
+ *
+ * This file can be used under the terms of the GNU General Public License
+ * version 3.0 as published by the Free Software Foundation and appearing in
+ * the file LICENSE included in the packaging of this file. Please review the
+ * the following information to ensure the GNU General Public License version
+ * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * Alternatively, this file may be used in accordance with the Commercial License
+ * Agreement provided with the Software.
+ */
+
+#include "generator.h"
+#include "version.h"
+
+#include <Common/iLogger>
+#include <Common/iRegistry>
+
+#include <QtCore>
+
+using namespace eVaf;
+using namespace evaf::PswGen;
+using namespace eVaf::PswGen::Generator;
+
+//-------------------------------------------------------------------
+
+Generator::Generator()
+ : Plugins::iPlugin()
+ , mReady(false)
+{
+ setObjectName(QString("%1.%2").arg(VER_MODULE_NAME_STR).arg(__FUNCTION__));
+
+ mGenerator = new Internal::GeneratorImpl;
+
+ EVAF_INFO("%s created", qPrintable(objectName()));
+}
+
+Generator::~Generator()
+{
+ delete mGenerator;
+
+ EVAF_INFO("%s destroyed", qPrintable(objectName()));
+}
+
+bool Generator::init(const QString & args)
+{
+ Q_UNUSED(args);
+
+ if (!mGenerator->init())
+ return false;
+
+ mReady = true;
+
+ EVAF_INFO("%s initialized", qPrintable(objectName()));
+
+ return true;
+}
+
+void Generator::done()
+{
+ mReady = false;
+
+ mGenerator->done();
+
+ EVAF_INFO("%s finalized", qPrintable(objectName()));
+}
+
+
+//-------------------------------------------------------------------
+
+using namespace eVaf::PswGen::Generator::Internal;
+
+GeneratorImpl::GeneratorImpl()
+ : iGenerator()
+{
+ setObjectName(QString("%1.iGenerator").arg(VER_MODULE_NAME_STR));
+
+ Common::iRegistry::instance()->registerInterface("iGenerator", this);
+
+ EVAF_INFO("%s created", qPrintable(objectName()));
+}
+
+GeneratorImpl::~GeneratorImpl()
+{
+ EVAF_INFO("%s destroyed", qPrintable(objectName()));
+}
+
+bool GeneratorImpl::init()
+{
+ EVAF_INFO("%s initialized", qPrintable(objectName()));
+
+ return true;
+}
+
+void GeneratorImpl::done()
+{
+ EVAF_INFO("%s finalized", qPrintable(objectName()));
+}
+
+QString GeneratorImpl::generatePassword(char const * const name, char const * const masterPassword, int length, uint flags)
+{
+ QByteArray inputString = QString("%1%2").arg(name).arg(masterPassword).toLatin1();
+ QCryptographicHash hash(QCryptographicHash::Md5);
+ hash.addData(inputString);
+ QByteArray result = hash.result().toBase64();
+ if (length > 0)
+ return result.left(length);
+ else
+ return result;
+}
+
+
+//-------------------------------------------------------------------
+
+VER_EXPORT_VERSION_INFO()
+Q_EXPORT_PLUGIN2(VER_MODULE_NAME_STR, Generator)
--- /dev/null
+/**
+ * @file PswGen/Generator/generator.h
+ * @brief Implementation of the iGenerator interface
+ * @author Enar Vaikene
+ *
+ * Copyright (c) 2011 Enar Vaikene
+ *
+ * This file is part of the eVaf C++ cross-platform application development framework.
+ *
+ * This file can be used under the terms of the GNU General Public License
+ * version 3.0 as published by the Free Software Foundation and appearing in
+ * the file LICENSE included in the packaging of this file. Please review the
+ * the following information to ensure the GNU General Public License version
+ * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * Alternatively, this file may be used in accordance with the Commercial License
+ * Agreement provided with the Software.
+ */
+
+#ifndef __PSWGEN_GENERATOR_GENERATOR_H
+# define __PSWGEN_GENERATOR_GENERATOR_H
+
+#include "igenerator.h"
+
+#include <Plugins/iPlugin>
+
+#include <QObject>
+
+namespace eVaf {
+namespace PswGen {
+
+/// Module that generates strong passwords using cryptographic methods
+namespace Generator {
+
+/// Internal implementation of the Generator module
+namespace Internal {
+
+/**
+ * iGenerator interface implementation.
+ *
+ * Implements the iGenerator interface using MD5 cryptographic hashes.
+ */
+
+class GeneratorImpl : public iGenerator
+{
+ Q_OBJECT
+
+public:
+
+ GeneratorImpl();
+
+ virtual ~GeneratorImpl();
+
+ bool init();
+
+ void done();
+
+ virtual QString generatePassword(char const * const name, char const * const masterPassword, int length = iGenerator::DEFAULT_LENGTH, uint flags = 0);
+
+ virtual int maxLength() const { return 24; }
+
+};
+
+} // namespace eVaf::PswGen::Generator::Internal
+
+/**
+ * Module implementing the iGenerator interface.
+ */
+class Generator : public Plugins::iPlugin
+{
+ Q_OBJECT
+
+public:
+
+ Generator();
+
+ virtual ~Generator();
+
+ virtual bool init(const QString & args);
+
+ virtual void done();
+
+ virtual bool isReady() const { return mReady; }
+
+
+private: // Members
+
+ /// Flag indicating that the module is ready
+ bool mReady;
+
+ /// iGenerator interface instance
+ Internal::GeneratorImpl * mGenerator;
+
+};
+
+
+} // namespace eVaf::PswGen::Generator
+} // namespace eVaf::PswGen
+} // namespace eVaf
+
+#endif // generator.h
--- /dev/null
+#include "igenerator.h"
--- /dev/null
+/**
+ * @file PswGen/Generator/igenerator.h
+ * @brief Interface for password generator modules
+ * @author Enar Vaikene
+ *
+ * Copyright (c) 2011 Enar Vaikene
+ *
+ * This file is part of the eVaf C++ cross-platform application development framework.
+ *
+ * This file can be used under the terms of the GNU General Public License
+ * version 3.0 as published by the Free Software Foundation and appearing in
+ * the file LICENSE included in the packaging of this file. Please review the
+ * the following information to ensure the GNU General Public License version
+ * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * Alternatively, this file may be used in accordance with the Commercial License
+ * Agreement provided with the Software.
+ */
+
+#ifndef __PSWGEN_GENERATOR_IGENERATOR_H
+# define __PSWGEN_GENERATOR_IGENERATOR_H
+
+#include "lib.h"
+
+#include <QObject>
+
+namespace eVaf {
+namespace PswGen {
+
+/**
+ * Password generator interface.
+ *
+ * This interface is used to generate strong passwords.
+ */
+class PSWGEN_GENERATOR_EXPORT iGenerator : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ /// Interface constructor
+ iGenerator() {}
+
+ /// Empty virtual destructor
+ virtual ~iGenerator() {}
+
+ /**
+ * Flags for the password generator.
+ */
+ enum {
+ ALPHANUMERIC = 0x01 ///< Generated password contains only alphanumeric characters
+ };
+
+ /**
+ * Default length of the generated password
+ */
+ enum {
+ DEFAULT_LENGTH = 16
+ };
+
+ /**
+ * Generates a strong password
+ * @param name Name of the password
+ * @param masterPassword Master password
+ * @param length Length of the password
+ * @param flags Flags for the generator
+ * @return Generated password
+ *
+ * This function generates a strong password using the name and the master password string
+ * as inputs. Calling this function with the same input always returns the same generated
+ * password.
+ *
+ * The length of the password is specified with the length argument. However, the generated password
+ * is never longer than possible with the particular cryptographic method.
+ *
+ * Optional flags can be used to fine-tune the generator.
+ */
+ virtual QString generatePassword(char const * const name, char const * const masterPassword, int length = DEFAULT_LENGTH, uint flags = 0) = 0;
+
+ /**
+ * Returns the maximum length of generated passwords
+ * @return Maximum length
+ *
+ * This function returns the maximum length of generated passwords that is possible with the cryptographic method
+ * used by the module implementing this interface.
+ */
+ virtual int maxLength() const = 0;
+
+};
+
+} // namespace eVaf::PswGen
+} // namespace eVaf
+
+#endif // igenerator.h
--- /dev/null
+/**
+ * @file PswGen/Generator/lib.h
+ * @author Enar Vaikene
+ *
+ * Copyright (c) 2011 Enar Vaikene
+ *
+ * This file is part of the eVaf C++ cross-platform application development framework.
+ *
+ * This file can be used under the terms of the GNU General Public License
+ * version 3.0 as published by the Free Software Foundation and appearing in
+ * the file LICENSE included in the packaging of this file. Please review the
+ * the following information to ensure the GNU General Public License version
+ * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * Alternatively, this file may be used in accordance with the Commercial License
+ * Agreement provided with the Software.
+ */
+
+#ifndef __PSWGEN_GENERATOR_LIB_H
+# define __PSWGEN_GENERATOR_LIB_H
+
+#include <QtCore/qglobal.h>
+
+#if defined(PSWGEN_GENERATOR_LIBRARY)
+# define PSWGEN_GENERATOR_EXPORT Q_DECL_EXPORT
+#else
+# define PSWGEN_GENERATOR_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // libgen.h
--- /dev/null
+/**
+ * @file PswGen/Generator/version.h
+ * @brief Version information for eVaf modules
+ * @author Enar Vaikene
+ *
+ * Copyright (c) 2011 Enar Vaikene
+ *
+ * This file is part of the eVaf C++ cross-platform application development framework.
+ *
+ * This file can be used under the terms of the GNU General Public License
+ * version 3.0 as published by the Free Software Foundation and appearing in
+ * the file LICENSE included in the packaging of this file. Please review the
+ * the following information to ensure the GNU General Public License version
+ * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * Alternatively, this file may be used in accordance with the Commercial License
+ * Agreement provided with the Software.
+ */
+
+#ifndef __PSWGEN_GENERATOR_VERSION_H
+#define __PSWGEN_GENERATOR_VERSION_H
+
+#include <version_rc.h>
+
+/**
+ * Module/library version number in the form major,minor,release,build
+ */
+#define VER_FILE_VERSION 0,1,1,1
+
+/**
+ * Module/library version number in the string format (shall end with \0)
+ */
+#define VER_FILE_VERSION_STR "0.1.1.1\0"
+
+/**
+ * Module/library name (shall end with \0)
+ */
+#define VER_MODULE_NAME_STR "PswGen\0"
+
+/**
+ * Module type (see version_rc.h for all the types)
+ */
+#define VER_MODULE_TYPE MT_GENERIC
+
+/**
+ * Module type in the string format (see version_rc for all the types)
+ */
+#define VER_MODULE_TYPE_STR MT_GENERIC
+
+/**
+ * Original file name for windows (shall end with \0)
+ */
+#define VER_ORIGINAL_FILE_NAME_STR "PswGen.dll\0"
+
+/**
+ * Description of the module/library (shall end with \0)
+ */
+#define VER_FILE_DESCRIPTION_STR "Module that generates strong passwords using MD5 hashes.\0"
+
+#endif // version.h
--- /dev/null
+/**
+ * @file PswGen/Generator/version.rc
+ * @brief Windows resource file with module/library version information.
+ * @author Enar Vaikene
+ *
+ * Copyright (c) 2011 Enar Vaikene
+ *
+ * This file is part of the eVaf C++ cross-platform application development framework.
+ *
+ * This file can be used under the terms of the GNU General Public License
+ * version 3.0 as published by the Free Software Foundation and appearing in
+ * the file LICENSE included in the packaging of this file. Please review the
+ * the following information to ensure the GNU General Public License version
+ * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+ *
+ * Alternatively, this file may be used in accordance with the Commercial License
+ * Agreement provided with the Software.
+ */
+
+#include "version.h"
+#include <version_rc.h>
+#include <winver.h>
+
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION VER_FILE_VERSION
+ PRODUCTVERSION VER_PRODUCT_VERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0x0L
+ BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "CompanyName", VER_COMPANY_NAME_STR
+ VALUE "FileDescription", VER_FILE_DESCRIPTION_STR
+ VALUE "FileVersion", VER_FILE_VERSION_STR
+ VALUE "LegalCopyright", VER_LEGAL_COPYRIGHT_STR
+ VALUE "OriginalFilename", VER_ORIGINAL_FILE_NAME_STR
+ VALUE "ProductName", VER_PRODUCT_NAME_STR
+ VALUE "ProductVersion", VER_PRODUCT_VERSION_STR
+ VALUE "Build Date", VER_PRODUCT_DATE_STR
+ VALUE "Module Name", VER_MODULE_NAME_STR
+ VALUE "Module Type", VER_MODULE_TYPE_STR
+ END
+ END
+ END
--- /dev/null
+A sample eVaf application that generates strong passwords.
+Copyright © 2011 Enar Väikene
+
+This application generates and optionally stores passwords. The application consists
+of 3 modules:
+1) The GUI module - allows the user to generate and store passwords.
+2) The GENERATOR module - generates strong passwords in such a way that given the same input,
+ the generated password is always the same.
+3) The STORAGE module - stores generated passwords in a secure way.
+
+The application is split into modules to make it easier to replace them with ones having stronger security.
+