Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望添加 ASAR 加密 | I want to add ASAR encryption #614

Open
4 tasks done
SanGongHappy opened this issue Sep 10, 2024 · 3 comments
Open
4 tasks done

希望添加 ASAR 加密 | I want to add ASAR encryption #614

SanGongHappy opened this issue Sep 10, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@SanGongHappy
Copy link

Clear and concise description of the problem

现阶段 electron-vite 使用的是 V8 字节码 保护代码,
Currently electron-vite uses V8 bytecode protected code,

在实际情况中,v8 字节码 虽然 能 很好的 保护源代码,但是对项目中其他文件并没有进行保护,
In practice, v8 bytecode protects the source code well, but does not protect other files in the project.

比如文件,图片,视频等,官方并未对这些本地文件进行加密,
Such as files, pictures, videos, etc., these local files are not officially encrypted,

虽说这种东西在运行软件的时候,就在页面中有显示,
Although this kind of thing shows up on the page when you run the software,

但是对于一个成熟的项目,还是需要对其进行象征性的保护
But for a mature project, it still needs to be symbolically protected

Suggested solution

https://github.com/toyobayashi/electron-asar-encrypt-demo

这个项目实现了 打包时做加密,运行时做解密,解密逻辑放 C++ 里,而且必须是最先加载,
This project implements encryption when packaging, decryption when running, decryption logic put in C++, and must be the first to load,

我感觉这个方式很好,是否可以用类似的方式实现对 electron-vite的加密呢?
I feel this way is very good, is it possible to use a similar way to implement the encryption of electron-vite?

Alternative

No response

Additional context

No response

Validations

@SanGongHappy SanGongHappy added the enhancement New feature or request label Sep 10, 2024
@Kenhuey
Copy link

Kenhuey commented Sep 11, 2024

感觉意义不大,强制调出控制台还是能获得已请求的资源

@SanGongHappy
Copy link
Author

主要问题是,现在很多解压软件,是支持解压asar文件的,有些用户会看文件夹中的内容,很容易就翻出来资源,而一般控制台用户是 不会使用的,就算会使用,可以禁止打开控制台
The main problem is that many decompression software now supports the decompression of asar files, some users will look at the contents of the folder, it is easy to turn out the resources, and the general console users will not use, even if they will use, you can prohibit the opening of the console

@chenyuncai
Copy link

可以在打包前,用自定已build脚本对静态资源加密一次,然后打包,然后运行时,项目初始化时你可以拦截任意资源的请求,并进行自定义解密后返回。我是打算这么干

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants