There was an old thread 2001 that never really answered the question completely so I thought I would reopen it.
I have a file in the Linux PHP world I want to encrypt send it to a Windows system where they will decrypt it for further processing.
I can encrypt easily on my side using mcrypt as seen in this test snippet of code
<?php
function encryptData($value){
$key = "top secret key";
$text = $value;
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
return $crypttext;
}
function decryptData($value){
$key = "top secret key";
$crypttext = $value;
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypttext, MCRYPT_MODE_ECB, $iv);
return trim($decrypttext);
}
$source = "This is a test of the emergency broadcast system";
$sample = encryptData($source);
echo $sample;
echo'<BR><BR>';
$outfile = decryptData($sample);
echo $outfile;
?>
What I need to do is after the file gets encrypted I FTP it to the Windows world and it gets decrypted and processed.
How can I get this accomplished, admittedly, my encryption knowledge is severely limited.
Jeff