encrypted - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Option encrypted in Procedures

 

Calling Sequence

Description

Examples

Calling Sequence

option encrypted

Description

• 

A procedure with option encrypted that has been loaded from a repository will have its source obfuscated so that it cannot be viewed or debugged.  This is useful when you want to share executable code, but do not want the user to see the source implementation.

• 

The first step in creating an encrypted procedure is to add encrypted to the option sequence of the procedure.

f := proc(x) option encrypted; x^2; end proc;

  

At this point the procedure is not yet encrypted.  It must be saved in a repository first.  Use the savelib command to save the given procedure.  In a subsequent session, if the saved repository has been added to libname, and f is loaded from that repository, then the source code of f can not be viewed.

Examples

sq := proc(x) option encrypted; x^2 end proc;

sqprocxoptionencrypted;x^2end proc

(1)

The source statements can be seen prior to saving:

evalsq

procxoptionencrypted;x^2end proc

(2)

Save the procedure named sq:

repocatFileTools:-TemporaryDirectory,/mysq.mla:

savelibsq,repo

Now restart your session to clear the current state.

restart

Add your saved repository to libname so you can access the procedure sq

repocatFileTools:-TemporaryDirectory,/mysq.mla:

libnamelibname,repo:

The procedure can be invoked as usual

sq5

25

(3)

But viewing and debugging commands are now disabled:

showstatsq

Error, (in showstat) cannot debug encrypted procedures

See Also

libname

MapleCloud

Procedure options

Procedures

repository