简体   繁体   English

3des-cbc算法

[英]3des-cbc algorithm

anyone knows how do I generate the 3des-cbc code using input and master key? 有人知道如何使用输入和主密钥生成3des-cbc代码吗? what is the algorithm used? 使用什么算法? using C++ Thank you. 使用C ++谢谢。

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: 如果您需要将其用于商业项目,请使用众所周知的库,例如:

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 . 如果您仅对算法本身感兴趣,并且/或者不打算将其用于商业用途,那么Wikipedia提供了一个很好的起点: 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 . 对于CBC模式的工作方式(与3DES本身无关,它只是采用分组密码的一种方法),再次,Wikipedia是一个很好的起点: http : //en.wikipedia.org/wiki/Cipher_block_chaining

I recommend taking a look at this answer if you happen to be using Java. 如果您恰巧使用Java,建议您看一下这个答案 It includes an example of AES encryption with CBC mode. 它包括使用CBC模式进行AES加密的示例。 You should be able to use 3DES in place of AES. 您应该能够使用3DES代替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. 如果解密的是未加密的内容,则需要提供与加密所用格式相同的密钥和IV,并指定要使用的填充。 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 . 您可以在Wikipedia上找到有关算法的详细信息,请参阅3DESCBC

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM