title: Twofish encryption decryption Algorithm
body: <p>I am using a sample code <a href="https://github.com/dheeraj-thedev/Crypto" rel="nofollow noreferrer">from a git repository</a> to understand twofish algorithm, The code below works very fine the results are also correct checked from an online tool ref <a href="http://twofish.online-domain-tools.com/" rel="nofollow noreferrer">http://twofish.online-domain-tools.com/</a></p>
  
  <p>the problem is as below :-   </p>
  
  <pre><code>int[] plainText = new int[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C,
              0x0D, 0x0E, 0x0F };
  
      int[] p = new int[4];
      for (int i = 0; i &lt; 4; i++) {
          p[i] = plainText[4 * i] + 256 * plainText[4 * i + 1] + (plainText[4 * i + 2] &lt;&lt; 16)
                  + (plainText[4 * i + 3] &lt;&lt; 24);
      }
      System.out.println("Input:");
      Utils.printInput(p);
      int[] key = p; //
      System.out.println("Key:");
      Utils.printInput(key);
      //
      int[] encrypted = TwoFish.encrypt(p, key);
      //
      System.out.println("Encrypted:");
      Utils.printInput(encrypted);
      System.out.println();
  
      int[] decrypted = TwoFish.decrypt(encrypted, key);
      System.out.println("Decrypted:");
      Utils.printInput(decrypted);
  </code></pre>
  
  <p>In the code above same key is used as plainText and Key, While there is a requirement of passing plain text and key</p>
  
  <pre><code>int[] encrypted = TwoFish.encrypt(p, key);
  </code></pre>
  
  <p>above code needs to take input from </p>
  
  <pre><code>int[] encrypted = TwoFish.encrypt("The plain text information", "000102030405060708090A0B0C0D0E0F");
  </code></pre>