afAxonEncryptorExt icon

afAxonEncryptorExt

Encrypts and obfuscates Axon functions and components
afAxonEncryptorExtAxon funcs

Registered StackHub users may elect to receive email notifications whenever a new package version is released or a comment is posted on the forum.

There is 1 watcher.

v2.0.8

afAxonEncryptor_encryptFunc
afAxonEncryptor_encryptFunc(funcRec, passPhrase, keyFunc: null, options: null)

Encrypts the given function record by obfuscating the src field.

passPhrase is a seed string that's used to generate the actual runtimeKey used to encrypt the axon source code.

Example:

{func, name:"fnName", src:"()=>69"}.afAxonEncryptor_encryptFunc("<passPhrase>")

Returns a Dict which contains, amongst other fields, the runtime key needed to run the function.

By default, the encrypted source contains the runtimeKey which is fine for obfuscation and general purpose use. Alternatively a keyFunc may be passed in. The keyFunc should either be a Str of Axon code, or a Fn that returns a Str of Axon code, that when executed returns the runtimeKey. Also see afAxonEncryptor_stackhubKeyFunc.

If keyFunc is an Axon Fn it is called with two arguments: fnName and runtimeKey.

If not passed, the default options are:

opts : {
  // If false, prevents the 'afAxonEncrypted' tag from being added to encrypted functions.
  addEncryptedTag : true,

  // The max number of characters in each line of cipher text.
  cipherSplit : 80,

  // Render cipher text as one multi-line Axon string. (Requires afAxonEncryptorRtExt 2.0.6+)
  multiLineCipher : false,

  // Encrypt Axon Components
  encryptComps : true,
}
Fantom signature:
@Axon static Dict afAxonEncryptor_encryptFunc(Dict funcRec, Str passPhrase, Obj? keyFunc := null, Dict? options := null)
afAxonEncryptor_encryptTrioFile
afAxonEncryptor_encryptTrioFile(trioFile, outputDir, passPhrase, keyFunc: null, options: null)

Encrypts the given Trio file of Axon functions.

Example:

afAxonEncryptor_encryptTrioFile(`io/funcs.trio`, `io/build/`, "<passPhrase>")

trioFile is the file to be encrypted.

passPhrase is a seed string used to generate a runtimeKey that is used to execute the encrypted source code.

Returns a Dict which contains, amongst other fields, the runtime key needed to run the functions.

By default, the encrypted source contains the runtimeKey which is fine for obfuscation and general purpose use. Alternatively a keyFunc may be passed in. The keyFunc should either be a Str of Axon code, or a Fn that returns a Str of Axon code, that when executed returns the runtimeKey. Also see afAxonEncryptor_stackhubKeyFunc.

If keyFunc is an Axon Fn it is called with two arguments: fnName and runtimeKey.

If not passed, the default options are:

opts : {
  // If false, prevents the 'afAxonEncrypted' tag from being added to encrypted functions.
  addEncryptedTag : true,

  // The max number of characters in each line of cipher text.
  cipherSplit : 80,

  // Render cipher text as one multi-line Axon string. (Requires afAxonEncryptorRtExt 2.0.6+)
  multiLineCipher : false,

  // Encrypt Axon Components
  encryptComps : true,
}
Fantom signature:
@Axon static Dict afAxonEncryptor_encryptTrioFile(Uri trioFile, Uri outputDir, Str passPhrase, Obj? keyFunc := null, Dict? options := null)
afAxonEncryptor_stackhubKeyFunc
afAxonEncryptor_stackhubKeyFunc(stackHubPkg)

Returns a keyFunc function that finds a valid StackHub licence for the given package (name and version) and returns the runtimeKey property from that licence.

The returned keyFunc can only be used with encryption functions.

Example:

keyFunc   : afAxonEncryptor_stackhubKeyFunc("pkgName 1.0")
encrypted : afAxonEncryptor_encryptTrioFile(`io/funcs.trio`, "<passPhrase>", keyFunc)
Fantom signature:
@Axon static Obj afAxonEncryptor_stackhubKeyFunc(Str stackHubPkg)
Published by Fantom Factory

Products & Services by Fantom Factory

Packages by Fantom Factory

Commercial packages

Free packages