cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
0 Kudos

Encrypt Script without data table need

Several scripts that I have made for operations have no data table associated with them, but rely on input dialogs where the user navigates to the necessary inputs for the script to run.

To improve on security, I have started thinking about encrypting the scripts so they can't be edited - or seen - in the case proprietary items may be involved. I haven't found any way in forums or the help guide to encrypt the whole script without knowing anything about a data table.

 

Thanks!

9 Comments
SamGardner
Level VII

Have you tried with the script open in a script editor choosing Edit > Encrypt Script?

nathan-clark
Level VI

Yes, that will encrypt the script fine. But it requires knowledge of that data table I want the script to run on ... so I get an error when I try to run the script because the script doesn't need a data table. The script prompts the user for inputs to gather information on tables, locations, etc.

 

What I would want / expect is that encrypting the script just encrypts and it runs as normal as if I just hit 'Run' with it open, or in an Addin.

Jeff_Perkinson
Community Manager

I'm not sure I understand Nathan. What seems to indicate that an encrypted script must know what data table to run on? My experience is that encrypting doesn't change the behavior of how the script runs at all.

 

Can you give an example of the kind of script you're having trouble with?

nathan-clark
Level VI

Hopefully the below snip comes through from the info on encrypting scripts.
The whole "you must know which data table the script runs on before running an encrypted script" is the issue.
For instance, in my most common scripts, when you click Run (via the run button or an addin) a modal dialog pops up and the user fills in the inputs (generally navigatijng to various file locations). Upon clicking OK the variables are gathered and the rest of the script continues. There is literally no way to know "which data table the script runs on"

I would expect that just encrypting that script would allow me to run it and the modal dialog to pop up as it normally would. This isn't the case and I get an error "Unable to open in Read Only Mode. The system cannot find the path specified. in access or evaluation of '<encrypted>' , "<encrypted>" /*###*/"

This error occurs after saving AND also if left alone or placed in the JSL Encrypted() function. I will see if I can't make a small script to illustrate my issues that I can pass along in both encrypted and normal formats.

nathanclark_0-1664562728689.png

 

Jeff_Perkinson
Community Manager

Thanks for the reference. However, I've no idea what that means or is referring to. Here's a small script that you can encrypt and run to see that it works. If you can come up with an example that doesn't, please post it here.

dt = Open();

New Window( "My Window",
	Text Box( "The file is" || (dt << get name) )
);
nathan-clark
Level VI

Yes, @Jeff_Perkinson , that does work... So, i've been trying small examples of what I thought was causing the problem and things are working perfectly well. I went back to my full script and it's still failing when I encrypt.

So, I'll have to digest and troubleshoot more to get a small version of a script which should fail on encryption (the existing script is interwoven with layers of functions so I'd rather not send over that whole thing if I don't have to )

Thanks for the help everyone, I'll send along an example soon!

nathan-clark
Level VI

Ok, I think I have something new... 
My whole script has some includes in it. I am guessing that an encrypted script can't include a non-encrypted script? And to include the script i'd need to encrypt that script, but include it kind of like this:

JSL Encrypted( include( "path to encrypted jsl to include" ) );  ... OR
JSL Encrypted( load text file( "path to encrypted jsl to include) );

I'll do some tests to see if I can get something like this to work ... but if there is a more clear answer, I'll take that too

nathan-clark
Level VI

So in doing my testing, it was a single line in my code:

pathMain = ConvertFilePath("");

I then use that variable to dynamically include files from the correct location:

include(pathMain||"/encryptIncludeTest1.jsl");

So, when I encrypted the file, I didn't save it OR save it in the right location forgetting that this would be imperative for the path to be correctly created so that the variable could be used and the file correctly included.

 

Thank you to everyone here, but I'd say this is solved (or at least this specific issue) and I respectfully retract my wish (I'm not sure if that's really a thing, but this was a me issue, not JMP)

Status changed to: Archived

Thank you for following up, @nathan-clark! I will archive this wish since it has been resolved.