views:

774

answers:

7

For my iPhone application, Apple wants to know if my password encryption (md5) is greater then 64-bit symmetric or greater then 1024-bit symmetric. I have not been able to find it online, so I am wondering if anyone knows the answer. In addition, is this considered an appropriate encryption technology for passwords, or should I use something different?

Thanks for any help!

+5  A: 

md5 isn't really symmetric or asymmetric encryption because it isn't reversible either symmetrically or asymmetrically. It's a Message Digest (secure hash) algorithm.

Nimrod
+2  A: 

It is NOT encryption at all.

GregS
+2  A: 

As my comment said:

MD5 is a hashing method, not an encryption, and therefore I'm not sure there's an answer to this question. A symmetric key would be your secret key and asymmetric your public key. MD5 doesn't have either of these, it simply hashes a string (one-way encryption.) ;)

John
+15  A: 

MD5 is a hashing function, thus by definition it is not reversible. This is not the case for encryption (either symmetric or asymmetric), which has to be reversible to be useful.

To be more precise, hashes are one-way functions, in that an infinite number of inputs can map to a single output, thus it is impossible to obtain the exact input, with certainty, that resulted in a given output.

However, it may be possible to find a different input that hashes to the same output. This is called a collision.

Generally, hashing passwords instead of storing the plain text (even encrypted) is a good idea. (Even better if using a salt) However, MD5 has known weaknesses (and large collections of rainbow tables that aid in finding collisions), thus it would be a good idea to switch to something like SHA-1 or one of the SHA-2 family of hashes.

However, to answer your original question, there is really is no way to compare MD5 or any hash against any type of encryption; they have no equivalents because it's like comparing apples and oranges.

Peter
Hi Peter: Does this mean that my app doesn't "contain encryption"?
PF1
Strictly speaking, no. Using MD5 or any other hash function so that the actual password is not stored is sometimes referred to as "one-way encryption", though the use of the term encryption is a misnomer: (Obligatory Wikipedia link: http://en.wikipedia.org/wiki/One-way_encryption)
Peter
I know this is late, but just to add on... Instead of using SHA-1 or SHA-2, you could also just try salting a hash or even using both MD5 and SHA-1.
John
+3  A: 

It's not encryption, it's a digest. If you didn't salt it, it's not particularly secure, but they're asking you the wrong question.

What exactly are you doing with MD5 and passwords? There are standard ways of doing things here, and it's always better to use one, but without knowing what you want to do it's hard to point you at a relevant standard.

Andrew McGregor
A: 

I think MD5 is used for better security.... if we tell about any encryption or decryption algorithm, they are just for converting any plain text into cipher text... but on the other hand MD5 provides an uniqueness on that plain text that would be sent by any source(Alice)...so we can say that for better security or for providing envelop on plain text MD5 should be used before using any encryption algothim(symmetric or asymmetric).

baishali
A: 

As the numerous other guys on here have mentioned, MD5 is not a symmetric or an asymmetric algorithm.

Instead it comes under a different branch in cryptography all together. It's one of the smallest hashing algorithms available in the .Net framework. At a mere 16bytes for its keysizes, which should be 128 bit. Something that you learn your bread and butter with.

So yes it is greater than 64bit which is only 8bytes in size.

The maximum key size the common symm' enc' algs use is 256bit (Rijndael Managed).

If you want to be looking at keysizes greater than that, then you can use the RC2 symm' enc' algs which supports variable key sizes. Something that you can experiment with?

If you want higher than 1024bit, then you need to be looking at Asymm' Enc' Algs like the RSACryptoServiceProvider class which supports key sizes going upto 16K in Bits I think?

If you want to use passwords, then you need to use Keyed Hashing Algs, like anything HMAC' something, they should be Keyed Hashing Algorithms or MacTripleDes. These all use secret keyes to encrypt the hash that is generated from the data you supply. The keys are created by using passwords and salt values via the RFC2898DerivesBytes class. <-- Don't forget that RC2, Rijndael, AES, DES and etc all can be set-up to use passwords to help derive the secret keys. In case you are thinking that the opening sentence of this paragraph is a little misleading. So i added this just to be sure in the event that hashing is not what you need altogether.

*REMEMBER THAT THERE ARE UNIQUE INHERITANCE HIERARCHIES IN .net's Cryptography NameSpace. So MD5 is the base Abstract class all MD5 Derived classes are to derive from. .Net provides one such derived class that is called MD5CryptoServiceProvider class. Which is essentially a managed wrapper class that makes call to windows unmanaged Crypto-Libraries API. MD5 is known in MS official textbooks under the umbrella term as a Non-Keyed Hashing Algorithm. *

There are plenty of options available to you.

: ) Enjoy !

IbrarMumtaz