[Botan-devel] Botan: Key issues

Bala Narasimhan balasn at gmail.com
Tue Apr 14 01:34:34 EDT 2009

I am using Botan for a project I am working on. A process, say P1, can
encrypt a buffer by generating a SymmetricKey. I store away the string
representation of this SymmetricKey as obtained from as_string().

Now another process, say P2, takes this saved away string, creates a
SymmetricKey with it and then tries to decrypt the buffer.

Sometimes, I notice that the key generated by P2 is not the same as that
used by P1 and so the decrypt operation doesnt do the correct thing. I
validate this by doing an assert (k1 == k2) where k1 is the key generated by
P1 and k2 is the key generated by P2.

Why does this not work? Shouldnt the string representation gaurantee that
the key P2 generates the exact same one that P1 used?

- Bala
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20090413/2ceab3f2/attachment.html>

More information about the botan-devel mailing list