On Mon, Sep 02, 2002, Gerardo Mendez wrote: > > Hi there, > > I recently installed ssl 3.2.0 under Solaris 5.8 and works fine. > But I noticed something weird and I don't know if this is normal. > > I issued the following commands: > > openssl dgst -md5 /etc/passwd > $HOME/md5_file > openssl rsautl -encrypt -inkey $HOME/my_key.pem -in $HOME/md5_file -out > $HOME/rsa_file > openssl base64 -A -in $HOME/rsa_file -out $HOME/rsa_base64 > > and the file rsa_base64 has the 172 printable chars. If I issue the three > above commands, the > content of the rsa_base64 is not the same as the first one generated. And > so on. > > Is something missed on configuration or what to avoid this. Maybe I have a > wrong idea about how > this works. If the source (md5) is the same, and the key is the same, the > encryption should be > the same whenever I issue the commands. > > Please, let me know about this. >
If you used the -sign option instead of -encrypt the contents would be the same each time. When encrypting using RSA and PKCS#1 padding some random bytes are prepended to the supplied data. This is to avoid certain attacks. So each time you encrypt you get different random bytes and the result is different. Steve. -- Dr. Stephen Henson [EMAIL PROTECTED] OpenSSL Project http://www.openssl.org/~steve/ ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]