- 论坛徽章:
- 0
|
我想用3DES加密一段文本,大家推荐用什么模块好?
only different is EDE can be used as DES when three keys are same.
http://kingkong.me.berkeley.edu/~kenneth/courses/sims250/des.html
2.2 The 3DES Algorithm
3DES uses the same basic machinery of Sec.2.1 three times over using 3 keys k1,k2,k3.The plaintext (M) is encrypted using k1. This result is encrypted with k2 and the result is then encrypted with k3 to get ciphertext (C). C = Ek3(Ek2(Ek1(M))). This mode of using 3DES is called the DES-EEE mode since all three keys run in the encryption mode. The other mode is called DES-EDE where the second stage is run in decryption mode. i.e. C = Ek3(Dk2(Ek1(M))).
The 3 keys may or may not be independent. For DES-EDE mode three options are defined
1. The keys k1, k2, and k3 are independent.
2. k1 and k2 are independent but k1 = k3
3. k1 = k2 = k3 - In this case, 3DES becomes backward compatible with DES. |
|