I did sample programs in cipher,md5 and sha.
But i dont know which is best in terms of security.
Kindly let me know which one is good to use and reason for the same.
You can add other algorithm also but i wanna know the secure one.
MD5 and SHA are cryptographic hash functions. Note, that page contains a list of different algorithms, including some MD5 and SHA variants. I'm not an expert in this, but as far as I know SHA is more secure than MD5.
The important point to realize is that ciphers offer two-way encryption. That means if you encrypt something you can later decrypt it, thus getting back the original cleartext. AES is a good standard choice for encryption.
MD5 and SHA are both hashes (or digests) which implement one-way encryption. Once something is hashed there is no way to get back the original cleartext (there's no decryption). MD5 should be considered obsolete at this point, as should SHA-1; that leaves SHA-2 as the standard choice.
sri ramvaithiyanathan wrote:jesper and ulf thanks for your effort.
Shall i take like this in terms of security sha or md5 is more security compared to cipher.
Because cipher shows the original string after decryption.
The context and detail of what you are doing is everything. If you are trying to secure user passwords when one does not need to be able to recover the password then using a message digest with random salt is usually the most secure. If one is trying to secure data that one needs to be able to recover then obviously one can't uses a message digest (since you can't recover the original) and one need to use encryption.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.