{"id":6521,"date":"2016-01-22T09:00:25","date_gmt":"2016-01-22T14:00:25","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=6521"},"modified":"2016-01-25T21:29:58","modified_gmt":"2016-01-26T02:29:58","slug":"obfuscate-your-models","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2016\/01\/22\/obfuscate-your-models\/","title":{"rendered":"Obfuscate your models"},"content":{"rendered":"\r\n\r\n<div class=\"content\"><p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\">Jiro<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/54359-model-obfuscation-tool\">Model Obfuscation Tool<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3951648\">Atsushi Ohashi<\/a>.<\/p><p>Atsushi is a fellow MathWorker working out of the Nagoya office in Japan. He's part of the Pilot Engineering group, whose role is to help our key customers overcome technical challenges through deep engagements using MathWorks tools. Being in Japan, naturally our key customers tend to be in the automotive industry, where Simulink is heavily used.<\/p><p>As part of his job, from time to time his group needs to obtain Simulink models from our customers. Understandably, there are cases when our customers are hesitant on providing us with the models because of the confidential information (textual) included in the models. In many of those cases, simply obfuscating the textual information was enough to appease their concerns. Atsushi's tool does exactly that. In fact, the Japan Pilot Engineering team uses his tool for that purpose, and he thought he would make it more widely available.<\/p><p>The tool is very easy to use. Once you install it (there is an install script), a menu item is added to the Tools menu. Selecting the \"ModelObfuscationTool\" will bring up a dialog window, and clicking \"Run\" obfuscates your Simulink model.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_modelobfuscation\/model_obfuscation_example.png\" alt=\"\"> <\/p><p>Atsushi has included a nice help document, which should also get you started. He does state that there are cases where the operation may not succeed, so it's always good to check that the obfuscated model still runs.<\/p><p>By the way, here is an incomplete list of some other obfuscation techniques.<\/p><div><ul><li><a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/pcode.html\"><tt>pcode<\/tt><\/a> - obfuscate MATLAB function files.<\/li><li><a title=\"https:\/\/www.mathworks.com\/help\/simulink\/ug\/protecting-referenced-models.html (link no longer works)\">Protected Model<\/a> - protect your referenced model to hide your intellectual property. Requires <a href=\"https:\/\/www.mathworks.com\/products\/simulink-coder\/\">Simulink Coder<\/a>.<\/li><li><a href=\"https:\/\/www.mathworks.com\/products\/compiler\/\">MATLAB Compiler<\/a> - encrypt and compile your MATLAB programs as standalone executables and Excel&reg; add-ins. With <a href=\"https:\/\/www.mathworks.com\/products\/matlab-compiler-sdk\/\">MATLAB Compiler SDK<\/a>, you can also create compiled software components for integration with other environments.<\/li><li><a href=\"https:\/\/www.mathworks.com\/products\/matlab-coder\/\">MATLAB Coder<\/a>, <a href=\"https:\/\/www.mathworks.com\/products\/simulink-coder\/\">Simulink Coder<\/a>, and <a href=\"https:\/\/www.mathworks.com\/solutions\/embedded-code-generation.html\">family<\/a> - convert MATLAB code and Simulink models to other languages, such as C, and then you can compile them into binaries.<\/li><\/ul><\/div><p><b>Comments<\/b><\/p><p>Let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=6521#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/54359-model-obfuscation-tool#comments\">comment<\/a> for Atsushi.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_1bd06bee8a6a474b986822c6974c2606() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='1bd06bee8a6a474b986822c6974c2606 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 1bd06bee8a6a474b986822c6974c2606';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2016 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_1bd06bee8a6a474b986822c6974c2606()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2015b<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; R2015b<br><\/p><\/div><!--\r\n1bd06bee8a6a474b986822c6974c2606 ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\r\n% Jiro>'s pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/54359-model-obfuscation-tool Model\r\n% Obfuscation Tool> by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3951648 Atsushi\r\n% Ohashi>.\r\n%\r\n% Atsushi is a fellow MathWorker working out of the Nagoya office in Japan.\r\n% He's part of the Pilot Engineering group, whose role is to help our key\r\n% customers overcome technical challenges through deep engagements using\r\n% MathWorks tools. Being in Japan, naturally our key customers tend to be\r\n% in the automotive industry, where Simulink is heavily used.\r\n%\r\n% As part of his job, from time to time his group needs to obtain Simulink\r\n% models from our customers. Understandably, there are cases when our\r\n% customers are hesitant on providing us with the models because of the\r\n% confidential information (textual) included in the models. In many of\r\n% those cases, simply obfuscating the textual information was enough to\r\n% appease their concerns. Atsushi's tool does exactly that. In fact, the\r\n% Japan Pilot Engineering team uses his tool for that purpose, and he\r\n% thought he would make it more widely available.\r\n%\r\n% The tool is very easy to use. Once you install it (there is an install\r\n% script), a menu item is added to the Tools menu. Selecting the\r\n% \"ModelObfuscationTool\" will bring up a dialog window, and clicking \"Run\"\r\n% obfuscates your Simulink model.\r\n%\r\n% <<model_obfuscation_example.png>>\r\n%\r\n% Atsushi has included a nice help document, which should also get you\r\n% started. He does state that there are cases where the operation may not\r\n% succeed, so it's always good to check that the obfuscated model still\r\n% runs.\r\n%\r\n% By the way, here is an incomplete list of some other obfuscation\r\n% techniques.\r\n%\r\n% * <https:\/\/www.mathworks.com\/help\/matlab\/ref\/pcode.html |pcode|> -\r\n% obfuscate MATLAB function files. \r\n% * <https:\/\/www.mathworks.com\/help\/simulink\/ug\/protecting-referenced-models.html\r\n% Protected Model> - protect your referenced model to hide your\r\n% intellectual property. Requires\r\n% <https:\/\/www.mathworks.com\/products\/simulink-coder\/ Simulink Coder>.\r\n% * <https:\/\/www.mathworks.com\/products\/compiler\/ MATLAB Compiler> - encrypt\r\n% and compile your MATLAB programs as standalone executables and Excel(R)\r\n% add-ins. With <https:\/\/www.mathworks.com\/products\/matlab-compiler-sdk\/\r\n% MATLAB Compiler SDK>, you can also create compiled software components\r\n% for integration with other environments.\r\n% * <https:\/\/www.mathworks.com\/products\/matlab-coder\/ MATLAB Coder>,\r\n% <https:\/\/www.mathworks.com\/products\/simulink-coder\/ Simulink Coder>, and\r\n% <https:\/\/www.mathworks.com\/solutions\/embedded-code-generation.html family> -\r\n% convert MATLAB code and Simulink models to other languages, such as C,\r\n% and then you can compile them into binaries.\r\n%\r\n% *Comments*\r\n%\r\n% Let us know what you think\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=6521#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/54359-model-obfuscation-tool#comments\r\n% comment> for Atsushi.\r\n\r\n##### SOURCE END ##### 1bd06bee8a6a474b986822c6974c2606\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_modelobfuscation\/model_obfuscation_example.png\" onError=\"this.style.display ='none';\" \/><\/div><p>\r\n\r\nJiro's pick this week is Model Obfuscation Tool by Atsushi Ohashi.Atsushi is a fellow MathWorker working out of the Nagoya office in Japan. He's part of the Pilot Engineering group, whose role is... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2016\/01\/22\/obfuscate-your-models\/\">read more >><\/a><\/p>","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6521"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=6521"}],"version-history":[{"count":4,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6521\/revisions"}],"predecessor-version":[{"id":6600,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6521\/revisions\/6600"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=6521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=6521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=6521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}