proj home

Files   Classes   Functions   Hierarchy  

rsaE Class Reference

RSA Encryption. More...

#include <rsa.h>

Collaboration diagram for rsaE:

List of all members.

Public Member Functions

void operator() (string &c, string const &m) const
 Encrypt a message string.

Public Attributes

ZZ n
 Public product p*q.
ZZ e
 Public exponent.


Detailed Description

RSA Encryption.

The product n is public but not its factors. Choose e to be large, do not use a small e.

This class encrypts a message string of digits to another string of digits.

Definition at line 23 of file rsa.h.


Member Function Documentation

void rsaE::operator() ( string &  c,
string const &  m 
) const

Encrypt a message string.

m is a string of digits.

Definition at line 14 of file rsa.cpp.

References e, and n.

00015 {
00016   ZZ m2;
00017   conv(m2,m.c_str());
00018 
00019   ZZ c2;
00020   PowerMod(c2,m2,e,n);
00021 
00022   stringstream ss;
00023   ss << c2;
00024   c = ss.str();
00025 }


Member Data Documentation

ZZ rsaE::e

Public exponent.

Definition at line 30 of file rsa.h.

Referenced by operator()(), and rsatest::unittest02().

ZZ rsaE::n

Public product p*q.

Definition at line 28 of file rsa.h.

Referenced by operator()(), and rsatest::unittest02().


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:50:16 2011 for Chelton Evans Source by  doxygen 1.5.8