Encryption which one is the best ?
C#
Thread Starter: Paschal
Started:
Replies: 4

Ireland .NET Developer Alliance :: Forums » Technologies » C# » Encryption which one is the best ?
« Previous Thread Next Thread »
   11 Jan 2005, 11:27
Paschal is not online. Last active: 11/02/2005 15:00:30 Paschal

Top 10 Posts
Joined on 27-10-2004
Posts 84
Encryption which one is the best ?
So many encryption schemes (DES, SHA, etc...).

Which one is the best ?
  
   13 Jan 2005, 11:42
Dave is not online. Last active: 14/02/2005 18:02:07 Dave
Re: Encryption which one is the best ?
The age old question.

Lots of text out there on so I won't either bore you or conclude that you haven't looked at some of the text...

In short Asymmetric encryption only has a place for encrypting keys or in digital signatures. The keys that are encrypted are those that have been used by a symmetric algorithm for bulk encryption.

An example:

I want to send someone a file. I encrypt it using a symmetric algorithm (since it's significantly faster) and as a result have a key and a block of encrypted data. I can't send the key in the clear, so it must be sent securely.  I could meet up with the person and give them the key - but then why do I need to encrypt? In short I encrypt the key. To do this I use an asymmetric algorithm using the recipients public key to encrypt. Since the recipient is the only person with the corresponding private key, they are the only one who can decrypt the key.

As I say loads of text out there on this.

So then, to determine the best algorithm - presuming a Symmetric algorithm - one has some choices:

Des - the original with a 64 bit key - not a full 64 bit key so now really breakable.
Thriple Des - should be three times stronger than des but it's not. Widely used, but now replaced by Aes
Rijndael - or Aes - the new standard algorithm and with a good key length (up to 256 bit). If you want other people to decrypt the information then really this is the one for you.

There are others such as Blowfish & Twofish by Schneier or RC2 by Rivest (the R in RSA) which are generally shipped with most crypto toolkits, but unless you have a specific need / requirement then their use is questionable.

SHA1 as a final note is a message digest / hash algorithm - meaning that it is one way only - the data can't be recovered after it is hashed.

Books to read in order of pain / endurance of reader:

C# Data Security Handbook (wrox) - MacDonald & Johansson (Good for use in .NET)
Java Cryptography (O'Reilly) - Knudsen (not .NET but good none the less)
Applied Cryptography (Wiley) - Schneier (Good on theory and some implementation)
Handbook of Applied Cryptography (CRC) - Menzes et al. (Superb for both the Maths and the implementation)

 
    
   13 Jan 2005, 12:47
michu is not online. Last active: 25/01/2005 14:03:25 michu

Top 10 Posts
Joined on 01-12-2005
Gdynia, Poland
Posts 5
Re: Encryption which one is the best ?
Yeah, what Dave has written is a good summary of the subject.

I'd like to point you additionaly to excellent (and free) e-book ".NET In Samples" which contains a lot of informations about encryption, .NET security and other stuff. You can get it from http://skilldrive.com/DOTNETinSamples.pdf



  
   13 Jan 2005, 12:53
michu is not online. Last active: 25/01/2005 14:03:25 michu

Top 10 Posts
Joined on 01-12-2005
Gdynia, Poland
Posts 5
whoops
I just noticed that the link is dead. The right link is http://skilldrive.com/DOTNETinSamples.zip

 
    
   13 Jan 2005, 6:21
Marcus is not online. Last active: 09/02/2005 10:52:55 Marcus



Top 10 Posts
Joined on 31 Oct 2004
Dublin, Ireland
Posts 19
Re: Encryption which one is the best ?
To save you buying books, here is a pretty good link for everything you might need to know. The content is a couple of years old (1999) but most of it is still very relevant.  http://home.ecn.ab.ca/~jsavard/crypto/jscrypt.htm


blog: http://www.styledesign.biz/weblogs/macinnesm/
  
  Page 1 of 1 (5 items)
Ireland .NET Developer Alliance :: Forums » Technologies » C# » Encryption which one is the best ?

Powered by Community Server :: Forums