Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/Luzifer/go-openssl
go-openssl
is a small library wrapping the crypto/aes
functions in a way the output is compatible to OpenSSL / CryptoJS. For all encryption / decryption processes AES256 is used so this library will not be able to decrypt messages generated with other than openssl aes-256-cbc
. If you're using CryptoJS to process the data you also need to use AES256 on that side.
Starting with v2.0.0
go-openssl
generates the encryption keys using sha256sum
algorithm. This is the default introduced in OpenSSL 1.1.0c. When encrypting data you can choose which digest method to use and therefore also continue to use md5sum
. When decrypting OpenSSL encrypted data md5sum
, sha1sum
and sha256sum
are supported.
go get github.com/Luzifer/go-openssl
The usage is quite simple as you don't need any special knowledge about OpenSSL and/or AES256:
import (
"fmt"
"github.com/Luzifer/go-openssl"
)
func main() {
plaintext := "Hello World!"
passphrase := "z4yH36a6zerhfE5427ZV"
o := openssl.New()
enc, err := o.EncryptString(passphrase, plaintext)
if err != nil {
fmt.Printf("An error occurred: %s\n", err)
}
fmt.Printf("Encrypted text: %s\n", string(enc))
}
import (
"fmt"
"github.com/Luzifer/go-openssl"
)
func main() {
opensslEncrypted := "U2FsdGVkX19ZM5qQJGe/d5A/4pccgH+arBGTp+QnWPU="
passphrase := "z4yH36a6zerhfE5427ZV"
o := openssl.New()
dec, err := o.DecryptString(passphrase, opensslEncrypted)
if err != nil {
fmt.Printf("An error occurred: %s\n", err)
}
fmt.Printf("Decrypted text: %s\n", string(dec))
}
To execute the tests for this library you need to be on a system having /bin/bash
and openssl
available as the compatibility of the output is tested directly against the openssl
binary. The library itself should be usable on all operating systems supported by Go and crypto/aes
.
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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.