Search code examples
cryptographykeyencryptionblowfish

How to get a Blowfish encryption key


I have a bunch of messages in encrypted and decrypted form using Blowfish with the same key. Is there any way to get key out of those messages?

References to any algorithm or tool will be highly appreciated. I have only basic knowledge of cryptography so please correct me if question is too broad and not specific enough.


Solution

  • You do not have many chances of getting the key. The only attacks that I see are:

    • leverage on flaws in the implementation of the encryption. Blowfish is a block cipher, as such it encrypts only blocks of fixed size. In order to encrypt variable length files, you need a mode of operation and a padding scheme. In your post you do not tell which if these have been used for your files, but some of the few successful attacks against cryptography exploit wrong choice or implementations of these.

    • if the key was derived from a password you can try to guess the password. In addition to the above, you also need to know the algorithm that was used to derive the password. You can also find in the Internet several dictionaries, which are basically long lists of possible passwords. With some work you can write a program that checks several password per second. My experience says that if you are lucky and the password is in a dictionary you can probably find it in a few days.

    For the sake of completeness, trying all the possible keys requires more than the life of the universe.