Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Encrypting a Net argument
#1
Hi,
I have been sucessfully sending a string between two computers using the net function e.g.

Code:
Copy      Help
net(sampleIP "password" "TargetFunction" 0 SampleString)

and receiving it as:


Code:
Copy      Help
function $SampleString


on the receiving computer.

I would like now to encrypt the string when passing it over the network.

For some reason the encrypt/decrypt function is not working.


I have tried:

Code:
Copy      Help
str SampleString SampleEncryptionKey
SampleString.encrypt(1 SampleString SampleEncryptionKey)
net(sampleIP "password" "TargetFunction" 0 SampleString)

and on receiving end decrypting it with same function in the Target function on the receiving computer. For some reason, however, I keep on receiving an empty string in the receiving function.

Any ideas on what the right way to do this would be great!

Stuart
#2
Probably because encrypt(1 creates binary string. Use encrypt(1|4 and decrypt(1|4.
#3
Exactly - works beautifully now - I will have to read up more about the different encryption methods you describe in the Helpfile

So glad this was possible as data protection is crucial in healthcare!!!!!

Thank you!

Stuart
#4
when using net like this does the recieving computer have to be on the same network connection (whether connected wirelessly or hard wired) as you?
#5
no
#6
ok i cannot understand why i can never get net to work when sending from 1 computer to another unless it was on my network.
#7
I saw this in the help file:
Quote:To identify a computer on the Internet, is used different IP address than in local network. You may see several IP addresses in the Network dialog. The first probably is the network IP. Internet IP's often are dynamic, that is, your Internet Service Provider assigns your computer a different IP address each time you connect to the Internet.

Do you think your issue might be dynamic IP address?

Stuart
#8
Not completely sure because it seems to be the same each time i open the options dialog.
#9
Can you send a folder in qm to qm on the other computer instead of just sending the macro/function?
#10
computer 1:
SilentExport
getfile
net

computer2:
setfile
SilentImport
#11
ok got that.
why everytime i run set or getfile functions with net, they fail?
#12
net_SetFile - working
net_GetFile - not working

any ideas why set works but get doesnt work?
#13
cannot answer, you don't show the code

--------------------------------------------

this is working example
Macro (on computer 1)
Code:
Copy      Help
str comp="x"
str pas="x"

if(!SilentExport("folder_x" "$temp$\folder_x.qml" 8)) end "failed"
str s.getfile("$temp$\folder_x.qml")
str sr
int r=net(comp pas "receiving_function" sr s)
if(r) end "failed, %i" 0 r

Function receiving_function (on computer 2)
Code:
Copy      Help
;\
function# str's

s.setfile("$temp$\folder_x.qml")
if(!SilentImport("$temp$\folder_x.qml")) end "failed"
#14
everytime i run that i get this...

Error (RT) in Macro2: failed, 4
#15
you did not create receiving_function on computer 2
#16
i feel stupid :lol: spelled it wrong by mistake.
thanks gint.
#17
Gint, do you have an idea why net function will not work when i try and use it between someone who is not on the same network as me?

Regards
#18
Possibly a firewall stops it.

Generally net was created for local network. The fact that sometimes it also may work on internet was something unwanted because of security, but I didn't know a way how to prevent it.
#19
What is the return value

int return=net("" "" "")
out return.

are they behind a router? if so you would need to forward the port.
#20
We have multiple carts called COW's (Computer On Wheels) where i work.
Each has it's own network (COW1, COW2, COW3 and so on).
Was trying to be able to send something between different laptops even if it was connected to a different network.
I figured it out lastnight though, thanks guys.
#21
I tried the above code, but I can't run successfully. I hope someone can guide me where I am wrong. Huh

In the process of setting up, the firewall security prompt pops up, I choose to allow


Attached Files Image(s)
   
#22
Has anyone encountered the above situation? I tested it many times and it has not been successful. Confused


Forum Jump:


Users browsing this thread: 1 Guest(s)