You didn't fully initialize your RSA key, such as by adding the private or public parts. It shouldn't crash, but then again this is like doing an fprintf() without first checking if the fopen() succeeded. -- Senior Architect, Akamai Technologies IM: richsalz at jabber.at Twitter: RichSalz