Comment of Encryption

* AES/DES

Java and .NET use PKCS5Padding by default

Java use ECBMode by default,

ObjC use CBCMode and PKCS7Padding by default, can support NoPadding and PKCS7Padding 2 modes only.

* RSA

Java default RSA/None/PKCS1Padding

Android default: RSA/None/NoPadding 

It's identical to "RSA/ECB/PKCS1Padding" where ECB is a bit of a misnomer, as it does not implement a block cipher mode of encryption. "RSA/None/PKCS1Padding" would have been a better name. Or "RSA/None/RSASSA-PKCS1-v1_5" as your guess about the padding mechanism is correct. This means that it uses a older mode of encryption (OAEP is better and newer). It also means that the input is restricted to a maximum of the key size minus 11 bytes.

 http://stackoverflow.com/questions/21066902/default-rsa-padding-in-sun-jce-oracle-jce

Key length 12-128 bytes

http://blog.csdn.net/centralperk/article/details/8553759

Encryption systems are often grouped into families. Common families include symmetric systems (e.g. AES) and asymmetric systems (e.g. RSA); they may alternatively be grouped according to the central algorithm used (e.g. elliptic curve cryptography).

As each of these is of a different level of cryptographic complexity, it is usual to have different key sizes for the same level of security, depending upon the algorithm used. For example, the security available with a 1024-bit key using asymmetric RSA is considered approximately equal in security to an 80-bit key in a symmetric algorithm (Source: RSA Security).

The actual degree of security achieved over time varies, as more computational power and more powerful mathematical analytic methods become available. For this reason cryptologists tend to look at indicators that an algorithm or key length shows signs of potential vulnerability, to move to longer key sizes or more difficult algorithms. For example as of May 2007[update], a 1039 bit integer was factored with the special number field sieve using 400 computers over 11 months.[1] The factored number was of a special form; the special number field sieve cannot be used on RSA keys. The computation is roughly equivalent to breaking a 700 bit RSA key. However, this might be an advance warning that 1024 bit RSA used in secure online commerce should be deprecated, since they may become breakable in the near future. Cryptography professor Arjen Lenstra observed that "Last time, it took nine years for us to generalize from a special to a nonspecial, hard-to-factor number" and when asked whether 1024-bit RSA keys are dead, said: "The answer to that question is an unqualified yes."[2]

he effectiveness of public key cryptosystems depends on the intractability (computational and theoretical) of certain mathematical problems such as integer factorization. These problems are time consuming to solve, but usually faster than trying all possible keys by brute force. Thus, asymmetric algorithm keys must be longer for equivalent resistance to attack than symmetric algorithm keys. As of 2002, an asymmetric key length of 1024 bits was generally considered[who?] the minimum necessary for the RSA encryption algorithm.

As of 2003[update] RSA Security claims that 1024-bit RSA keys are equivalent in strength to 80-bit symmetric keys, 2048-bit RSA keys to 112-bit symmetric keys and 3072-bit RSA keys to 128-bit symmetric keys. RSA claims that 1024-bit keys are likely to become crackable some time between 2006 and 2010 and that 2048-bit keys are sufficient until 2030. An RSA key length of 3072 bits should be used if security is required beyond 2030.[6] NIST key management guidelines further suggest that 15360-bit RSA keys are equivalent in strength to 256-bit symmetric keys.[7]

The Finite Field Diffie-Hellman algorithm has roughly the same key strength as RSA for the same key sizes. The work factor for breaking Diffie-Hellman is based on the discrete logarithm problem, which is related to the integer factorization problem on which RSA's strength is based. Thus, a 3072-bit Diffie-Hellman key has about the same strength as a 3072-bit RSA key.

 http://en.wikipedia.org/wiki/Key_size 

猜你喜欢

转载自shappy1978.iteye.com/blog/2187902