login about faq

i'm trying to create a blowfish encryptdecrypt application just like in MIRC. for that i am using Chilkat libraries.

i'm not sure i have the exact settings as they are in mirc which using https://github.com/flakes/mirc_fish_10.

for example: i'm trying to encrypt the following text: "hi my name is" with the key: "Q1w2E3r4"

  • in mirc the encrypted output is: +OK XfTh91E1q8e/h0vS//9tfHo/
  • using my application is get: njjRVsdXn9FZ0ePNkO6rZg==

i'm using the following code to encode (also need to decode):

public Main()
    var crypt = new Chilkat.Crypt2
        CryptAlgorithm = "blowfish2",
        CipherMode = "ecb",
        KeyLength = 64,
        PaddingScheme = 0,
        EncodingMode = "base64",

    bool success;
    success = crypt.UnlockComponent("Anything for 30-day trial");
    if (success != true)

    crypt.SetEncodedKey("Q1w2E3r4", "base64");

    encStr = crypt.EncryptStringENC("hi my name is");
    Console.WriteLine("Chilkat - Clear Text: hi my name");
    Console.WriteLine("Chilkat - Encoded: " + encStr);


please help to match the encoding

asked Jun 06 '14 at 03:48

Eyal%20k's gravatar image

Eyal k

  1. Check to see if you really want "ECB" or "CBC" mode.
  2. Try to get both sides to match a published test vector. See below:

Test vectors for 64-bit blowfish are located here: https://www.schneier.com/code/vectors.txt

The 1st vector on the page is this:

key bytes               clear bytes             cipher bytes
0000000000000000        0000000000000000        4EF997456198DD78

Chilkat can reproduce these results with the following code:

            Chilkat.Crypt2 crypt = new Chilkat.Crypt2();

crypt.CryptAlgorithm = "blowfish2";
            crypt.KeyLength = 64;
            crypt.CipherMode = "ecb";
            crypt.SetEncodedKey("0000000000000000", "hex");
            crypt.PaddingScheme = 3;    // In this case the input is already equal to the block size of the algorithm..
            crypt.EncodingMode = "hex";
            // Result is 4EF997456198DD78

answered Jun 06 '14 at 10:05

chilkat's gravatar image

chilkat ♦♦

for testing vector it works good - but still not same as mirc encryption. I wonder how come no similar project in chilkat for the one in mirc. I'm failing over and over to get the same results


answered Jun 06 '14 at 12:37

Eyal%20k's gravatar image

Eyal k

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Jun 06 '14 at 03:48

Seen: 1,258 times

Last updated: Jun 06 '14 at 12:37

powered by OSQA