Connect to the server via SSL with various power and algorithmic capabilities of Cipher in C #

I searched a bit, found various tools for checking weak ciphers. How to determine which ciphers / algorithms supported by the server through .net / C #?

I can check sslv2, sslv3 and tls via (ssl.protocols.ssl2 / ssl3 / tls):

            TcpClient client = new TcpClient();
            client.Connect("host", 443);
            using (SslStream Ssl = new SslStream(client.GetStream()))
            {
                Ssl.AuthenticateAsClient("host", null, System.Security.Authentication.SslProtocols.Ssl3, false);
                Console.WriteLine(Ssl.CipherAlgorithm);
                Console.WriteLine(Ssl.CipherStrength);
                Console.WriteLine(Ssl.SslProtocol);
            }
            client.Close();

How to check algorithms and other weak ciphers through C #? I am looking at SSLDiagnos, but is it in c?

Any ideas?

+3
source share
4 answers

CipherAlgorithm and HashAlgorithm properties for SslStream. You determine what is “weak” for you, and check the consistent algorithm against your list of “weak” ones.

: . , , ciphersuites, . , SslStream ciphersuite (s), SecureBlackbox - - ( SSL).

+3

ciphersuite , . , / ciphersuites , . SslStream ciphersuites.

+1

Would I still look at ssldiagnos and maybe port it to C # using OpenSSL.NET? http://sourceforge.net/projects/openssl-net/ Then all you have to do is put the c code in C # and leave the OpenSSL code.

0
source

Now the ssldiagnos application is combined with another tool: sslpressure, which does not use openssl at all, just check the initial client hello (much easier), maybe you can use it as a template for your project.

0
source

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


All Articles