#ifndef RSASTATE_H
#define RSASTATE_H

#include <cassert>
#include <string>
using namespace std;

#include <print.h>

/*!
\brief  RSA implementation, driven through the command line.

Files can be encrypted and decrypted with any length keys.
*/
class rsastate
{
  void displaymessage() const;

  /** The public exponent. */
  string e;
  /** The public p*q. */
  string n;
  /** The private factor p. */
  string p;
  /** The private factor q. */
  string q;
  /** The name of the file being read and written too. */
  string file;

  /** The block size. */
  uint blocksize;
  /** The number of bits or bitlength. */
  uint nbits;

  /** Attempt to encrypt a file based on the clients input. */
  void encrypt();
  /** Attempt to decrypt a file based on the clients input. */
  void decrypt();
  /** Generate a nbit key. */
  void generate();
  /** Generate a key from the client supplied p and q. */
  void generate2();
public:

  /** The command line is interpreted and executed on client input.*/
  rsastate(int argc, char**argv);
};


#endif


