What's the best encryption algorithm for the iPhone in terms of speed and security?

前端 未结 3 921
礼貌的吻别
礼貌的吻别 2021-01-06 19:58

The iPhone supports the following encryption algorithms

enum {
    kCCAlgorithmAES128 = 0,
    kCCAlgorithmDES,            
    kCCAlgorithm3DES,           
         


        
相关标签:
3条回答
  • 2021-01-06 20:30

    RC4 is probably the fastest, but it has some security issues. If security is an important factor, I would recommend going for AES128. AES is the standard solution and on the top of excellent security you might expect the implementations to get faster over time as people are still actively working on them. Maybe future CPUs will also include support for it, just like new Intel desktop processors will.

    0 讨论(0)
  • 2021-01-06 20:35

    Key length

    Bruce Schneier wrote back in 1999:

    Longer key lengths are better, but only up to a point. AES will have 128-bit, 192-bit, and 256-bit key lengths. This is far longer than needed for the foreseeable future. In fact, we cannot even imagine a world where 256-bit brute force searches are possible. It requires some fundamental breakthroughs in physics and our understanding of the universe. For public-key cryptography, 2048-bit keys have same sort of property; longer is meaningless.

    Block ciphers

    AES

    It's the current standard encryption algorithm. It's considered to be safe by most people. That's what you should be using if you haven't got a very deep knowledge in cryptography.

    DES

    DES is the predecessor of AES and is considered broken because of its short key length.

    3DES

    Is a variation of DES with a longer key length. It's still in use but there are some known attacks. Still it's not yet broken.

    RC2

    It's considered to be weak.

    Stream ciphers

    RC4

    It has some known vulnerabilities but is still used today, for example in SSL. I recommend not to use it in new products.

    Conclusion

    Use either RC4 or AES, depending if you need a stream or a block cipher.

    0 讨论(0)
  • 2021-01-06 20:35

    Of those algorithms you list, I believe RC4 is the fastest. In addition, the speed of RC4 does not depend on the key length once it has been initialized. So you should be able to use the maximum key size for that one without worrying about runtime cost.

    0 讨论(0)
提交回复
热议问题