[openssl-users] Encryption length, OpenSSL_add_all_algorithms, and OpenSSL_add_all_ciphers questions

Philip Bellino pbellino at mrv.com
Thu Mar 26 14:53:03 UTC 2015


I am using OpenSSL-1.0.2a EVP routines to encrypt and decrypt passwords
with cipher des_ede3_cbc as follows:

encrypt routines:
EVP_CIPHER_CTX_init
EVP_EncryptInit_ex
EVP_EncryptUpdate
EVP_EncryptFinal_ex
EVP_CIPHER_CTX_cleanup

decrypt routines:
EVP_CIPHER_CTX_init
EVP_DecryptInit_ex
EVP_DecryptUpdate
EVP_DecryptFinal_ex
EVP_CIPHER_CTX_cleanup

similar to examples found here:
http://www.openssl.org/docs/crypto/EVP_CIPHER_CTX_init.html#EXAMPLES

Passwords are encrypted and stored when created, and decrypted
at a later time to compare against the password
given upon login. None of the examples show determining the length
of the encrypted information via an EVP call in order to pass
that information to the decryption routines. Should I assume it
is incumbent upon the coder to store the encrypted length when
storing the encrypted password, for retrieval later? Or is the encrypted
length put into the encrypted information so an EVP call is available to
retrieve it? I believe from all the information I see that it is the former.

Please confirm this for me.

Also, is calling OpenSSL_add_all_algorithms (or OpenSSL_add_all_ciphers)
and the corresponding EVP_cleanup call necessary for each encrypt and
decrypt? My encryption and decryption seem to be working without calling
those routines but after seeing them used (for examples in test/evp_test.c), I don't understand why.

Any insight that can be shared would be most appreciated.
Thank you.

Phil Bellino
Principal Software Engineer | MRV Communications Inc.
300 Apollo Drive |  Chelmsford, MA 01824
Phone: 978-674-6870  |   Fax: 978-674-6799
www.mrv.com


[MRV-email]


[E-Banner]<http://www.mrv.com/landing/video-datasheet-mrvs-optidriver-platform>


The contents of this message, together with any attachments, are intended only for the use of the person(s) to whom they are addressed and may contain confidential and/or privileged information. If you are not the intended recipient, immediately advise the sender, delete this message and any attachments and note that any distribution, or copying of this message, or any attachment, is prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20150326/3673f4e7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 6563 bytes
Desc: image001.png
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20150326/3673f4e7/attachment-0001.png>


More information about the openssl-users mailing list