C # AES: Szyfrowanie pliku powoduje, że „Długość danych do zaszyfrowania jest nieprawidłowa.” Błąd

Mam plik PDF.
Kiedy chcę go zaszyfrować za pomocą kodów poniżejLength of the data to encrypt is invalid. Wystąpił błąd:

  string inputFile = @"C:\sample.pdf";
  string outputFile = @"C:\sample_enc.pdf";

  try
  {    
    using (RijndaelManaged aes = new RijndaelManaged())
    {
      byte[] key = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
      byte[] iv = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };

      aes.Key = key;
      aes.IV = iv;

      aes.Mode = CipherMode.CFB;
      aes.Padding = PaddingMode.None;
      aes.KeySize = 128;
      aes.BlockSize = 128;

      using (FileStream fsCrypt = new FileStream(outputFile, FileMode.Create))
      {
        using (ICryptoTransform encryptor = aes.CreateEncryptor(key,iv))
        {
          using (CryptoStream cs = new CryptoStream(fsCrypt, encryptor, CryptoStreamMode.Write))
          {
            using (FileStream fsIn = new FileStream(inputFile, FileMode.Open))
            {
              int data;
              while ((data = fsIn.ReadByte()) != -1)
              {
                cs.WriteByte((byte)data);
              }
            }
          }
        }
      }
    }
  }
  catch (Exception ex)
  {
    // Length of the data to encrypt is invalid.
    Console.WriteLine(ex.Message);
  }


ZCipherMode.CBC iPaddingMode.PKCS7, Nie mam żadnych błędów.
Ale z powodu mojego klienta muszę zaszyfrować plik za pomocąAES / CFB zBez dopełnienia.

Jakieś pomysły, co się tutaj dzieje?

questionAnswers(3)

yourAnswerToTheQuestion