title: AES Encryption / Decryption doesnt match
body: <p>I have implemented AES - Decryption method as below - which works perfect. (I receive Encrypted text from other program) </p>
  
  <pre><code>public static String decrypt(String encryptedText, byte[] keyValue)
      {
          try
          {
              byte[] inputArr = Base64.getUrlDecoder().decode(encryptedText);
              SecretKeySpec skSpec = new SecretKeySpec(keyValue, "AES");
              Cipher cipher = Cipher.getInstance("AES/CFB/NoPadding");
              int blockSize = cipher.getBlockSize();
              IvParameterSpec iv = new IvParameterSpec(Arrays.copyOf(inputArr, blockSize));
              byte[] dataToDecrypt = Arrays.copyOfRange(inputArr, blockSize, inputArr.length);
              cipher.init(Cipher.DECRYPT_MODE, skSpec, iv);
              byte[] result = cipher.doFinal(dataToDecrypt);
              return new String(result, StandardCharsets.UTF_8);
          }
          catch (Exception e)
          {
              System.out.println("Error while decrypting: " + e.toString());
          }
          return null;
      }
  </code></pre>
  
  <p>While I Encrypt text (before send it to other program) using below code is not generating expected output (If I use above decryption program to validate it just returns null)</p>
  
  <pre><code>public static String encrypt(String strToEncrypt,  String key)
      {
          try
          {
              SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(), "AES");
              Cipher cipher = Cipher.getInstance("AES/CFB/NoPadding");
              int blockSize = cipher.getBlockSize();
              IvParameterSpec iv = new IvParameterSpec(Arrays.copyOf(strToEncrypt.getBytes(), blockSize));
              byte[] dataToDecrypt = Arrays.copyOfRange(strToEncrypt.getBytes(), blockSize, strToEncrypt.getBytes().length);
              cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
              byte[] encrypted = cipher.doFinal(dataToDecrypt);
              return Base64.getEncoder().encodeToString(encrypted);
          }
          catch (Exception e)
          {
              System.out.println("Error while encrypting: " + e.toString());
          }
          return null;
      }
  </code></pre>
  
  <p>Am i missing something?</p>