Security control validation and enforcement are tasks we have regularly. One of those never-ending efforts is to ensure the right combination of protocols, ciphers, and algorithms are available. Security experts have tools and methods we don't have and must develop substitutes.

Cipher sites have my special love since they have different naming conventions in different frameworks or products. The OpenSSL community even keeps the list of cipher suite name mappings as a part of the product documentation. Through the years, I've created numerous connectivity validators with Java or Shell. But every time, I had to identify ciphers from the report, translate them to the "native" format, and then interpret the results, arguing that the ciphers in my output were the same as the original.

Here is yet another secure socket validation utility written in Python. Due to Python's data-processing capabilities, you can write code that requires much more effort in other languages. The small application in this repository can test secure listeners with a subset of ciphers in any convention from the OpenSSL documentation page. In essence, the script performs the steps as follows:

  • Load cipher suite names into a list of tuples.
In [11]: cipher_names[-10:]
 ('TLS_AES_128_CCM_SHA256', 'TLS_AES_128_CCM_SHA256'),
 ('TLS_AES_128_CCM_8_SHA256', 'TLS_AES_128_CCM_8_SHA256'),

In [12]: 

The last ten cipher name pairs

  • Search through the ciphers to find any matches
#Walk through the list of incoming ciphers
for cp in test_ciphers:
    # Find matching name tuple in a list
    ctpl = [item for item in cp_list if cp in item][0]

Find matching cipher name pairs in both conventions.

  • Tests connection against internet address using matching cipher suite name.
Now, we can use any naming convention or mix and match them.

The code intentionally doesn't use advanced modules to make it as portable and compatible as possible.