Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
gopkg.in/pavel-v-chernykh/keystore-go.v2
A go (golang) implementation of Java KeyStore encoder/decoder
Take into account that JKS assumes that private keys are PKCS8 encoded.
package main
import (
"github.com/pavel-v-chernykh/keystore-go"
"log"
"os"
"reflect"
)
func readKeyStore(filename string, password []byte) keystore.KeyStore {
f, err := os.Open(filename)
defer f.Close()
if err != nil {
log.Fatal(err)
}
keyStore, err := keystore.Decode(f, password)
if err != nil {
log.Fatal(err)
}
return keyStore
}
func writeKeyStore(keyStore keystore.KeyStore, filename string, password []byte) {
o, err := os.Create(filename)
defer o.Close()
if err != nil {
log.Fatal(err)
}
err = keystore.Encode(o, keyStore, password)
if err != nil {
log.Fatal(err)
}
}
func zeroing(s []byte) {
for i := 0; i < len(s); i++ {
s[i] = 0
}
}
func main() {
password := []byte{'p', 'a', 's', 's', 'w', 'o', 'r', 'd'}
defer zeroing(password)
ks1 := readKeyStore("keystore.jks", password)
writeKeyStore(ks1, "keystore2.jks", password)
ks2 := readKeyStore("keystore2.jks", password)
log.Printf("Is equal: %v\n", reflect.DeepEqual(ks1, ks2))
}
For more examples explore examples dir
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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.