[Botan-devel] Caching derived keys

Magnus Therning magnus at therning.org
Fri Feb 13 17:27:37 EST 2009


I understand it's all right to send usage questions to this list despite
it being called -devel :-)

I've been playing with botan, hoping to replace my use of python-crypto
in a python app I've written.  I only need very simply encrypt/decrypt
and my class currently looks like this:

  class Crypto {
      public:
          Crypto(std::string pwd);
          ~Crypto();

          boost::python::tuple encrypt(std::string pt);
          std::string decrypt(std::string salt, std::string ct);
  };

At first I attempted to cache the derived key, but ran into
memory/instance ownership issues.  The botan API seems to like passing
ownership with arguments and to clean up on method exit.  That made
caching difficult so I now derive the key on each call to
encrypt/decrypt.  Is there something obvious that I've missed, is it
actually really simple to "pre-derive" the key?

/M

P.S.  I'm not subscribed to the list, so please CC me on any replies.

-- 
Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org          Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe

Haskell is an even 'redder' pill than Lisp or Scheme.
     -- PaulPotts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20090213/fdea6c36/attachment.asc>


More information about the botan-devel mailing list