PHP Classes
elePHPant
Icontem

decrypt does not work?

Recommend this page to a friend!

      TxtCrypt  >  All threads  >  decrypt does not work?  >  (Un) Subscribe thread alerts  
Subject:decrypt does not work?
Summary:encrypt works but not decrypt
Messages:4
Author:Andhika
Date:2005-04-03 07:39:22
Update:2005-07-27 02:47:38
 

 


  1. decrypt does not work?   Reply   Report abuse  
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";

?>

  2. Re: decrypt does not work?   Reply   Report abuse  
Chao-Chyuan Shih - 2005-04-05 23:20:26 - In reply to message 1 from Andhika
I have tried both your encryption and decryption script from the command line. Both of them works fine for me. If you could send me your encrypted file, I might be able to tell you what is going on.

By the way, did you run the PHP script under Windows or Linux?

Please send your file to:
chao@elgorithms.com

  3. Re: decrypt does not work?   Reply   Report abuse  
Andhika - 2005-04-06 02:33:04 - In reply to message 2 from Chao-Chyuan Shih
the readme file only contains this one line :
"This is a dummy readme file used in the _test*.php files."

I tried it in WIndows, inside the NuSphere PHPEd. Sorry that I din't tell you earlier. It was inside this IDE that it didn't work. It works fine in IE.

Thanks

  4. Re: decrypt does not work?   Reply   Report abuse  
yongjin jiang - 2005-07-27 02:47:38 - In reply to message 2 from Chao-Chyuan Shih
I always get "Incorrect input data" error when decrypt.
(win2k+apache1324+php433+webexample)