Methods and computer program products for protecting interpreted-language
source code from unauthorized copying, alteration, distribution, or
reverse engineering, without regard to the choice of programming
language. A language identifier and the source code are input to an
encoding program, which provides an encrypted file that includes the
language identifier and source code. The encrypted file is input to a
decoding program. The decoding program decrypts the language identifier
and opens a suitable interpreter. The decoder then decrypts an encrypted
source code instruction and inputs the result to the interpreter, looping
through the instructions until reaching the end of the encrypted file,
passing decrypted instructions to the interpreter at a rate suitable for
execution by the interpreter substantially in real time. Thus a single
decoding program may be used with a number of different interpreted
languages, and with a number of existing interpreters.