TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

A technique for hiding your JavaScript code

62 点作者 pa7将近 13 年前

14 条评论

tagawa将近 13 年前
I can't help but feel saddened that we learned how to code using View Source (indeed, it's a big factor in the web's success) and now we're trying to prevent others doing the same.<p>Also, this seems like a surprisingly naive generalisation to me: "... a first measurement for preventing evil business guys from stealing your code – developers who can figure the code out are (mostly) kind enough not to steal it."
评论 #4313091 未加载
评论 #4311997 未加载
dlsym将近 13 年前
This is a really good Idea! I will implement this in my site, where I blocked the right mouse-klick so nobody can steal my images!!11
评论 #4312027 未加载
Kartificial将近 13 年前
Fun solution to a useless problem. Trying to hide your JS/HTML code is silly and pretty 1999-like.
评论 #4311890 未加载
mistercow将近 13 年前
&#62;My JS code is an array of characters, a character has an ASCII code which lies in the range from 0 to 255<p>Your JS code may happen to be ASCII only, but in the context of ECMAScript, a character is actually a Unicode code unit.
maebert将近 13 年前
Bonus points for not just creating an image, but hiding the code steganographically in an existing image (ie only using the LSB of each pixel to hide code)!
评论 #4312088 未加载
评论 #4311937 未加载
评论 #4316012 未加载
Negitivefrags将近 13 年前
Here is an interesting application of this idea <a href="http://www.p01.org/releases/MATRAKA/matraka.png.html" rel="nofollow">http://www.p01.org/releases/MATRAKA/matraka.png.html</a>
exDM69将近 13 年前
Sure the beef of your code is hidden in image data but since the extraction method has to be exposed in regular JavaScript code, it's kinda useless.
RoryH将近 13 年前
If you are willing to use HTML5 'magic', could you not stream the JS down via a web socket and then execute it? That would prevent most of the conventional HTTP intercepts from having access to the code.
retube将近 13 年前
But won't web developer or similar show you any generated javascript?
评论 #4311995 未加载
noarchy将近 13 年前
If someone is clever enough to hide their JavaScript like this, then they hopefully know that it isn't foolproof. In other words, don't rely on obfuscating your code for anything related to security (as an example).
评论 #4312833 未加载
maebert将近 13 年前
Hm, has anybody thought of QR codes containing javascript already?
sisk将近 13 年前
This is the exact same process used by <a href="http://hid.im" rel="nofollow">http://hid.im</a> to encode a torrent file into a PNG (not for obfuscation, mind you).
darkstalker将近 13 年前
This might be useful as a way to reduce your code size using the image's compression algorithm
评论 #4312522 未加载
评论 #4312497 未加载
chinchang将近 13 年前
So after you get the code string, how do we run it? eval()?