1
votes

I have some issues regarding BlowFish encryption. I'm developing a portlet in Java deployed under weblogic. I receive from an internet usb device a string encrypted with BlowFish - nCFB mode and i need to obtain the original string from it. I implemented blowfish decryption, but i don't know how can i decrypt using the nCFB mode. It's very few documentation on the internet but i was able to find a tool that does it at: http://www.tools4noobs.com/online_tools/decrypt/

Giving my input string and password, it retrieves the result. But on java i can't do

Cipher cipher = Cipher.getInstance("Blowfish/NCFB/NoPadding");

Because the NCFB is not recognized. I did my implementation with

Cipher cipher = Cipher.getInstance("Blowfish/CFB/NoPadding");

But it only decodes the first 3 characters. How can i decrypt using the NCFB mode instead of CFB ?

I was able to found a little something about nCFB at http://mcrypt.hellug.gr/lib/mcrypt.3.html , but it belongs to mcrypt php library.

Is there a java API able to do this ? Or how can i get the CFB mode to work as NCFB ?

Best regards

1

1 Answers

2
votes

CFB (Cypher Feed Back) mode feeds back part or all of the cyphertext when decrypting. the "n" in nCFB tells you how much to feed back. The default is the entire block. You will need to read the documentation to find out what value of n is being used to encrypt, and how to add that parameter to your decryption algorithm. Given that the first three characters are decrypting correctly, it might be that n is 24 bits, though I am not sure of that.

Normally CTR mode is less trouble than CFB.