3des-cfb failing to decrypt

Jussi Kivilinna jussi.kivilinna at iki.fi
Fri Mar 25 12:28:45 CET 2016


Hello,

In your example, you are using OpenSSL/libcrypto and mcrypt with CFB-8bit mode.

Libgcrypt CFB-mode works as CFB-64 for 64-bit blockciphers and as CFB-128 for
128-bit.

-Jussi

On 24.03.2016 19:15, Andrew Stevenson wrote:
> Hi,
> 
> I am trying to use libgcrypt to decrypt some data encoded using 3des-cfb. Unfortunately I only ever manage to decrypt the first character. I'm guessing its user error on my behalf though I've been through the documentation several times and can't see what I'm doing wrong.
> 
> I have some example code posted here: https://gist.github.com/andrew-stevenson-sociomantic/7b28d0bd9f8f34bcef00
> 
> It has hard coded key, iv, cipher text and plain text. It then tries to decrypt the cipher text with OpenSSL/libcrypto, libmcrypt and libgcrypt, asserting after each that the decrypted test matches the plaintext. The libcrypto and libmcrypt methods work OK but decrypt_3des_gcrypt doesn't so the assert on line 148 fails.
> 
> Can someone see what I'm doing wrong?
> 
> Thanks,
> 
> Andrew
> 
> 
> _______________________________________________
> Gcrypt-devel mailing list
> Gcrypt-devel at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
> 




More information about the Gcrypt-devel mailing list