Choosing a portable encryption library

I am developing a utility that, among other things, encrypts data using a phrase provided by the user. I don’t have much experience writing good and portable code, so I try to learn how to do it well. What is the best library used to perform hashing and encryption functions?

To clarify, I'm not looking for a library with better functionality, I'm looking for a library that is available on most operating systems and is usually installed on many. I know that I will not look for the default library installed on most operating systems, but I would like to choose the one that provides the easiest installation for most users.

I looked at the vanilla installations of Windows 7 (Cygwin), Mac OS X 10.8, Debian 6.0.5 and Ubuntu 12.04.1 LTS, and the only thing they all have is crypt , which, as I understand it, is not recommended because for using a weak encryption algorithm with a limited key size.

I am currently considering using libmcrypt and mhash , as they are available through aptitude on both Debian and Ubuntu (and from what I can tell most other Linux distributions), you can install it on Mac OS X via MacPorts or Homebrew, and are available in the Cygwin installer for Windows. They are also available for FreeBSD, OpenBSD and NetBSD.

I am very grateful for the help in choosing the best library to use, and also indicate other factors that I may not have considered.

+4
source share

Source: https://habr.com/ru/post/1447452/


All Articles