This commit is contained in:
number571 2024-10-24 17:17:54 +07:00
parent 6a8465b1a9
commit 8cf76eb3f7
9 changed files with 10 additions and 99 deletions

View File

@ -6,6 +6,10 @@
*??? ??, ????*
### CHANGES
- `cmd/tools/keysplit`: deleted
<!-- ... -->
## v1.7.2

View File

@ -3,9 +3,7 @@
default: build
build:
make -C ./keygen build
make -C ./keysplit build
make -C ./pmanager build
clean:
make -C ./keygen clean
make -C ./keysplit clean
make -C ./pmanager clean

View File

@ -1,2 +0,0 @@
*.key
tkeysplit

View File

@ -1,18 +0,0 @@
GC=go build
ROOPATH=../../..
BINPATH=$(ROOPATH)/bin
.PHONY: default build clean
default: build
build:
$(GC) -o $(BINPATH)/tkeysplit . # main
for arch in amd64 arm64; \
do \
CGO_ENABLED=0 GOOS=linux GOARCH=$${arch} go build -o $(BINPATH)/tkeysplit_$${arch}_linux .; \
CGO_ENABLED=0 GOOS=windows GOARCH=$${arch} go build -o $(BINPATH)/tkeysplit_$${arch}_windows.exe .; \
CGO_ENABLED=0 GOOS=darwin GOARCH=$${arch} go build -o $(BINPATH)/tkeysplit_$${arch}_darwin .; \
done;
clean:
rm -f *.key
rm -f tkeysplit $(BINPATH)/tkeysplit $(BINPATH)/tkeysplit_*

View File

@ -1,16 +0,0 @@
# Keysplit
> Asymmetric key spliter
```bash
usage:
go run . [key-file]
```
## Example
```bash
$ go run ../keygen
$ go run . pub.key
$ go run . priv.key
```

View File

@ -1,55 +0,0 @@
package main
import (
"os"
"github.com/number571/go-peer/pkg/crypto/asymmetric"
"github.com/number571/go-peer/pkg/encoding"
)
func main() {
if len(os.Args) != 2 {
panic("len(os.Args) != 2")
}
keyBytes, err := os.ReadFile(os.Args[1])
if err != nil {
panic(err)
}
var (
privKey asymmetric.IPrivKey
pubKey asymmetric.IPubKey
)
privKey = asymmetric.LoadPrivKey(string(keyBytes))
pubKey = asymmetric.LoadPubKey(string(keyBytes))
if privKey != nil {
kemPrivKey := encoding.HexEncode(privKey.GetKEMPrivKey().ToBytes())
dsaPrivKey := encoding.HexEncode(privKey.GetDSAPrivKey().ToBytes())
if err := os.WriteFile("priv.kem.key", []byte(kemPrivKey), 0600); err != nil {
panic(err)
}
if err := os.WriteFile("priv.dsa.key", []byte(dsaPrivKey), 0600); err != nil {
panic(err)
}
return
}
if pubKey != nil {
kemPubKey := encoding.HexEncode(pubKey.GetKEMPubKey().ToBytes())
dsaPubKey := encoding.HexEncode(pubKey.GetDSAPubKey().ToBytes())
if err := os.WriteFile("pub.kem.key", []byte(kemPubKey), 0600); err != nil {
panic(err)
}
if err := os.WriteFile("pub.dsa.key", []byte(dsaPubKey), 0600); err != nil {
panic(err)
}
return
}
panic("got invalid key or file is not found")
}

View File

@ -1,5 +1,5 @@
package gopeer
const (
CVersion = "v1.7.2"
CVersion = "v1.7.3~"
)

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="20" role="img" aria-label="code lines: 12550"><title>code lines: 12550</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="96" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="57" height="20" fill="#555"/><rect x="57" width="40" height="20" fill="#4682b4"/><rect width="96" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="295" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">code lines</text><text x="295" y="140" transform="scale(.1)" fill="#fff" textLength="510">code lines</text><text aria-hidden="true" x="770" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="320">12550</text><text x="770" y="140" transform="scale(.1)" fill="#fff" textLength="320">12550</text></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="20" role="img" aria-label="code lines: 12495"><title>code lines: 12495</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="96" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="57" height="20" fill="#555"/><rect x="57" width="40" height="20" fill="#4682b4"/><rect width="96" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="295" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">code lines</text><text x="295" y="140" transform="scale(.1)" fill="#fff" textLength="510">code lines</text><text aria-hidden="true" x="770" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="320">12495</text><text x="770" y="140" transform="scale(.1)" fill="#fff" textLength="320">12495</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -7,7 +7,7 @@
>
<g>
<rect x="20.000000" y="20.000000" width="988.000000" height="600.000000" style="fill: rgb(2, 111, 59);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="20.000000" y="20.000000" width="988.000000" height="600.000000" style="fill: rgb(2, 111, 58);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
@ -91,7 +91,7 @@
<g>
<rect x="36.000000" y="63.200000" width="538.274821" height="540.800000" style="fill: rgb(3, 112, 59);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="36.000000" y="63.200000" width="538.274821" height="540.800000" style="fill: rgb(2, 111, 59);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
@ -335,7 +335,7 @@
<g>
<rect x="440.651559" y="441.083871" width="125.623262" height="103.805187" style="fill: rgb(5, 117, 62);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="440.651559" y="441.083871" width="125.623262" height="103.805187" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
@ -658,7 +658,7 @@
<g>
<rect x="448.651559" y="462.683871" width="79.377280" height="74.205187" style="fill: rgb(8, 122, 64);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="448.651559" y="462.683871" width="79.377280" height="74.205187" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB