Quote:
Mmmmmm that's my problem really, 'cos at the moment my constructor is doing loads of stuff by deriving the keys for me. Trouble is, I can't think of a better place to put that key derivation code. If I put it in a seperate member function, I'd have to remember to call that function before I could use my encryptor object. At the moment, I just create an encryptor object, and the subkeys are there ready to use.
I suppose there's an argument for it being in the constructor; to intialise the keys. If you want to break things down, you could split the classes. Have a encryptor object that contains a key object, and call the key methods from your constructor. You could also expose some of these key methods through your encryptor object, if it was necessary to modify the key after it had been created.