3des-cbc algorithm
anyone knows how do I generate the 3des-cbc code using input and master key? what开发者_如何学编程 is the algorithm used? using C++ Thank you.
I'd like to point out that coding encryption algorithms is very non-trivial and very, very easy to get wrong. If you need this for a commercial project, please use a well known library such as:
- http://www.openssl.org
- http://www.cs.auckland.ac.nz/~pgut001/cryptlib
If you're just interested in the algorithm itself and/or this is not intended for commercial use, Wikipedia offers a good starting point: http://en.wikipedia.org/wiki/3des.
For the workings of CBC mode (which has nothing to do with 3DES in itself, it's simply a method of employing block ciphers), again, Wikipedia is a good starting point: http://en.wikipedia.org/wiki/Cipher_block_chaining.
I recommend taking a look at this answer if you happen to be using Java. It includes an example of AES encryption with CBC mode. You should be able to use 3DES in place of AES. If you're decrypting something you didn't encrypt you're going to need to provide the same key and IV in the same format as was used for the encryption, as well as specify the padding used. You'll have include those details for us to help you further. You should also include what language or technologies you're dealing with so we can give examples with those.
You can find details about the algorithms on Wikipedia, see 3DES and CBC.
精彩评论