# Commercial codes using Julia - code obfuscation?

**URL:** <https://discourse.julialang.org/t/commercial-codes-using-julia-code-obfuscation/12429>\
**Category:** General Usage\
**Tags:** cryptography\
**Created:** [July 17, 2018, 10:39am UTC](https://discourse.julialang.org/t/commercial-codes-using-julia-code-obfuscation/12429 "2018-07-17T10:39:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [July 17, 2018, 1:57pm UTC](https://discourse.julialang.org/t/commercial-codes-using-julia-code-obfuscation/12429/2 "2018-07-17T13:57:57Z")

</div>

One can off-course trivally encode julia so it is nonobvious what is being done.  
But ofcourse one has to ship a decoder to

so `using Base64; using Distributed`  
we can do `eval(Distributed.deserialize(Base64.Base64DecodePipe(IOBuffer("N0pMBwQAAAAWAgEFYmxvY2sX4QEIUkVQTFsxOV0WAgEIZnVuY3Rpb24WAVYBCGZpenpidXp6FgIBBWJsb2NrF+IsAQAWAgEDZm9yFgJZAQJpaRYDVgEBOuAxZAAAABYCAQVibG9jaxfjLAEAFgMBAmlmFgUBCmNvbXBhcmlzb24WA1YBASUBAmlp4loWA1YBASUBAmlp5FrfFgIBBWJsb2NrF+QsAQAWAlYBB3ByaW50bG4hCEZpenpCdXp6FgMBBmVsc2VpZhYCAQVibG9jaxflLAEAFgNWWhYDVgEBJQECaWni3xYCAQVibG9jaxfmLAEAFgJWAQdwcmludGxuIQRGaXp6FgMBBmVsc2VpZhYCAQVibG9jaxfnLAEAFgNWWhYDVgEBJQECaWnk3xYCAQVibG9jaxfoLAEAFgJWAQdwcmludGxuIQRCdXp6FgIBBWJsb2NrF+osAQAWAlYBB3ByaW50bG4BAmlp"))))`

and you have no idea what it says.  
But you do know that you can find out:

```julia
julia> Distributed.deserialize(Base64.Base64DecodePipe(IOBuffer("N0pMBwQAAAAWAgEFYmxvY2sX4QEIUkVQTFsxOV0WAgEIZnVuY3Rpb24WAVYBCGZpenpidXp6FgIBBWJsb2NrF+IsAQAWAgEDZm9yFgJZAQJpaRYDVgEBOuAxZAAAABYCAQVibG9jaxfjLAEAFgMBAmlmFgUBCmNvbXBhcmlzb24WA1YBASUBAmlp4loWA1YBASUBAmlp5FrfFgIBBWJsb2NrF+QsAQAWAlYBB3ByaW50bG4hCEZpenpCdXp6FgMBBmVsc2VpZhYCAQVibG9jaxflLAEAFgNWWhYDVgEBJQECaWni3xYCAQVibG9jaxfmLAEAFgJWAQdwcmludGxuIQRGaXp6FgMBBmVsc2VpZhYCAQVibG9jaxfnLAEAFgNWWhYDVgEBJQECaWnk3xYCAQVibG9jaxfoLAEAFgJWAQdwcmludGxuIQRCdXp6FgIBBWJsb2NrF+osAQAWAlYBB3ByaW50bG4BAmlp"))) quote
    #= REPL[19]:2 =#
    function fizzbuzz()
        #= REPL[19]:3 =#
        for ii = 1:100
            #= REPL[19]:4 =#
            if ii % 3 == ii % 5 == 0
                #= REPL[19]:5 =#
                println("FizzBuzz")
            elseif #= REPL[19]:6 =# ii % 3 == 0
                #= REPL[19]:7 =#
                println("Fizz")
            elseif #= REPL[19]:8 =# ii % 5 == 0
                #= REPL[19]:9 =#
                println("Buzz")
            else
                #= REPL[19]:11 =#
                println(ii)
            end
        end
    end
end

```

Not really what you are getting at, I know.  
I just figured interesting.

Making a code obsufucator would be cool.  
It would be nice to be able to eval `CodeInfo` objects, and perform the obfuscation at that level.

---

_[View the full topic](https://discourse.julialang.org/t/commercial-codes-using-julia-code-obfuscation/12429)._
