[openssl-users] Is there a way to get the numeric-value for a openssl-cipher-suite

Matt Caswell matt at openssl.org
Wed Dec 14 09:26:38 UTC 2016



On 14/12/16 08:09, Ajay Garg wrote:
> Hi All.
> 
> I am using the following script at myu laptop, to test for the available
> cipher-suites :
> 
> ####################################################
> #!/usr/bin/env bash
> 
> # OpenSSL requires the port number.
> SERVER=server.ip.com:12345 <http://server.ip.com:12345>
> DELAY=1
> ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
> 
> echo Obtaining cipher list from $(openssl version).
> 
> for cipher in ${ciphers[@]}
> do
> # echo -n Testing $cipher...
> result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1)
> if [[ "$result" =~ ":error:" ]] ; then
>     true
> else
>   if [[ "$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher    :"
> ]] ; then
>     echo ${cipher}
>   else
>       true
>   fi
> fi
> sleep $DELAY
> done
> ####################################################
> 
> 
> Above script works, and I am able to get the supported-ciphers-listing.
> But all those ciphers are in stringified-form.
> 
> 
> Is there a way, so that I can get the supported-ciphers in their
> corrsponding numeric-values form?

Try the -V option to the ciphers command.

Matt




More information about the openssl-users mailing list