Roundcube Community Forum

 

encrypt and decrypt messages in Roundcube

Started by tobiaszliszka, January 18, 2011, 03:28:26 PM

Previous topic - Next topic

tobiaszliszka

Does some plugin exist, or there is the possibility of the implementation of some easy sctipt encrypting and decrypting messages: mcrypt, pgp or any different ??

Something in like this:

<?php
$data 
"mesage";
$key "password";
$td MCRYPT_RIJNDAEL_256

$iv_size mcrypt_get_iv_size($tdMCRYPT_MODE_ECB); 
$iv mcrypt_create_iv($iv_sizeMCRYPT_RAND); 

echo 
"Original data: $data 
"
;

$encrypted_data mcrypt_encrypt($td$key$dataMCRYPT_MODE_CBC$iv); 

echo 
"Encrypted data: " bin2hex($encrypted_data)  . "
"



$data mcrypt_decrypt($td$key$encrypted_dataMCRYPT_MODE_CBC$iv); // decrypts data
echo trim($data);
?>


How i can use this script, or any different??