The thing to know is that NegotiateStream is just a wrapper around SSPI.
The .NET code doesn't do anything to negotiate the encryption. The
encryption that gets used will depend a great deal on the OS versions on
both ends of the stream and whether or not Kerberos of NTLM is used as the
underlying negotiated protocol. With 2003 server at both ends, you'll get
higher encryption strength and will get encryption whether Kerberos or NTLM
is used. If Win2K is used, it depends on the service pack version.
There is probably some documentation somewhere that says which ciphers are
supported by which OS revs for SSPI, but I haven't spotted it yet.
Like I said, with SSPI, you can call QueryContextAttributes to find out the
ciphers used and the key length (and the actual session key), but that does
not seem to be exposed to .NET.
Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net --
[quoted text, click to view] "Gary Feldman" <GaryFeldman@discussions.microsoft.com> wrote in message
news:7C478F3E-BA8B-4DD5-9C63-D66B05A04FC2@microsoft.com...
>
>
> "Joe Kaplan (MVP - ADSI)" wrote:
>
>> Unfortunately, it isn't that straightforward as the encryption is
>> whatever
>> is negotiated by the negotiate protocol.
>
> Thanks. Your reply triggered my memory of looking at the Microsoft
> CryptoAPI several years ago, includind seeing a table of CSPs that
> normally
> ship with each operating system (but which I can't find anymore).
>
> Intuitively, the implementation should either be using one of the
> providers
> defined in system.security.cryptography, or one that's available via the
> CryptoAPI. Correct? If the latter, they can be found in the registry,
> but
> it's not clear how .Net may get repackaged for different countries. Or
> perhaps the .Net system.security.cryptography package is the same
> everywhere,
> and it's the presence or absence of the underlying CSP that determines
> whether or not that particular feature is available.
>
> That still leaves one question in my mind? Is there any insight into how
> the negotiate protocol picks one from the available matches?
>
> Thanks