
 Andhika - 2005-04-03 07:39:23
the encrypt code was successful, but when i tried to decrypt it returns :
ERROR: Incorrect input data .
here's the decrypt code:
<?php
  include_once("TxtCrypt_Class.php");
  // To decrypt a file
  $encryptedFile = 'readme_with_TxtCrypt_Class.txt';
  $outputFile = 'TxtCrypt_Class_Decrypted.php';
  $key = 'A Secret Password';
  $txCrypt = new TxtCrypt();
  if (false == $txCrypt->Decrypt($encryptedFile, $outputFile, $key))
    echo $txCrypt->GetErrorMessage()."\n";
  else
    echo "$encryptedFile was decrypted and saved as $outputFile\n";
?>
my encrypt php:
<?php
  include_once("TxtCrypt_Class.php");
  // To encrypt and hide a file
  $fileCarrier = 'readme.txt';
  $fileToEncrypt = 'TxtCrypt_Class.php';
  $outputFile = 'readme_with_TxtCrypt_Class.txt';
  $key = 'A Secret Password';
  $txCrypt = new TxtCrypt();
  if (false == $txCrypt->Encrypt($fileCarrier, $fileToEncrypt, $outputFile, $key))
    echo $txCrypt->GetErrorMessage()."\n";
  else
    echo "$fileToEncrypt was encrypted and saved as $outputFile\n";
?>