Technique:Identifying cryptographic libraries
| On this wiki | Facts · Code · Notes · Topics |
|---|
How to tell which crypto library (OpenSSL, LibreSSL, BoringSSL, Mbed TLS, wolfSSL, libsodium, Crypto++, Windows CNG) and which version a binary uses, from version strings, error texts, name prefixes and exports.
Method
- Search strings for version banners and error texts; they separate libraries fastest. 2. Look at export or import names (prefixes). 3. If nothing is left (stripped static link), fall back to constants: Technique:Identifying cryptographic constants. A library only appears in the first two steps if it is linked with its text; check several indicators.
Table
| Library | Version string / macro | Name prefix | Error text style |
|---|---|---|---|
| Library:OpenSSL | "OpenSSL x.y.z date" (OPENSSL_VERSION_TEXT) | EVP_, SSL_, BIO_, ERR_ |
error:0A000086:SSL routines:...
|
| Library:LibreSSL | "LibreSSL x.y.z"; OPENSSL_VERSION_NUMBER pinned to 0x20000000 | same as OpenSSL plus tls_* |
OpenSSL-style |
| Library:BoringSSL | exactly "BoringSSL"; fake 0x1010107f | same as OpenSSL | ...:OPENSSL_internal:...
|
| Library:Mbed TLS | "Mbed TLS x.y.z" (MBEDTLS_VERSION_STRING_FULL) | mbedtls_, psa_ |
"SSL - The connection indicated an EOF", codes -0x6900 style |
| Library:WolfSSL | "5.9.4" (LIBWOLFSSL_VERSION_STRING) | wolfSSL_, wc_ |
plain sentences, codes -125, -173 |
| Library:Libsodium | sodium_version_string() |
crypto_, sodium_, randombytes_ |
none (return -1) |
| Library:Crypto++ | CRYPTOPP_VERSION 890 (8.9.0) via LibraryVersion() |
namespace CryptoPP in RTTI |
C++ exceptions |
| Library:Windows CNG | none (OS DLL) | BCrypt*, NCrypt* imports |
NTSTATUS |
Each row is detailed on its page with source evidence.
Telling OpenSSL forks apart
All three share function names. Check the version text first: "OpenSSL" versus "LibreSSL" versus "BoringSSL"; then OPENSSL_VERSION_NUMBER values left in code (0x1010107f BoringSSL, 0x20000000 LibreSSL). AWS-LC (aws/aws-lc commit f3e723d851ec034216c4a3c273c3ad5644249946) names itself, but behind an OpenSSL prefix: include/openssl/crypto.h line 127 defines OPENSSL_VERSION_TEXT as "OpenSSL 1.1.1 (compatible; AWS-LC " + AWSLC_VERSION_NUMBER_STRING + ")" ("5.11.0" in base.h line 68), so a plain search for "OpenSSL 1.1.1" misclassifies it; search for "AWS-LC" too.
Pitfalls
- Several libraries can be linked at once (curl backends, game engines); identify every hit.
- Library choice in the application is often hidden by a wrapper; constants may then name algorithms, not the library.