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/split-cube-studios/silk
Silk is an N-dimensional implementation of the wave function collapse algorithm. This utility was largely inspired by the work of Maxim Gumin and his WaveFunctionCollapse repository.
Silk aims not only to provide a flexible implementation of the algorithm, but also provide out-of-the-box for some common data types/use-cases. Currently Silk only supports generating 2D images, but a user is able to implement their own silk.Shuttle
for other data types/dimensions.
Silk comes with a CLI that can use the provided silk.Shuttle
implementations to generate outputs. The CLI can be installed with:
go install github.com/split-cube-studios/silk/cmd/silk
Below is the output of silk help
:
NAME:
silk - Generate procedural data with wave function collapse.
USAGE:
silk [global options] command [command options] [arguments...]
COMMANDS:
image Generate an image.
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help (default: false)
--seed value Seed value for the random number generator. (default: 1665169812)
Silk uses subcommands for different datatypes, which each may have different flags. See silk help <command>
for more information.
Silk can also be used as a library. The silk
package provides the core functionality of the algorithm, while the silk/pkg/shuttle
package provides some common implementations of the silk.Shuttle
interface.
Below is an example of using Silk to generate a 2D image:
package main
import (
"image"
"image/color"
"image/png"
"os"
"github.com/split-cube-studios/silk"
"github.com/split-cube-studios/silk/pkg/shuttle"
)
func main() {
f, err := os.Open("input.png")
if err != nil {
panic(err)
}
defer f.Close()
img, _, err := image.Decode(f)
if err != nil {
panic(err)
}
size := 128
loom := silk.NewLoom(
[]int{size, size},
shuttle.NewImageShuttle(
img,
shuttle.ImageShuttleOptions{
W: size,
H: size,
},
),
)
if err := loom.Weave(); err != nil {
panic(err)
}
}
Command | Input | Output (Progression) | Output (Final) |
---|---|---|---|
silk image --input ./samples/lines.png -a -r xy | |||
silk image --input ./samples/island.png -a -r x |
Contributions are welcome! Contribution guides are coming soon.
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.