Click here to Skip to main content
15,892,768 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hy!
can any one tell me which is the best/latest and secure algorithm for encryption.
As for my i select the SHA-2...
what will be your's choise?
1) MD5
2) SHA-1
3) SHA-2
if any other then please tell....
Your opinion is necessary for me....
Posted
Comments
[no name] 28-Apr-13 14:22pm    
If you are looking for a hashing algorithm then I would probably pick SHA-2. Certainly not MD5. If I were looking for an encryption algorithm, I would pick none of the above.

'Best' has to be defined regarding an encryption algorithm (you seem to confound hashing and encryption, but Mehdi Gholam already told you that in Solution 2). The best algorithm should the one which shows the greatest ratio between provided security and used resources.
For general use, a simple symmetric encryption, like TripleDES, should be sufficient. If security is a bigger concern, like banks for example, then an asymmetric encryption algorithm could be more appropriate, like RSA for example. But asymmetric algorithms are a little bit more complex to use, and need also more resources from the computer.
Below I summarized you some cryptographic algorithms that exist and are implemented in .NET Framework, along with some link for them so that you can go and make your own choice:

Symmetric algorithms[^]
AES[^]
DES[^]
RC2[^]
Rijndael[^]
TripleDES[^]

Asymmetric algorithms[^]
DSA[^]
ECDiffieHellman[^]
ECDsa[^]
RSA[^]

Not knowing your concrete requirement, it is hard to tell whether you need to hash or to encrypt.
The only thing I can say is, if you are willing to encrypt your users passwords in your database, then you're wrong: you need to store a hash of the password.
This post[^] is very informative about best practices for passwords-handling.

I know this is a lot of reading, but security is not a trivial subject, and you should not attempt to use it without understanding its very basics. Hope this helps. Good luck.
 
Share this answer
 
Comments
Nelek 30-Apr-14 16:42pm    
Nice answer, a bit late but still nice :P

OP answered himself (and self accepted) one year too late.
phil.o 30-Apr-14 17:49pm    
Yes, I've seen that after posting.
Maybe it could be useful for someone else :)
Nelek 2-May-14 13:23pm    
I think so, that's why I gave my 5
Most of the small hardware devices uses elliptivc curves for cryptation, as it is the most secure with the least amount of bytes. You could check out this:
http://www.youtube.com/watch?v=njNPgMmghMo[^]

He has a lot more lectures on crytography so just watch them and youll find out :-)
 
Share this answer
 
MD5, SHA1 and SHA2 are hash functions not encryption algorithms : http://en.wikipedia.org/wiki/MD5[^]
 
Share this answer
 
Comments
msz900 28-Apr-13 14:26pm    
i agree with you that MD5,SHA_1,SHA_2 are hashing algorithm but we use one of these to encrypt the user input data before storing it in Mysql.
[no name] 28-Apr-13 14:28pm    
No... you are using those algorithms to hash the user input. That is not the same as encryption. Encryption you can reverse, a hash you cannot.
Mehdi Gholam 28-Apr-13 14:30pm    
Absolutely right encryption has to be reversible by definition.
msz900 28-Apr-13 14:33pm    
if it is, then what type of encryption method you suggest for me.
iam working in PHP and using PDO to interact with Mysql.
this best hashing algorithm in php 4 is the
PHP
hash('sha512')
and in php 5.5 is it,s own hashing function...
PHP
password_hash()  and password_verify().
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900