Electronic – How to create encrypted spice subcircuit/schematic and use it as symbol in other schematics

spice

In LTspice XVIIx64 I want to create a subcircuit and use it in other schematics but the content of the subcircuit should not be visible to other users. The users are students who are advised to find out the content/components of a filter or resonant circuit by doing AC analysis.

I know how to create subcircuits in LTSpice and how to define symbols and use them in other schematics. However there is the disadvantage the I have to supply symbol and corresponding asy-Schematic in order that the symbol can be used in the top schematic. By suppling the asy-schematic the components values can be seen by opening the file. There is also the -encrypt function in LTspice as a xviix64.exe execution command and I am able to encrypt the underlining asy schematic. Creating a symbol for it and placing it in the top level schematic results in simulation that LTspice says: "Trouble generating netlist for SPICE run".

Are there any other possibilities to get this working?

Best Answer

The -encrypt command line switch is only valid for subcircuits, not schematics, or hierarchical schematics. As the manual says in Modes of Operation > Command Line Switches:

Encrypt a model library. For 3rdparties wishing to allow people to use libraries without revealing implementation details. Not used by Linear Technology Corporation models.

XVII.exe -encrypt /path/to/subcircuit.sub

The extension is really just for your convenience, LTspice will read the file and detect wether it's a schematic (.asc) or library (.sub, .lib, .net, .cir, etc). That is, LTspice will encrypt the file you provide, but when reading it must be of the subcircuit/netlist type.

Caveat emptor: the subcircuit will be deleted and replaced by the encrypted version! So if you still need your subcircuit to be avaliable to you, make a copy first, before encrypting.

Related Topic