You are not logged in.

BH7NLJ

Beginner

  • "BH7NLJ" started this thread

Posts: 7

Location: Shenzhen GD, China

Occupation: Education

  • Send private message

1

Monday, May 22nd 2017, 7:07pm

How can I encrypt xml file on server side by asp?

HI, everybody:

I have a windows server and a asp website.
I want to encrypt my xml file on server side by asp with aspexec.dll(a component that execute the windows program by asp).

I can operated makepano or encrypt "* droplet.bat" by asp with aspexec.dll befor krpano 1.16.9,
when krpano upgraded to 1.19.x, I just operate makepano but don't encrypt. Why?

Would you mind give me some good suggestions? thank you very much!

This post has been edited 5 times, last edit by "BH7NLJ" (May 23rd 2017, 1:27pm)


reza_shnia

Intermediate

Posts: 169

Occupation: krpano freelancer || creating ideas & coding them || krpano developer

  • Send private message

BH7NLJ

Beginner

  • "BH7NLJ" started this thread

Posts: 7

Location: Shenzhen GD, China

Occupation: Education

  • Send private message

3

Tuesday, May 23rd 2017, 1:03pm

Thank you very much, reza_shnia!

I mean...
In krpano 1.16.9 and earlier version, there are tow programs, such as "kmakemultires.exe" and "kencrypt.exe".
I can operated all droplet.bat by asp with aspexec.dll [include "MAKE PANO (MULTIRES) droplet.bat" and "ENCRYPTXML.bat"],

In krpano 1.19.x there are tow programs too, such as "krpanotools32.exe" and "krpanotools64.exe", they are the same function actually .
So I just operate the droplet.bat for makepano [MAKE PANO (MULTIRES) droplet.bat] but don't the droplet.bat for encrypt [ENCRYPT XML droplet.bat] by asp with aspexec.dll . in other words, I can make panos but don't encrypt xml files.

This is my code sample by asp(in krpano 1.19.x):

1, for make panos

Source code

1
2
3
4
5
6
7
8
9
10
<%  
dim aspexe,strResult  
set aspexe  = server.createObject("aspexec.execute")  
aspexe.application = "full\path\to krpanotools\MAKE PANO (MULTIRES) droplet.bat "  
aspexe.parameters = "full\path\to myproject\panoroma.jpg"  
aspexe.showwindow = true  
response.write("try to running the program:"&aspexe.application&"<br>")  
strResult = aspexe.ExecuteWinApp  
response.write(strResult) 
%>
the Result for make panos are "Ok"


2, for encrypt

Source code

1
2
3
4
5
6
7
8
9
10
<%  
dim aspexe,strResult  
set aspexe  = server.createObject("aspexec.execute")  
aspexe.application = "full\path\to krpanotools\ENCRYPT XML droplet.bat "  
aspexe.parameters = "full\path\to myproject\tour\tour.xml"  
aspexe.showwindow = true  
response.write("try to running the program:"&aspexe.application&"<br>")  
strResult = aspexe.ExecuteWinApp  
response.write(strResult) 
%>
the Result for encrypt is "Not"


I need the solution for ENCRYPT my xml file.

Regards

This post has been edited 10 times, last edit by "BH7NLJ" (May 23rd 2017, 1:51pm)


reza_shnia

Intermediate

Posts: 169

Occupation: krpano freelancer || creating ideas & coding them || krpano developer

  • Send private message

4

Wednesday, May 24th 2017, 2:00pm

This is what i use in php :

Source code

1
exec(__DIR__ . "/krpanotools64.exe encrypt -in=file.xml  -out=export.xml", $output, $result);

It works for me!

BH7NLJ

Beginner

  • "BH7NLJ" started this thread

Posts: 7

Location: Shenzhen GD, China

Occupation: Education

  • Send private message

5

Thursday, May 25th 2017, 4:23am

Great!
Maybe I'll try to change by PHP

6

Thursday, May 25th 2017, 9:42am

调用droplet跟调用krpanotools 是有区别的

用 reza_shnia 直接调用krpanotools的方式更好

BH7NLJ

Beginner

  • "BH7NLJ" started this thread

Posts: 7

Location: Shenzhen GD, China

Occupation: Education

  • Send private message

7

Thursday, May 25th 2017, 10:57am

嗯,是的。
非常感谢你的指点。

BH7NLJ

Beginner

  • "BH7NLJ" started this thread

Posts: 7

Location: Shenzhen GD, China

Occupation: Education

  • Send private message

8

Saturday, May 27th 2017, 9:02pm

Hi, reza_shnia

do you think my codes are correct?

Source code

1
2
3
4
5
6
7
8
9
10
<?php
$KRPANOTOOLSEXE = __DIR__ . '\\krpanotools64.exe encrypt -h5 ';
$IFILE = __DIR__ . '\\pano.xml ';
$OFILE = __DIR__ . '\\panoe.xml';

exec($KRPANOTOOLSEXE . '-in=' . $IFILE . '-out=' . $OFILE, $output, $return_var);

echo($return_var . '<br>');
echo($KRPANOTOOLSEXE . '-in=' . $IFILE . '-out=' . $OFILE);
?>

the $return_var=1

but when I use the output codes by php to running in the CMD, that is OK



by the way
I set disable_functions in php.ini like this:

Source code

1
2
3
4
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions =

and the IIS_IUSRS's security right for cmd.exe is "modify"

This post has been edited 6 times, last edit by "BH7NLJ" (May 27th 2017, 9:37pm)