Decryption Data after getting from database
Decryption Data after getting from database
asif_shahzad87
Posts: 3Questions: 0Answers: 0
HI all,
I am using datatables and i want to decrypt data after getting it from database. how can i do this ..... ? There is no issue in getting data from database. i am facing problems in decrypting data after getting it from database, in other words i want to convert javascript string into php string to decrypt it.
Here is my code ......
[code]
$('#example1').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "Server-Processing.php?colums=<?php echo $str ?>&&table=<?php echo $table ?>&&where_clause=<?php echo $WHERE ?>&&unique=<?php echo $unique_colum ?>",
"bAutoWidth": false,
"sDom": '<"H"Tfr>t<"F"ip>',
"aoColumns": [
{
"sName": "ID",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
return "" + oObj.aData[0] + "";
}
},
{
"sName": "test",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
[quote] <?php echo mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, 'oObj.aData[1] ', MCRYPT_MODE_ECB, $iv) ?> ; [/quote]
}
..........................................
......................................
.............
[/code]
[quote] Note: I am using PHP to encrypt and decrypt data [/quote]
Thanks in advance
I am using datatables and i want to decrypt data after getting it from database. how can i do this ..... ? There is no issue in getting data from database. i am facing problems in decrypting data after getting it from database, in other words i want to convert javascript string into php string to decrypt it.
Here is my code ......
[code]
$('#example1').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "Server-Processing.php?colums=<?php echo $str ?>&&table=<?php echo $table ?>&&where_clause=<?php echo $WHERE ?>&&unique=<?php echo $unique_colum ?>",
"bAutoWidth": false,
"sDom": '<"H"Tfr>t<"F"ip>',
"aoColumns": [
{
"sName": "ID",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
return "" + oObj.aData[0] + "";
}
},
{
"sName": "test",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
[quote] <?php echo mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, 'oObj.aData[1] ', MCRYPT_MODE_ECB, $iv) ?> ; [/quote]
}
..........................................
......................................
.............
[/code]
[quote] Note: I am using PHP to encrypt and decrypt data [/quote]
Thanks in advance
This discussion has been closed.
Replies
Allan
In given example, i just want to to convert javascript string say "abc" into php string say $xyz
<?php
var abc = oObj.aData[1];
$xyz = abc;
mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $xyz, MCRYPT_MODE_ECB, $iv)
?>