<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Use JSL to encrypt scripts for add-in development in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/382213#M63289</link>
    <description>&lt;P&gt;Thanks. That variable was left over from a first version, before I realized it wanted to be a JSON solution.&lt;/P&gt;&lt;P&gt;This is similar to what JMP does with a PER file (not JSON); you can lock in other variables too, like a user or site name, by adding them to the concatenation.&lt;/P&gt;&lt;P&gt;You should use ShowGlobals() after running your app to make sure your secret isn't too easy to discover.&lt;/P&gt;</description>
    <pubDate>Tue, 04 May 2021 13:37:50 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2021-05-04T13:37:50Z</dc:date>
    <item>
      <title>Use JSL to encrypt scripts for add-in development</title>
      <link>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/381447#M63201</link>
      <description>&lt;P&gt;I maintain a couple of add-ins and for some of those I would like update a couple of variables in the contained scripts at built time. So I would like to write a script that opens a script file, does some concatenations or substitutions and then encrypts the whole file and saves it to a certain location (for a list of script files). Then I can use the brilliant add-in builder by&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1855"&gt;@Justin_Chilton&lt;/a&gt;&amp;nbsp;to build the add-ins. I cannot find a JSL function to encrypt a script, does it exist or can it be done with another utility?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:45:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/381447#M63201</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2023-06-09T19:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Use JSL to encrypt scripts for add-in development</title>
      <link>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/381518#M63207</link>
      <description>&lt;P&gt;The Encrypt Script command can be passed through JSL using the Main Menu() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Main Menu( "encrypt script","Script 10" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;where "Script 10" is the name of the script window to be encrypted.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, what happens next, is the dialog window asking for the passwords pops up, and I don't think that is what you want&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 21:16:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/381518#M63207</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-04-30T21:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Use JSL to encrypt scripts for add-in development</title>
      <link>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/381534#M63208</link>
      <description>&lt;P&gt;Maybe use a jsl/jmp/plaintext file with just the values, and include() or open() or loadtextfile() from the encrypted script.&lt;/P&gt;&lt;P&gt;A small data table could be a good choice for a set of named parameters. Or a snippet of JSL that is included to set some variables. A file named X.jsl with just the text 42 can be loaded as parm = include("x.jsl"); and you could do more complicated sets with a list if X contains {42,"Fred"}, something like {parm,name} = include("x.jsl");&lt;/P&gt;</description>
      <pubDate>Sat, 01 May 2021 00:07:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/381534#M63208</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-05-01T00:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Use JSL to encrypt scripts for add-in development</title>
      <link>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/381921#M63250</link>
      <description>&lt;P&gt;Thanks for the suggestions!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The idea is to create self destructing add-in that works for a while and after some date stops working (protect IP). So everytime I build the add-in I want a new expiry date hardcoded in the script so that this cannot be defeated by editing a date field somewhere. If I put the expiry date in a external script file I have to manualy encrypt that every time. For the same reason a data table is not an option.&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 15:47:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/381921#M63250</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2021-05-03T15:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Use JSL to encrypt scripts for add-in development</title>
      <link>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/381937#M63252</link>
      <description>&lt;P&gt;something like this?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;mySecretKey = "The quick brown fox";

aa = [=&amp;gt; ];
aa["expiredate"] = "1jan2022";
aa["checkcode"] = Hex( Blob MD5( Char To Blob( mySecretKey || expiredate ) ) );
Save Text File( "$temp/license.txt", As JSON Expr( aa ) );
///////////////////
bb = Parse JSON( Load Text File( "$temp/license.txt" ) );
If( Hex( Blob MD5( Char To Blob( mySecretKey || bb["expiredate"] ) ) ) == bb["checkcode"],
	Print( "ok: " || bb["expiredate"] ),
	Print( "bad" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;embed the secret key in the encrypted script so you can check it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the file looks like&lt;/P&gt;&lt;P&gt;{"checkcode":"B7611676E821AA1ECC4CB5D6F02C6BA9","expiredate":"1jan2022"}&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 17:08:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/381937#M63252</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-05-03T17:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Use JSL to encrypt scripts for add-in development</title>
      <link>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/382205#M63288</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;that is an interesting solution embedding the expiry date and a checksum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Small fix for a coding error in line 5:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;mySecretKey = "The quick brown fox";

aa = [=&amp;gt; ];
aa["expiredate"] = "1jan2022";
aa["checkcode"] = Hex( Blob MD5( Char To Blob( mySecretKey || aa["expiredate"] ) ) );
Save Text File( "$temp/license.txt", As JSON Expr( aa ) );
///////////////////
bb = Parse JSON( Load Text File( "$temp/license.txt" ) );
If( Hex( Blob MD5( Char To Blob( mySecretKey || bb["expiredate"] ) ) ) == bb["checkcode"],
	Print( "ok: " || bb["expiredate"] ),
	Print( "bad" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 May 2021 13:06:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/382205#M63288</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2021-05-04T13:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Use JSL to encrypt scripts for add-in development</title>
      <link>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/382213#M63289</link>
      <description>&lt;P&gt;Thanks. That variable was left over from a first version, before I realized it wanted to be a JSON solution.&lt;/P&gt;&lt;P&gt;This is similar to what JMP does with a PER file (not JSON); you can lock in other variables too, like a user or site name, by adding them to the concatenation.&lt;/P&gt;&lt;P&gt;You should use ShowGlobals() after running your app to make sure your secret isn't too easy to discover.&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 13:37:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-JSL-to-encrypt-scripts-for-add-in-development/m-p/382213#M63289</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-05-04T13:37:50Z</dc:date>
    </item>
  </channel>
</rss>

