Implementing RSA in C++ I am implementing RSA algorithm in C++ and here's my design(code structure).

keygen.h

namespace rsa{
    class keygen{
        public:
        //Constructor
        keygen(size);
        //Generate keys
        void generate();
        //Getters
        char* gete(){ return xyz; }
        .. 
        ..
        ..

        private:
        //initializes bignums
        void initall();
        //Private Member variables goes here
   }
}


prime.h

namespace rsa{
    //First 100 primes
    unsigned int primes[]={2,3,5,7,11.....541};

    //MillarRabin Primality
    bool isPrime(mpz_t, unsigned short);
    //Get Random Prime
    void getPrime(mpz_t, mpz_t)
}


endec.h

namespace rsa{
    //Encryption
    const char* encryption(const char* text, const char* n, const char* e);
    //Decryption
    const char* decryption(const char* cipher, const char* n, const char* d);
}


Is this a good design? How can I make it better? I want to improve the structure or the overall design, that's why dint post any code. Things like naming standards, using classes wherever applicable, standard function signature and similar is what I'm looking for.
Just a couple of short comments as a starting point.

First of all, you don't need separate encrypt and decrypt functions -- the algorithm is identical for both. You just pass different parameters for them.

Second, I wouldn't use char const * for the input or output of the encrypt/decrypt function. It might be barely allowable for the plaintext (since you could restrict that to not contain zero bytes) but is definitely not acceptable as the encrypted data (since you can't stop it from containing zero bytes). Since, however, the same function can do either encryption or decryption, you don't want to use char const * for input or output. Personally, I'd probably have it take iterators for the input and output, so you can work with string, vector&lt;char&gt;, vector&lt;wchar_t&gt;, etc.

Finally, I don't think I'd put implementation details like the first 100 primes directly in the rsa namespace -- I'd have rsa contain a detail namespace to contain details like that. I'm not sure I'd have keygen either -- I think I'd make key a class, probably with the default ctor deleted, and a static member function to create a key, and overloading operator&gt;&gt; and operator&lt;&lt; to serialize keys in a standard format (e.g., X.509, PKCS #8). About all that would be visible to the outside world would be key and crypt (or whatever you decide to call the combined encrypt/decrypt funct(ion|or).

Edit: the key class and signatures would be something like this:

class key { 
    key() = delete; // `=delete;` is C++11 only; without that just declare private
public:
    static key create_key();
};