3des encryption and decryption in iOS

前端 未结 1 485
没有蜡笔的小新
没有蜡笔的小新 2021-01-15 18:45

I am working on 3DES encryption and decryption. I have done encryption successfully. For decryption, I am using this code but not getting exact result. My encryption string

相关标签:
1条回答
  • 2021-01-15 19:23
    ccStatus = CCCrypt(kCCDecrypt,
                       kCCAlgorithm3DES,
                       kCCOptionPKCS7Padding | kCCOptionECBMode,
                       vkey, //"123456789012345678901234", //key
                       kCCKeySize3DES,
                       NULL,// vinitVec, //"init Vec", //iv,
                       vplainText, //"Your Name", //plainText,
                       plainTextBufferSize,
                       (void *)bufferPtr,
                       bufferPtrSize,
                       &movedBytes);
    

    you need change kCCKeySizeDES -> kCCKeySize3DES

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