CryptoLyzer: A comprehensive cryptographic settings analyzer
Tags: tutorial, python, security, opensource
Published: 2022-01-19 07:18:57

**CryptoLyzer is a multiprotocol cryptographic settings analyzer with SSL/TLS, SSH, and HTTP header analysis ability. The main purpose of the tool is to tell you what kind of cryptographic related settings are enabled on a client or server.**

If you are not interested in the principles behind the project, but the practice, feel free to skip the next section and jump to the Practice section.


# Principles


## Rationale

There are many notable open-source projects ([SSLyze](https://github.com/nabla-c0d3/sslyze), [CipherScan](https://github.com/mozilla/cipherscan), [testssl.sh](https://testssl.sh/), [tls-scan](https://github.com/prbinu/tls-scan), …) and several SaaS solutions ([CryptCheck](https://tls.imirhil.fr/), [CypherCraft](https://www.cyphercraft.io/), [Hardenize](https://hardenize.com), [ImmuniWeb](https://www.immuniweb.com/ssl/), [Mozilla Observatory](https://observatory.mozilla.org/), [SSL Labs](https://www.ssllabs.com/), …) to do a security setting analysis, especially when we are talking about TLS, which is the most common and popular cryptographic protocol. However, most of these tools heavily depend on one or more versions of one or more cryptographic protocol libraries, like [GnuTLS](https://www.gnutls.org/), [OpenSSL](https://www.openssl.org/), or [wolfSSL](https://www.wolfssl.com/). But why is this such a problem?

The minor problem is the dependency easily stucks them in [SSL](https://en.wikipedia.org/wiki/Transport_Layer_Security#SSL_1.0,_2.0,_and_3.0)/[TLS](https://en.wikipedia.org/wiki/Transport_Layer_Security)/[DTLS](https://en.wikipedia.org/wiki/Datagram_Transport_Layer_Security) as other cryptographic protocols (eg: [IPSec VPN](https://en.wikipedia.org/wiki/IPsec), [Kerberos](https://en.wikipedia.org/wiki/Kerberos_(protocol)), [OpenVPN](https://en.wikipedia.org/wiki/OpenVPN), [SSH](https://en.wikipedia.org/wiki/Secure_Shell_Protocol), …) can not be implemented directly by these libraries. Supporting them by the analyzer application needs extra effort. Anyway, most of the analysis of the cryptographic setting does not require any cryptography because before the parties could agree on the cryptographic algorithms they use plain text.

The major problem is the fact that analysis should test special and corner cases of the protocol that are intentionally triggered. It is hard to do that with a cryptographic protocol library, which was designed for production not for penetration testing or settings analysis. During an analysis, connections are tried to be established with hardly supported, experimental, obsoleted, or even deprecated mechanisms or algorithms to identify which ones are supported by the given client or server implementation. These mechanisms and algorithms may or may not be supported by the latest or any version of any cryptographic protocol implementations.

That is why most of the existing tools require special build(s) of the dependent library where all the protocol versions and algorithms of the good old days are reenabled to make the chance to set up these libraries to offer them as clients or as servers. But what if we want to test an algorithm or a mechanism that has never been implemented by the dependent cryptographic library?

It is not just a theory. A [special fork](https://github.com/PeterMosmans/openssl) of OpenSSL, maintained by Pluralsight author [Peter Mosmans](https://www.pluralsight.com/authors/peter-mosmans), aims to have as many ciphers as possible. This fork is used and recommended by Mozilla Cipherscan, however, it can offer [less than two hundred](https://github.com/PeterMosmans/openssl/blob/1.0.2-chacha/README.md) cipher suites, but there are more than three hundred in the different [RFC](https://en.wikipedia.org/wiki/Request_for_Comments)s according to [Cipher Suite Info](https://ciphersuite.info/cs/?software=all&singlepage=true). The majority of them are weak or insecure, which makes it particularly important to be part of the analysis. In addition, it is also true that there are cipher suites that are not on the Cipher Suite Info list, for instance, Russian standard ([GOST](https://en.wikipedia.org/wiki/GOST)) cipher suites. These are rarely used cipher suites, but there is an [OpenSSL engine](https://github.com/gost-engine/engine) that implements them, so they should be checked.

The situation is similar in the case of other parts of the TLS protocol, like extensions. It is unlikely that a cryptographic library will support each extension, but some of them are possibly implemented by some of the libraries. For instance, [multiple certificate status request extension](https://datatracker.ietf.org/doc/html/rfc6961) and Diffie-Hellman key exchange in TLS 1.3 are not implemented by OpenSSL 1.x but implemented by GnuTLS and WolfSSL. Another example can be the [X.509 certificate-based authentication in SSH](https://datatracker.ietf.org/doc/html/rfc6187) protocol, which is supported by [Tectia SSH](https://www.ssh.com/manuals/server-admin/60/serverauth-cert.html) and has an [open-source implementation](http://roumenpetrov.info/openssh/) but is not supported by the default OpenSSH. Even though they are not so common a comprehensive settings analyzer tool should run checks against them.

Summing up the main reason for establishing a greenfield project instead of contributing to existing one is the opinion, that an analysis is mostly testing when we trigger special and corner cases, hardly supported, experimental, obsoleted, or even deprecated mechanisms and algorithms, so a comprehensive analyzer should be implemented independently from current cryptographic protocol implementations as much as possible.

## Goals

CrypytoLyzer focuses on comprehensiveness, multi-protocol ability, and library independence. To do so cryptographic protocols clients are implemented focusing only on the necessary parts (usually the handshake). This kind of client can check a server against rarely or privately used, deprecated, or completely insecure algorithms and mechanisms. 

* Zero Trust
    * should not require any privilege during the analysis
    * Should not require any credentials (except it is strictly necessary) 
    * should not provide any information for 3rd party
* Completeness
    * should be able to support as many cryptographic protocols (DTLS, IPSec, OpenVPN, TLS, SSL, SSH, …) as possible
    * should be able to handle special/corner cases of the cryptographic protocols
* Usability
    * should work both in public and private networks
    * should be able to give a human-readable summary ([Markdown](https://en.wikipedia.org/wiki/Markdown))
    * should be able to give machine-readable detailed output ([JSON](https://en.wikipedia.org/wiki/JSON))
    * should be customizable to meet special needs (Python [library](https://en.wikipedia.org/wiki/Library_(computing)))

The existing solutions are focusing on only one cryptographic protocol (TLS or SSH) despite the fact, that all the cryptographic protocols have the same building blocks (authentication, key exchange, symmetric ciphers, integrity), so they can be analyzed in the same (or almost the same) way, only the information which the analysis is based on can be acquired differently.

# Features

The goals above are just goals, not the current state of the development, particularly since the actual version number is 0.8.0 at the time of writing. The supported cryptographic protocol families, for now, are the SSL/TLS and SSH. You can read comparative analysis with either open source or proprietary (SaaS) solutions below. I wanted to stay as objective as an author can with the competitors, but forgive me if I have not been managed to.

## Strengths

### Transport Layer Security (TLS)

#### Specialties

Cryptolyzer supports both the early and deprecated [Secure Socket Layer (SSL) 2.0](https://tools.ietf.org/html/draft-hickman-netscape-ssl-00) and each [Transport Layer Security](https://en.wikipedia.org/wiki/Transport_Layer_Security) version up to the [TLS 1.3](https://tools.ietf.org/html/rfc8446) version including draft versions. Some features although be checked hardly or difficultly using the most popular SSL/TLS implementations (eg: GnuTLS, [LibreSSL](https://www.libressl.org/), OpenSSL, wolfSSL, …) or just not in the scope of them. The checks are the specialties of Cryptolyzer such as supporting each cipher suite discussed on [ciphersuite.info](https://ciphersuite.info) (and more) including the Russian governmental standard (GOST) cipher suites, Diffie-Hellman parameter checks, JA3 tag generation, …

<!---
|| **CryptoLyzer** | Qualys SSL Labs | ImmuniWeb | Hardenize | Mozilla Observatory | Testssl.sh | SSLyze |
-->

|| **Crypto Lyzer** | [Qualys SSL Labs](https://www.ssllabs.com/ssltest/) | [Immuni Web](https://www.immuniweb.com/ssl/) | [Hard enize](https://www.hardenize.com/) | [Moz. Obs.](https://observatory.mozilla.org/) | [testssl .sh](https://testssl.sh/) | [SSL-yze](https://github.com/nabla-c0d3/sslyze) |
|:------------------------------------------------------------------------------------------------------------------------|:---------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
| TLS 1.3 Draft Versions                                                                                                  |     ✅    |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |    ✅   |    ❌   |
| [TLS 1.3 DH Parameters](https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.8.1)                                  |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |
| TLS [GOST](https://en.wikipedia.org/wiki/GOST) Ciphers                                                                  |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| TLS DH Param [Prime Check](https://en.wikipedia.org/wiki/Safe_and_Sophie_Germain_primes)                                |     ✅    |    ✅   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| TLS [DHE Param Reuse](https://security.stackexchange.com/questions/225209/what-is-ecdh-public-server-param-reuse) Check |     ✅    |    ✅   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| TLS ECDH Param Reuse Check                                                                                              | **0.9.x** |    ✅   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| SSH DH [Param Check](https://en.wikipedia.org/wiki/Safe_and_Sophie_Germain_primes)                                      |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| [JA3 tag](https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967) Generation              |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| [JA3 tag](https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967) Decode                  |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
|                                                                                                                         |  **89%**  | **33%** |    0%   |   11%   |    0%   |    0%   |   22%   |    0%   |

#### Opportunistic TLS

Several application-layer protocols have an extension to upgrade a plain text connection to an encrypted one (TLS) without using a separate port referred to as [opportunistic TLS](https://en.wikipedia.org/wiki/Opportunistic_TLS) (STARTTLS). This mechanism is supported by the analyzer in the case of most protocols.

<!---
|| **CryptoLyzer** | Qualys SSL Labs | ImmuniWeb | Hardenize | Mozilla Observatory | Testssl.sh | SSLyze |
-->

|| **Crypto Lyzer** | [Qualys SSL Labs](https://www.ssllabs.com/ssltest/) | [Immuni Web](https://www.immuniweb.com/ssl/) | [Hard enize](https://www.hardenize.com/) | [Moz. Obs.](https://observatory.mozilla.org/) | [testssl .sh](https://testssl.sh/) | [SSL-yze](https://github.com/nabla-c0d3/sslyze) |
|:----------------------------------------------------------------------------|:---------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
| [FTP](https://en.wikipedia.org/wiki/File_Transfer_Protocol)                 |     ✅    |    ❌   |    ❌   |    ✅   |    ❌   |    ✅   |    ✅   |
| [IMAP](https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol)      |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ✅   |
| [LDAP](https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol) |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |
| [LMTP](https://en.wikipedia.org/wiki/Local_Mail_Transfer_Protocol)          |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |
| [MySQL](https://en.wikipedia.org/wiki/MySQL)                                | **0.9.x** |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |
| [NNTP](https://en.wikipedia.org/wiki/Network_News_Transfer_Protocol)        |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |
| [POP3](https://en.wikipedia.org/wiki/Post_Office_Protocol)                  |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ✅   |
| [PostgreSQL](https://en.wikipedia.org/wiki/PostgreSQL)                      |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ✅   |
| [RDP](https://en.wikipedia.org/wiki/Remote_Desktop_Protocol)                |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |
| [Sieve](https://en.wikipedia.org/wiki/Sieve_(mail_filtering_language))      |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |
| [SMTP](https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol)         |     ✅    |    ❌   |    ✅   |    ✅   |    ❌   |    ✅   |    ✅   |
| [XMPP (Jabber)](https://en.wikipedia.org/wiki/XMPP)                         |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ✅   |
|                                                                             |  **92%**  |    0%   |    8%   |   17%   |    0%   | **83%** |   67%   |

#### Extensions

There are several extensions for the original TLS specifications which have both security and compatibility considerations. A high number of extension types can be analyzed by CryptoLyzer compared to most of the competitors.

<!---
|| **CryptoLyzer** | Qualys SSL Labs | ImmuniWeb | Hardenize | Mozilla Observatory | Testssl.sh | SSLyze |
-->

|| **Crypto Lyzer** | [Qualys SSL Labs](https://www.ssllabs.com/ssltest/) | [Immuni Web](https://www.immuniweb.com/ssl/) | [Hard enize](https://www.hardenize.com/) | [Moz. Obs.](https://observatory.mozilla.org/) | [testssl .sh](https://testssl.sh/) | [SSL-yze](https://github.com/nabla-c0d3/sslyze) |
|:------------------------------------------------------------------------------------------|:---------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
| [Fallback SCSV](https://datatracker.ietf.org/doc/html/rfc7507)                            |     ✅    |    ✅   |    ✅   |    ❌   |    ❌   |    ✅   |    ✅   |
| [TLS Clock](https://datatracker.ietf.org/doc/html/rfc5246#section-7.4.1.2) Skew           |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ✅   |
| [Compression](https://datatracker.ietf.org/doc/html/rfc3749)                              |     ✅    |    ✅   |    ✅   |    ❌   |    ❌   |    ❌   |    ✅   |
| [Secure Renegotiation](https://datatracker.ietf.org/doc/html/rfc5746)                     |     ✅    |    ✅   |    ✅   |    ❌   |    ❌   |    ✅   |    ✅   |
| Insecure [Renegotiation](https://datatracker.ietf.org/doc/html/rfc5246#section-7.4.1.2)   | **0.8.x** |    ✅   |    ✅   |    ❌   |    ❌   |    ✅   |    ✅   |
| [Session Caching](https://datatracker.ietf.org/doc/html/rfc5246#appendix-F.1.4)           |     ✅    |    ✅   |    ❌   |    ❌   |    ❌   |    ✅   |    ✅   |
| [Session Ticketing](https://datatracker.ietf.org/doc/html/rfc5077)                        |     ✅    |    ✅   |    ❌   |    ❌   |    ❌   |    ✅   |    ✅   |
| [Elliptic Curves](https://www.rfc-editor.org/rfc/rfc4492.html#section-5.1.1)              |     ✅    |    ✅   |    ✅   |    ❌   |    ❌   |    ✅   |    ✅   |
| [EC Point Format](https://www.rfc-editor.org/rfc/rfc4492.html#section-5.1.1)              |     ✅    |    ❌   |    ✅   |    ❌   |    ❌   |    ❌   |    ❌   |
| [App. Layer Proto. Negotiation](https://www.rfc-editor.org/rfc/rfc7301.html)              |     ✅    |    ✅   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |
| [Next Protocol Negotiation](https://tools.ietf.org/id/draft-agl-tls-nextprotoneg-03.html) |     ✅    |    ✅   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |
| [Extended Master Secret](https://datatracker.ietf.org/doc/html/rfc7627)                   |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |
| [Encrypt-then-mac](https://www.rfc-editor.org/rfc/rfc7366.html)                           |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |
| [GREASE check](https://www.rfc-editor.org/rfc/rfc8701.html)                               | **0.9.x** |    ✅   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| [Handshake Length Intolerance](https://security.stackexchange.com/questions/181692/long-handshake-intolerance-ssl-tls-command-line) | **0.9.x** |    ✅   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
|                                                                                           |  **80%**  | **73%** |   40%   |    0%   |    0%   | **73%** |   53%   |

### Secure Shell (SSH)

In addition to TLS, there are some other cryptographic protocols, such as SSH. The cryptographic protocols have the same building blocks (authentication, key exchange, symmetric ciphers, integrity), so they can be analyzed in the same manner and it can be done with the same tool using CryptoLyzer without compromise.

<!---
|| **CryptoLyzer** | Mozilla Observatory | Operous SSH Check | Rebex SSH Check | SSH Configuration Auditor | ssh-audit | ssh_scan |
-->

|| **Crypto Lyzer** | [Moz. Obs.](https://observatory.mozilla.org/) | [Operous SSH Check](https://sshcheck.operous.dev/) | [Rebex SSH Check](https://sshcheck.com/) | [SSH Conf. Auditor](https://www.sshaudit.com/) | [ssh-audit](https://github.com/jtesta/ssh-audit) | [ssh-scan](https://github.com/mozilla/ssh_scan) |
|:-------------------|:---------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
| Algorithms         |     ✅    |    ✅   |    ✅   |    ✅   |    ✅   |    ✅   |    ✅   |
| Host Keys          |     ✅    |    ❌   |    ✅   |    ❌   |    ✅   |    ✅   |    ✅   |
| Host Certificates  | **0.9.x** |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| X.509 Certificates | **0.10.x**|    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| DH Param Check     |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| Banner Analysis    |     ✅    |    ❌   |    ✅   |    ❌   |    ❌   |    ❌   |    ✅   |
|                    |  **67%**  |   17%   |   50%   |   17%   |   33%   |   33%   | **50%** |

### HTTP Headers


#### Security

There are security mechanisms in the application layer too, not only in the transport layer. The HTTP protocol is a good example of that as there are encryption (HSTS), authentication (Expect-CT, Expect-Staple), content integrity (subresource integrity, content security policy) related headers which are parsed by CryptoLyzer in detail.

<!---
|| **CryptoLyzer** | Qualys SSL Labs | ImmuniWeb | Hardenize | Mozilla Observatory | Testssl.sh | SSLyze |
-->

|| **Crypto Lyzer** | [Qualys SSL Labs](https://www.ssllabs.com/ssltest/) | [Immuni Web](https://www.immuniweb.com/ssl/) | [Hard enize](https://www.hardenize.com/) | [Moz. Obs.](https://observatory.mozilla.org/) | [testssl .sh](https://testssl.sh/) | [SSL-yze](https://github.com/nabla-c0d3/sslyze) |
|:----------------------------------------------------------------------------------------------------------------------|:---------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
| [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy)          | **0.9.x** |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |
| [CSP Report-To](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-to)          | **0.9.x** |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| [Expect Certificate Transparency](https://scotthelme.co.uk/a-new-security-header-expect-ct/)                          |     ✅    |    ❌   |    ❌   |    ✅   |    ✅   |    ❌   |    ✅   |
| [Expect OCSP Staple](https://scotthelme.co.uk/designing-a-new-security-header-expect-staple/)                         |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| [HTTP Strict Transport Security](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security) |     ✅    |    ✅   |    ✅   |    ✅   |    ✅   |    ✅   |    ✅   |
| [HTTP Public Key Pinning](https://developer.mozilla.org/en-US/docs/Web/HTTP/Public_Key_Pinning)                       |**0.10.x** |    ✅   |    ❌   |    ❌   |    ✅   |    ✅   |    ❌   |
| [Referrer Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy)                          |     ✅    |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |
| [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)                  | **0.8.x** |    ❌   |    ❌   |    ✅   |    ✅   |    ❌   |    ❌   |
| [X Content Type Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options)            |     ✅    |    ❌   |    ❌   |    ✅   |    ✅   |    ❌   |    ❌   |
| [X Frame Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options)                          |     ✅    |    ❌   |    ❌   |    ✅   |    ✅   |    ❌   |    ❌   |
| [X XSS Protection](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection)                        | **0.8.x** |    ❌   |    ❌   |    ✅   |    ✅   |    ❌   |    ❌   |
|                                                                                                                       |  **55%**  |   18%   |    9%   |   55%   | **82%** |   18%   |   18%   |

#### Generic

Several HTTP headers are not closely related to security. Although, some among them, especially caching headers (Age, Cache-Control, Date, ETag, Expires, Last-Modified), can have significance when obsolescence of security-related information (eg: CRL) is indicated by caching headers.

<!---
|| **CryptoLyzer** | Qualys SSL Labs | ImmuniWeb | Hardenize | Mozilla Observatory | Testssl.sh | SSLyze |
-->

|| **Crypto Lyzer** | [Qualys SSL Labs](https://www.ssllabs.com/ssltest/) | [Immuni Web](https://www.immuniweb.com/ssl/) | [Hard enize](https://www.hardenize.com/) | [Moz. Obs.](https://observatory.mozilla.org/) | [testssl .sh](https://testssl.sh/) | [SSL-yze](https://github.com/nabla-c0d3/sslyze) |
|:-----------------------------------------------------------------------------------------|:---------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
| [Content-Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type)   |     ✅    |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |
| [Server](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server)               |     ✅    |    ❌   |    ❌   |    ❌   |    ✅   |    ✅   |    ❌   |
| Application banner                                                                       | **0.9.x** |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |
| [Age](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age)                     |     ✅    |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |    ❌   |
| [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control) |     ✅    |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |
| [Date](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date)                   |     ✅    |    ❌   |    ❌   |    ❌   |    ✅   |    ✅   |    ❌   |
| [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag)                   |     ✅    |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |
| [Expires](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires)             |     ✅    |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |
| [Last-Modified](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified) |     ✅    |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |
| [Pragma](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Pragma)               |     ✅    |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |
| Proxy banner                                                                             | **0.9.x** |    ❌   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |
| [Set-Cookie](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie)       |**0.10.x** |    ❌   |    ❌   |    ✅   |    ✅   |    ✅   |    ❌   |
|                                                                                          |  **75%**  |    0%   |    0    |    8%   | **75%** |   42%   |    0%   |

## Weaknesses

### Transport Layer Security (TLS)

#### X.509 Extensions

There are some X.509 related mechanisms in TLS that can have a serious impact on security in particular the revocation checking which is a [weak point of the public key infrastructure](https://coroner.medium.com/why-do-certificate-revocation-checking-mechanisms-never-work-f9b7a4ee1a61) (PKI). Cryptolyzer lagging behind competitors in this field.

<!---
|| **CryptoLyzer** | Qualys SSL Labs | ImmuniWeb | Hardenize | Mozilla Observatory | Testssl.sh | SSLyze |
-->

|| **Crypto Lyzer** | [Qualys SSL Labs](https://www.ssllabs.com/ssltest/) | [Immuni Web](https://www.immuniweb.com/ssl/) | [Hard enize](https://www.hardenize.com/) | [Moz. Obs.](https://observatory.mozilla.org/) | [testssl .sh](https://testssl.sh/) | [SSL-yze](https://github.com/nabla-c0d3/sslyze) |
|:----------------------------------------------------------------------------------------------------|:---------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
| [OCSP Stapling](https://datatracker.ietf.org/doc/html/rfc6066#section-8)                            |     ✅    |    ✅   |    ✅   |    ✅   |    ✅   |    ✅   |    ✅   |
| [OCSP Must Staple](https://datatracker.ietf.org/doc/html/rfc7633)                                   | **0.8.x** |    ✅   |    ✅   |    ✅   |    ❌   |    ✅   |    ✅   |
| [Certificate Transparency](https://certificate.transparency.dev/)                                   | **0.8.x** |    ✅   |    ✅   |    ✅   |    ❌   |    ✅   |    ✅   |
| [Multiple Trusted Root CA Stores](https://en.wikipedia.org/wiki/Certificate_authority#Providers)    | **0.9.x** |    ✅   |    ✅   |    ✅   |    ✅   |    ❌   |    ✅   |
| [Revocation Status](https://en.wikipedia.org/wiki/Public_key_infrastructure#Certificate_revocation) |**0.10.x** |    ✅   |    ❌   |    ✅   |    ❌   |    ✅   |    ❌   |
|                                                                                                     |  **20%**  |   100%  |   80%   |   100%  |   40%   | **80%** |   80%   |

### Generic

Usability is another field where Cryptolyzer should evolve. Comprehensiveness is not enough, weaknesses, vulnerabilities should be highlighted to make the analysis results more easily understandable.

<!---
|| **CryptoLyzer** | Qualys SSL Labs | ImmuniWeb | Hardenize | Mozilla Observatory | Testssl.sh | SSLyze |
-->

|| **Crypto Lyzer** | [Qualys SSL Labs](https://www.ssllabs.com/ssltest/) | [Immuni Web](https://www.immuniweb.com/ssl/) | [Hard enize](https://www.hardenize.com/) | [Moz. Obs.](https://observatory.mozilla.org/) | [testssl .sh](https://testssl.sh/) | [SSL-yze](https://github.com/nabla-c0d3/sslyze) |
|:---------------------|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
| Client Emulation     |    ❌   |    ✅   |    ❌   |    ❌   |    ✅   |    ✅   |    ❌   |
| Weakness Check       |    ❌   |    ✅   |    ✅   |    ✅   |    ✅   |    ✅   |    ❌   |
| Vulnerability Check  |    ❌   |    ✅   |    ✅   |    ❌   |    ❌   |    ✅   |    ✅   |
| Highlights in Output |    ❌   |    ✅   |    ✅   |    ✅   |    ✅   |    ✅   |    ❌   |
|                      |    0%   |   100%  |   75%   |   50%   |   75%   |   100%  |   25%   |

## Opportunities

### DNS Records

Nowadays information related to security settings is stored in DNS records especially, but not exclusively in the case of the SMTP protocol. These records can be analyzed by CryptoLyzer and the necessary implementations are planned to be done soon.

<!---
|| **CryptoLyzer** | Qualys SSL Labs | ImmuniWeb | Hardenize | Mozilla Observatory | Testssl.sh | SSLyze |
-->

|| **Crypto Lyzer** | [Qualys SSL Labs](https://www.ssllabs.com/ssltest/) | [Immuni Web](https://www.immuniweb.com/ssl/) | [Hard enize](https://www.hardenize.com/) | [Moz. Obs.](https://observatory.mozilla.org/) | [testssl .sh](https://testssl.sh/) | [SSL-yze](https://github.com/nabla-c0d3/sslyze) |
|:-----------------------------------------------------------------------------------|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
| [DNS CAA](https://en.wikipedia.org/wiki/DNS_Certification_Authority_Authorization) |    ❌   |    ✅   |    ✅   |    ✅   |    ✅   |    ✅   |    ❌   |
| [MTA-STS](https://datatracker.ietf.org/doc/html/rfc8461)                           |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |    ❌   |
| [DANE](https://en.wikipedia.org/wiki/DNS-based_Authentication_of_Named_Entities)   |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |    ❌   |
| [SPF](https://en.wikipedia.org/wiki/Sender_Policy_Framework)                       |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |    ❌   |
| [DMARC](https://en.wikipedia.org/wiki/DMARC)                                       |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |    ❌   |
| [TLS-RPT](https://datatracker.ietf.org/doc/html/rfc8460)                           |    ❌   |    ❌   |    ❌   |    ✅   |    ❌   |    ❌   |    ❌   |
|                                                                                    |  **0%** |   17%   |   17%   | **100%**|    17%  |    17%  |    0%   |

### Other protocols

Some cryptographic protocols use the variant of the TLS protocol. Some protocols wrap the original TLS protocol such as [OpenVPN](https://openvpn.net/community-resources/openvpn-cryptographic-layer/), [QUIC](https://datatracker.ietf.org/doc/rfc9001/), and there is a modified version of TLS, according to the need of UDP, called [DTLS](https://en.wikipedia.org/wiki/Datagram_Transport_Layer_Security). Their support would be implemented relatively easily in CryptoLyzer in the future.

# Practice

## Installation

CryptoLyzer can be easily installed from [The Python Package Index](https://pypi.org/) (PyPi)

    $ pip install cryptolyzer

or via Docker from [Docker Hub Container Image Library](https://hub.docker.com/) (docker hub)

    $ docker pull coroner/cryptolyzer

and there are prebuilt packages for DEB (Debian, Ubuntu, …) and RPM (Fedora, RHEL, SUSE) based systems.

## Usage

The command-line interface is slightly similar to the OpenSSL command-line tool. On each level of subcommands, comprehensive help can be given using the --help option. The analysis subject can be given multiple times as an argument in URL format. Most of the time scheme and port part of the URL has default values according to the analyzer (eg: tls, ssh).

    $ cryptolyze tls all www.example.com
    
    $ cryptolyze tls1_2 ciphers https://www.example.com:443
    
    $ cryptolyze ssh all www.example.com
    
    $ cryptolyze ssh2 ciphers ssh://www.example.com:22
    
    $ cryptolyze http headers http://www.example.com/path?query#fragment

or can be used via Docker

    $ docker run --rm coroner/cryptolyzer tls all www.example.com
    
    $ docker run --rm coroner/cryptolyzer tls1_2 ciphers https://www.example.com:443
    
    $ docker run --rm coroner/cryptolyzer ssh all www.example.com
    
    $ docker run --rm coroner/cryptolyzer ssh2 ciphers ssh://www.example.com:22
    
    $ docker run --rm coroner/cryptolyzer http headers http://www.example.com/path?query#fragment

---
Licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/)

Photo by [Jon Tyson](https://unsplash.com/@jontyson?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/crypto?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)