简体   繁体   English

如何防止复制Web应用程序界面代码(HTML + JavaScript)

[英]How prevent copying web application interface code (HTML+JavaScript)

I'm creating web application that use rest web api (ASP.NET Web Api) for all buisness logic. 我正在创建将Rest Web API(ASP.NET Web Api)用于所有商务逻辑的Web应用程序。 Thus web application is only cover for this rest api. 因此,Web应用程序仅覆盖此其余api。

I found no reason to use any platform except simple html files, because: I have base html page that dynamicaly load all parts of html interface using jquery.get(). 我发现没有理由使用除简单html文件之外的任何平台,原因是:我拥有基本的html页面,该页面使用jquery.get()动态加载html接口的所有部分。 And i have client side knockout.js code that interprets json data from web api to rich, fast interface. 我有客户端基因敲除.js代码,可将json数据从网络api解释为丰富,快速的界面。

I know that there is no way to 100% secure code of my app. 我知道没有办法100%保护我的应用程序的代码。

But if malicious user download all HTML files, all CSS files, and all JavaScript files, he can get fully functional platform independed clone of my app. 但是,如果恶意用户下载了所有HTML文件,所有CSS文件和所有JavaScript文件,则他可以获得与我的应用程序完全独立的平台克隆。 That work with my api or work with mock api. 可以使用我的api或使用模拟api。 He can change logo and put to web. 他可以更改徽标并放到网上。

I have only one idea for solving this problem: 对于解决这个问题,我只有一个主意:

  1. Use google closure compiler for obfuscating and minifying javascript. 使用Google Closure编译器来混淆和缩小JavaScript。
  2. Obfuscate styles in css and html files. 在CSS和HTML文件中混淆样式。
  3. Create new routing system that encript urls to web api for any connection. 创建新的路由系统,该系统将任何连接的URL都编码为Web api。

    from: site.omg/api/employees/1324 to: site.omg/api/kghsfjhgsadf 从: site.omg / api / employees / 1324 到: site.omg / api / kghsfjhgsadf

  4. also create new routing for html parts. 还为html部件创建新的路由。

    from: site.omg/main/navigationPart.html to: site.omg/asfdsaf 从: site.omg / main / navigationPart.html 到: site.omg / asfdsaf


There are any "best practies" for prevent copying code of web app interface? 有什么“最佳实践”可以防止复制Web应用程序界面的代码?

preffered technologies: .net, java, node.js 首选技术:.net,java,node.js

Everything that can be obfuscated by a process, can be de-obfuscated by another process. 可以被一个进程混淆的所有事物都可以被另一个进程去混淆。

How safe is it? 有多安全? It is not. 它不是。

But you have not explained what the threat model is. 但是您尚未说明威胁模型是什么。 How can it be misused by understanding the javascript? 理解JavaScript怎么会滥用它? Is the problem confidentiality, integrity or identity? 问题是机密性,完整性还是身份性?

HTTP has something for all of this. HTTP具有所有这些功能。 Various HTTP-based identity schemes such as OAuth or even basic authentication exists while SSL can provide you with confidentiality and integrity. 存在各种基于HTTP的身份方案,例如OAuth甚至基本身份验证,而SSL可以为您提供机密性和完整性。

I personally find a few solutions for complex (html+css+javascript) obfuscating html apps. 我个人发现了一些复杂的(html + css + javascript)混淆html应用程序的解决方案。

  1. JScrambler Web-Service for protection web and mobile apps with many features (like canvas protection and domain code locks). JScrambler Web服务,用于保护具有许多功能(例如画布保护和域代码锁定)的Web和移动应用程序。
  2. Html-muncher Free python console utility for code obfuscation. Html-muncher用于代码混淆的免费python控制台实用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM