The no-code toolkit has been released, allowing users to hide code in Python scripts. The transformed script appears in code editors as a single line "# coding: no" without any other content, yet it still runs and performs its original functions. The toolkit is inspired by the humorous No Code philosophy, which suggests that the best way to create safe and reliable applications is to have no code at all. While this philosophy has its merits, sometimes it's necessary for a program to perform certain actions. No-code addresses this issue by enabling the distribution of 'code-free' programs that can still execute actions.
The obfuscation method is based on encoding content using two Unicode characters with zero width (invisible spaces 0x200B and 0x200C). One invisible character represents "0", and the other represents "1". $ cat some_code.py print("Hello, world!") $ no_code some_code.py > no_code.py $ cat no_code.py # coding: no $ python no_code.py Hello, world! $ yes_code no_code.py > some_code.py $ cat some_code.py print("Hello, world!")
The line "# coding: no" in the script with hidden code indicates the use of an encoding named 'no' — the keyword "coding:" is used in Python to specify the source code encoding. To run the transformed script, the 'no_code' Python package must be installed, which includes a file named 'no.pth' that is called when using the encoding named 'no' for decoding before passing it to the parser. To hide not the entire file but specific portions of code, the toolkit provides the functions no_code.nothing() and no_code.something().
Similar projects include the Perl module Acme::Bleach, which transforms code into a representation of spaces and tabs, and the JavaScript library INVISIBLE.js, which allows for code obfuscation through encoding into zero-width characters.
Source: opennet.ru
