Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/dkotik/kidwords
Provides durable and accessible paper key encoding that children can use.
Warning: alpha version is not stable and subject to iteration!
Printable paper keys are occasionally used as the last resort for recovering account access. They increase security by empowering a user with the ability to wrestle control of a compromised account from an attacker.
Most paper keys are encoded using BIP39 convention into a set of words. The final few words encode the integrity of the key with a cyclical redundancy check. When printed and stored, such keys are not durable because they can be lost to minor physical damage.
Kid Words package or command line tool increases key durability by splitting the key using Shamir's Secret Sharing algorithm into shards and encoding each shard using a dictionary of 256 four-letter English nouns.
mod Prime
.
# Command line tool installation:
go install github.com/dkotik/kidwords/cmd/kidwords@latest
kidwords --help
The secret is compressed using Zstd algorithm before getting split into eight shards. Quorum is set using --quorum=3
flag.
The number of shards is limited to eight in order to use additional 13 bites for an error detection code. The shard ordinal and the error detection code are expressed as two additional words appended to the end of each shard. (This is wrong - the last byte encodes a random shard ordinal from 0-255)
When the quorum is set to 3
any three of the shards will be sufficient to recover the secret. If the quorum is set to 8
, every single shard will be required.
import (
"fmt"
"os"
// To install the library run shell command:
//
// $ go get github.com/dkotik/kidwords@latest
"github.com/dkotik/kidwords"
"github.com/dkotik/kidwords/shamir"
)
func main() {
// break a secret key into shards
shards, err := kidwords.Split(
[]byte("secret paper key"), // encoding target
12, // number of shards
4, // quorum of shards to recover target
)
if err != nil {
panic(err)
}
if _, err = shards.Grid(
3, // number of table columns
18, // number of characters to wrap the text at
).Write(os.Stdout); err != nil {
panic(err)
}
// reconstitute the key back using a quorum of four shards
key, err := shamir.Combine(shards[0:4])
if err != nil {
panic(err)
}
fmt.Println(string(key))
// Output: secret paper key
}
$ go install github.com/dkotik/kidwords@latest
$ kidwords split paperKey
🔑 Pick any 4 shards:
┌──────────────╥──────────────╥──────────────┐
│farm line belt║line hall cash║view home shot│
│beer crab pity║trap loot site║room turn tale│
│hour fund fuel║head flag pool║bank wind deal│
╞══════════════╬══════════════╬══════════════╡
│line hall cash║view home shot║help dirt turn│
│trap loot site║room turn tale║goat coat heir│
│head flag pool║bank wind deal║moss iron tour│
╞══════════════╬══════════════╬══════════════╡
│view home shot║help dirt turn║golf tape font│
│room turn tale║goat coat heir║pear debt dust│
│bank wind deal║moss iron tour║lake urge bush│
╞══════════════╬══════════════╬══════════════╡
│help dirt turn║golf tape font║wish risk cold│
│goat coat heir║pear debt dust║trap room card│
│moss iron tour║lake urge bush║firm moon root│
└──────────────╨──────────────╨──────────────┘
$ go run github.com/dkotik/kidwords/cmd/kidwords@latest combine
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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.