JavaScript 加密
该脚本必须搜索网页内的字符串。但该脚本不应显示它正在搜索的字符串。我的意思是搜索字符串应该采用加密格式或任何其他格式。 但如果没有该搜索字符串,则不应显示网页,或者应在页面上显示错误。
我打算开发一个插件。如果有人在他们的网页中使用该插件,他们必须并且应该将我的名字或我的网站名称放在该页面中。
是否可能,如果可以,如何加密脚本内的文本(srikanth)以及如何在页面内搜索该字符串。
有多少种可能性可以用 javascript 或 jquery 将我的名字放在网页中,但它不应该像任何人在源代码中检查它时那样可见
the script has to search a string inside the webpage. but that script should not display what string that it is searching. I mean the search string should be in encrypted format or any other format.
but without that search string the webpage should not be displayed or it should display an error on page.
I am going to develop a plugin. If anybody using that plugin in their webpage they must and should place my name or my website name in that page.
is it possible, if so how to encrypt my text (srikanth) inside the script and how to search that string inside the page.
how many possibilities are there to place my name in a webpage with javascript or jquery but it should not visible as it is when anybody check it in source code
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
没有办法隐藏你的名字。如果浏览器可以看到它,那么任何用户也可以。
您可以按照自己喜欢的方式加密您的姓名。但当然,它需要在客户端解密才能实际进行搜索。因此,任何拥有 JavaScript 调试器的人都可以立即发现您的名字。
或者稍微晦涩一点,您可以在服务器端对您的名称进行哈希处理,在 JavaScript 中对页面内容进行哈希处理,然后进行搜索。给定一个合适的哈希值,发生冲突的机会就会很小。但是,使用调试器,您仍然可以毫无问题地找出搜索字符串。说实话,这听起来很荒谬。
无论你想要实现什么目标,都需要重新考虑。
There is no way of hiding your name. If the browser can see it, then so can any user.
You can encrypt your name anyway you like. But of course it needs to be decrypted client-side to actually do the search. So anyone with a javascript debugger could uncover your name in moments.
Or slightly more obscurity you could hash your name server-side, in javascript hash the page contents, and then do your search. Given a decent hash the chance of collisions will be small. However, with a debugger you could still figure out the search string no problem. And to be honest this just sounds absurd.
Whatever you're trying to achieve needs to be re-thought.
任何人都可以查看 Javascript 源代码,因此实际上不可能以安全的方式使用 Javascript 来加密某些内容。你可以混淆它,通常以可怕的方式,但它总是有可能逆转。
如果可以,请在服务器上执行任何需要一定程度安全性的操作。
Anyone can view Javascript source code, therefore it's not really possible to encrypt something using Javascript in a way that is secure. You can obfuscate it, often in horrible ways, but it's always possible to reverse.
If you can, do anything requiring a modicum of security on the server.
由于您无法真正加密一段文本,因此您可以混淆搜索并进行检查。
如果有人查看源代码,他们第一眼将无法看到搜索字符串,尽管正如之前提到的,这很容易逆转,但对于临时查看者来说,这会造成混淆。此外,如果编码数据被 css 隐藏(如本例所示)或隐藏表单字段,则它永远不会出现在未编码的页面或源上。
As you cant really encrypt a piece of text you can obfuscate the search and do a check.
If someone viewed the source they wouldn't at first glance be able to see the search string, though as it has mentioned before this would be easy to reverse it would obfuscate from the casual viewer. Also If the encoded data was hidden by css as in this example or a hidden form field it would never appear on the page or source un-encoded.
我正在开发一个库来简化我的日常任务,其中之一就是加密。
我使用凯撒加密进行元素加密。
您可以下载缩小文件并将其包含在您的 html 中。
用法就像:
I am developing a library to simplify my daily tasks, and one of which is encryption.
I am using caesar encryption for element encryptions.
you may download the minified file and include it in your html.
The usage is like: