
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
electron-builder-encryptor
Advanced tools
English | 简体中文
simple electron package encryption tool
electron-builder
, and does not affect development and debuggingapp.asar
filenpm i electron-builder-encryptor -D
# These 5 libraries need to be added to the project
npm i adm-zip bytenode mime original-fs yaml
Add afterPack
to electron-builder
configuration
// package.json
{
"build": {
"asar": true,
"afterPack": "node_modules/electron-builder-encryptor"
}
}
or
// electron-builder.json
{
"asar": true,
"afterPack": "node_modules/electron-builder-encryptor"
}
in mian process
if (!app.isPackaged) {
// address before packing
mainWindow.loadFile('renderer/index.html')
} else {
// address after packing
mainWindow.loadURL('myclient://apps/index.html')
}
Note: The renderer process that needs to be encrypted must be placed in the
renderer
folder under the directory where the entry filemain.js
is located
// encryptor.config.ts or encryptor.config.js
import { defineConfig } from 'electron-builder-encryptor'
export default defineConfig({
/**
* encryption key
*/
key: 'xxx000777',
})
all configuration
export declare interface UserConfig {
/**
* encryption key
*/
key?: string
/**
* renderer protocol scheme
* @default 'myclient'
*/
protocol?: string
/**
* electron custom schemes to be registered with options.
* @default
* {standard: true, secure: true, bypassCSP: true, allowServiceWorkers: true, supportFetchAPI: true, corsEnabled: true, stream: true}
*/
privileges?: Privileges
/**
* preload.js directory, with the program execution directory as the root node
* @default preload.js
*/
preload?: string | string[]
renderer?: {
/**
* renderer entry directory, with the program execution directory as the root node
* @default 'renderer'
*/
entry: string
/**
* The encrypted storage path of the rendering process, with the program execution directory as the root node
* @default 'resources/renderer.pkg'
*/
output: string
}
/**
* Synchronously detect whether the program has been tampered with when starting the app
*/
syncValidationChanges?: boolean
/**
* Automatically run the renderer process after the main process is started. After setting it to false, you can use the __runRenderer() method to start it manually.
* @default true
*/
autoRunRenderer?: boolean
}
In order to update renderer
and mian
separately, 1.x separates the encrypted renderer.pkg by default. If you need to restore the behavior of 0.x, you can set renderer.output
to ''
export default defineConfig({
renderer: {
entry: 'renderer',
output: ''
}
})
When
package.json
exists in therenderer
folder, therenderer.yml
file will be generated in the packagedrenderer.pkg
directory
MIT License
FAQs
simple electron package encryption tool
The npm package electron-builder-encryptor receives a total of 11 weekly downloads. As such, electron-builder-encryptor popularity was classified as not popular.
We found that electron-builder-encryptor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.