Depending on what you are planning to do, the most recommended option at
this time could be Rijndael with 256-bit keys and cipher-block chaining (you
will need initialization vector). This assumes that you actually need to use
symmetric key encryption and know how to manage keys (instead of using
public-key encryption, DPAPI, or hashing). Please check this sample (it will
give you and idea how to do it):
http://www.obviex.com/samples/encryption.aspx. I am pretty sure there are
other symmetric key encryption samples available at MSDN (I had other links,
such as Ivan Medvedev's example, but cannot find it now, maybe someone else
can post).
Alek
"Andreas Mertens" <andr...@nvisionideas.com> wrote in message
news:20C27189-DF7D-4911...@microsoft.com...
> I wish to use the PasswordDeriveBytes class (in
System.Security.Cryptography) to generate an appropriate key for
encryption/decryption. In order to do so I need to specify the encryption
algorithm that the key is to be targeted at (in the call to
CryptDeriveKey())
>
> I want to use the strongest encryption available by this method.
Unfortunately, the documentation for PasswordDeriveBytes does not list which
encryption algorithms can be used (likewise for the hash algorithm in the
same call).
>
> I can do trial and error and find something, but it would be nice if a
full listing could be made available.
Hash Algorithms
HMACSHA1 -> System.Security.Cryptography.HMACSHA1
http://www.w3.org/2000/09/xmldsig#sha1 -> System.Security.Cryptography.SHA1CryptoServiceProvider
MACTripleDES -> System.Security.Cryptography.MACTripleDES
MD5 -> System.Security.Cryptography.MD5CryptoServiceProvider
SHA -> System.Security.Cryptography.SHA1CryptoServiceProvider
SHA1 -> System.Security.Cryptography.SHA1CryptoServiceProvider
SHA256 -> System.Security.Cryptography.SHA256Managed
SHA-256 -> System.Security.Cryptography.SHA256Managed
SHA384 -> System.Security.Cryptography.SHA384Managed
SHA-384 -> System.Security.Cryptography.SHA384Managed
SHA512 -> System.Security.Cryptography.SHA512Managed
SHA-512 -> System.Security.Cryptography.SHA512Managed
System.Security.Cryptography.HashAlgorithm -> System.Security.Cryptography.SHA1CryptoServiceProvider
System.Security.Cryptography.HMACSHA1 -> System.Security.Cryptography.HMACSHA1
System.Security.Cryptography.KeyedHashAlgorithm -> System.Security.Cryptography.HMACSHA1
System.Security.Cryptography.MACTripleDES -> System.Security.Cryptography.MACTripleDES
System.Security.Cryptography.MD5 -> System.Security.Cryptography.MD5CryptoServiceProvider
System.Security.Cryptography.SHA1 -> System.Security.Cryptography.SHA1CryptoServiceProvider
System.Security.Cryptography.SHA256 -> System.Security.Cryptography.SHA256Managed
System.Security.Cryptography.SHA384 -> System.Security.Cryptography.SHA384Managed
System.Security.Cryptography.SHA512 -> System.Security.Cryptography.SHA512Managed
Asymmetric Algorithms
DSA -> System.Security.Cryptography.DSACryptoServiceProvider
RSA -> System.Security.Cryptography.RSACryptoServiceProvider
System.Security.Cryptography.AsymmetricAlgorithm -> System.Security.Cryptography.RSACryptoServiceProvider
System.Security.Cryptography.DSA -> System.Security.Cryptography.DSACryptoServiceProvider
System.Security.Cryptography.RSA -> System.Security.Cryptography.RSACryptoServiceProvider
Symmetric Algorithms
3DES -> System.Security.Cryptography.TripleDESCryptoServiceProvider
DES -> System.Security.Cryptography.DESCryptoServiceProvider
RC2 -> System.Security.Cryptography.RC2CryptoServiceProvider
Rijndael -> System.Security.Cryptography.RijndaelManaged
System.Security.Cryptography.DES -> System.Security.Cryptography.DESCryptoServiceProvider
System.Security.Cryptography.RC2 -> System.Security.Cryptography.RC2CryptoServiceProvider
System.Security.Cryptography.Rijndael -> System.Security.Cryptography.RijndaelManaged
System.Security.Cryptography.SymmetricAlgorithm -> System.Security.Cryptography.RijndaelManaged
System.Security.Cryptography.TripleDES -> System.Security.Cryptography.TripleDESCryptoServiceProvider
Triple DES -> System.Security.Cryptography.TripleDESCryptoServiceProvider
TripleDES -> System.Security.Cryptography.TripleDESCryptoServiceProvider
-Shawn
http://blogs.msdn.com/shawnfa
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they
originated.
--------------------
>Thread-Topic: PasswordDeriveBytes - which algorithms are available?
>thread-index: AcQZztbKuF4frZEzQ42gRBUR/lbvDw==
>X-Tomcat-NG: microsoft.public.dotnet.security
>From: =?Utf-8?B?QW5kcmVhcyBNZXJ0ZW5z?= <andr...@nvisionideas.com>
>Subject: PasswordDeriveBytes - which algorithms are available?
>Date: Sat, 3 Apr 2004 14:56:03 -0800
>Lines: 5
>Message-ID: <20C27189-DF7D-4911...@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.dotnet.security
>Path: cpmsftngxa06.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.security:5641
>NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
>X-Tomcat-NG: microsoft.public.dotnet.security