
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
github.com/naicoi92/obfuscator
A Go library for JavaScript obfuscation using V8 JavaScript Engine.
jsobfuscator-go is a Go library that helps obfuscate JavaScript code by using JavaScript Obfuscator and V8 Engine. This library provides a simple way to protect your JavaScript code from being easily read and understood.
go get github.com/naicoi92/obfuscator
go get
)package main
import (
"fmt"
"github.com/naicoi92/obfuscator"
)
func main() {
// Initialize the obfuscator
obf, err := obfuscator.NewObfuscator()
if err != nil {
panic(err)
}
// JavaScript code to obfuscate
jsCode := `function sayHello() { return "Hello World"; }`
// Perform obfuscation
obfuscatedCode, err := obf.Obfuscate(jsCode)
if err != nil {
panic(err)
}
// Print the obfuscated code
fmt.Println(obfuscatedCode)
}
const options = {
compact: (Math.random() < 0.5),
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 1,
numbersToExpressions: true,
simplify: true,
stringArrayShuffle: true,
splitStrings: true,
stringArrayThreshold: 1
}
The library uses a caching mechanism to optimize performance when performing multiple obfuscations. You should reuse the same Obfuscator instance when you need to obfuscate multiple JavaScript code snippets.
obf, _ := obfuscator.NewObfuscator()
// Use the same instance for multiple obfuscations
result1, _ := obf.Obfuscate(jsCode1)
result2, _ := obf.Obfuscate(jsCode2)
result3, _ := obf.Obfuscate(jsCode3)
Contributions are welcome! Please feel free to submit a Pull Request or create an Issue on GitHub.
This project is distributed under the MIT license.
FAQs
Unknown package
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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.