Compare commits

..

No commits in common. "main" and "2.06" have entirely different histories.
main ... 2.06

6 changed files with 41 additions and 60 deletions

View file

@ -19,7 +19,7 @@ jobs:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '>=1.24' go-version: '>1.18'
check-latest: true check-latest: true
cache: false cache: false
@ -31,12 +31,16 @@ jobs:
- name: Build - name: Build
run: | run: |
cd picocrypt cd picocrypt
GOOS=windows GOARCH=386 go build -v -ldflags="-s -w" -o picocrypt-windows-386.exe .
GOOS=windows GOARCH=amd64 go build -v -ldflags="-s -w" -o picocrypt-windows-amd64.exe . GOOS=windows GOARCH=amd64 go build -v -ldflags="-s -w" -o picocrypt-windows-amd64.exe .
GOOS=windows GOARCH=arm64 go build -v -ldflags="-s -w" -o picocrypt-windows-arm64.exe . GOOS=windows GOARCH=arm64 go build -v -ldflags="-s -w" -o picocrypt-windows-arm64.exe .
GOOS=darwin GOARCH=amd64 go build -v -ldflags="-s -w" -o picocrypt-macos-amd64 . GOOS=darwin GOARCH=amd64 go build -v -ldflags="-s -w" -o picocrypt-macos-amd64 .
GOOS=darwin GOARCH=arm64 go build -v -ldflags="-s -w" -o picocrypt-macos-arm64 . GOOS=darwin GOARCH=arm64 go build -v -ldflags="-s -w" -o picocrypt-macos-arm64 .
GOOS=linux GOARCH=386 go build -v -ldflags="-s -w" -o picocrypt-linux-386 .
GOOS=linux GOARCH=amd64 go build -v -ldflags="-s -w" -o picocrypt-linux-amd64 . GOOS=linux GOARCH=amd64 go build -v -ldflags="-s -w" -o picocrypt-linux-amd64 .
GOOS=linux GOARCH=arm64 go build -v -ldflags="-s -w" -o picocrypt-linux-arm64 . GOOS=linux GOARCH=arm64 go build -v -ldflags="-s -w" -o picocrypt-linux-arm64 .
GOOS=linux GOARCH=riscv64 go build -v -ldflags="-s -w" -o picocrypt-linux-riscv64 .
GOOS=wasip1 GOARCH=wasm go build -v -ldflags="-s -w" -o picocrypt-wasip1.wasm .
env: env:
CGO_ENABLED: 0 CGO_ENABLED: 0
@ -49,11 +53,15 @@ jobs:
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
files: | files: |
picocrypt/picocrypt-windows-386.exe
picocrypt/picocrypt-windows-amd64.exe picocrypt/picocrypt-windows-amd64.exe
picocrypt/picocrypt-windows-arm64.exe picocrypt/picocrypt-windows-arm64.exe
picocrypt/picocrypt-macos-amd64 picocrypt/picocrypt-macos-amd64
picocrypt/picocrypt-macos-arm64 picocrypt/picocrypt-macos-arm64
picocrypt/picocrypt-linux-386
picocrypt/picocrypt-linux-amd64 picocrypt/picocrypt-linux-amd64
picocrypt/picocrypt-linux-arm64 picocrypt/picocrypt-linux-arm64
picocrypt/picocrypt-linux-riscv64
picocrypt/picocrypt-wasip1.wasm
tag_name: ${{ env.VERSION }} tag_name: ${{ env.VERSION }}
make_latest: true make_latest: true

View file

@ -34,6 +34,3 @@ To decrypt a volume:
``` ```
picocrypt volume.pcv picocrypt volume.pcv
``` ```
## Issues
Report any issues to the main Picocrypt/Picocrypt repository and prefix the title with 'CLI:'.

View file

@ -1 +1 @@
1.49 2.06

View file

@ -1,19 +1,17 @@
module github.com/Picocrypt/CLI/picocrypt module github.com/Picocrypt/CLI/picocrypt
go 1.24.0 go 1.22.3
toolchain go1.24.1
require ( require (
github.com/Picocrypt/infectious v0.0.0-20250412183341-9f88c6307b39 github.com/Picocrypt/infectious v0.0.0-20240830233326-3a050f65f9ec
github.com/Picocrypt/serpent v0.0.0-20240830233833-9ad6ab254fd7 github.com/Picocrypt/serpent v0.0.0-20240830233833-9ad6ab254fd7
github.com/schollz/progressbar/v3 v3.18.0 github.com/schollz/progressbar/v3 v3.14.6
golang.org/x/crypto v0.40.0 golang.org/x/crypto v0.26.0
golang.org/x/term v0.33.0 golang.org/x/term v0.23.0
) )
require ( require (
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/rivo/uniseg v0.4.7 // indirect github.com/rivo/uniseg v0.4.7 // indirect
golang.org/x/sys v0.34.0 // indirect golang.org/x/sys v0.24.0 // indirect
) )

View file

@ -1,28 +1,29 @@
github.com/Picocrypt/infectious v0.0.0-20250412183341-9f88c6307b39 h1:czHyPoiNrILv9xjfQ87UFllJgak8W6gVcYkmfOay/BE= github.com/Picocrypt/infectious v0.0.0-20240830233326-3a050f65f9ec h1:/cop0/v0HxIJm1XGDgIlzNJ3e4HhM8nIUPZi5RZ/n1w=
github.com/Picocrypt/infectious v0.0.0-20250412183341-9f88c6307b39/go.mod h1:2ZVEanURxuWmxYZ6W6xMMy4ZR6xmQr16Vq/XPTLIspQ= github.com/Picocrypt/infectious v0.0.0-20240830233326-3a050f65f9ec/go.mod h1:aaFq/WMVxrU2Exl/tXbTFSXajZrqw0mgn/wi42n0fK4=
github.com/Picocrypt/serpent v0.0.0-20240830233833-9ad6ab254fd7 h1:G36G2vmQAS7CVoHQrHDGAoCWll/0kPCI8Dk7mgwcJFE= github.com/Picocrypt/serpent v0.0.0-20240830233833-9ad6ab254fd7 h1:G36G2vmQAS7CVoHQrHDGAoCWll/0kPCI8Dk7mgwcJFE=
github.com/Picocrypt/serpent v0.0.0-20240830233833-9ad6ab254fd7/go.mod h1:BxsgRYwUVd92aEwXnXsfXfHw8aHlD/PUyExC/wwk9oI= github.com/Picocrypt/serpent v0.0.0-20240830233833-9ad6ab254fd7/go.mod h1:BxsgRYwUVd92aEwXnXsfXfHw8aHlD/PUyExC/wwk9oI=
github.com/chengxilo/virtualterm v1.0.4 h1:Z6IpERbRVlfB8WkOmtbHiDbBANU7cimRIof7mk9/PwM= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/chengxilo/virtualterm v1.0.4/go.mod h1:DyxxBZz/x1iqJjFxTFcr6/x+jSpqN0iwWCOK1q10rlY=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/schollz/progressbar/v3 v3.18.0 h1:uXdoHABRFmNIjUfte/Ex7WtuyVslrw2wVPQmCN62HpA= github.com/schollz/progressbar/v3 v3.14.6 h1:GyjwcWBAf+GFDMLziwerKvpuS7ZF+mNTAXIB2aspiZs=
github.com/schollz/progressbar/v3 v3.18.0/go.mod h1:IsO3lpbaGuzh8zIMzgY3+J8l4C8GjO0Y9S69eFvNsec= github.com/schollz/progressbar/v3 v3.14.6/go.mod h1:Nrzpuw3Nl0srLY0VlTvC4V6RL50pcEymjy6qyJAaLa0=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=

View file

@ -14,7 +14,6 @@ import (
"os" "os"
"os/signal" "os/signal"
"path/filepath" "path/filepath"
"runtime/debug"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@ -185,7 +184,7 @@ func compress() int {
return 1 return 1
} }
dir = filepath.ToSlash(dir) dir = filepath.ToSlash(dir)
file, err = os.CreateTemp("", "picocrypt-cli-v2-*.zip.tmp") file, err = os.CreateTemp("", "picocrypt-cli-v2-*.tmp")
if err != nil { if err != nil {
fmt.Println("Cannot create temporary file!") fmt.Println("Cannot create temporary file!")
return 1 return 1
@ -193,8 +192,6 @@ func compress() int {
pzip = file.Name() pzip = file.Name()
writer = zip.NewWriter(file) writer = zip.NewWriter(file)
fmt.Println("Info: creating temporary zip file " + pzip)
for i, path := range files { for i, path := range files {
stat, err := os.Stat(path) stat, err := os.Stat(path)
if err != nil { if err != nil {
@ -245,7 +242,6 @@ func compress() int {
return 1 return 1
} }
} }
debug.FreeOSMemory()
} }
writer.Close() writer.Close()
file.Close() file.Close()
@ -346,7 +342,7 @@ func work() int {
hkdfSalt = make([]byte, 32) hkdfSalt = make([]byte, 32)
serpentIV = make([]byte, 16) serpentIV = make([]byte, 16)
nonce = make([]byte, 24) nonce = make([]byte, 24)
_, errs[0] = fout.Write(rsEncode(rs5, []byte("v1.48"))) _, errs[0] = fout.Write(rsEncode(rs5, []byte("v1.34")))
_, errs[1] = fout.Write(rsEncode(rs5, []byte("00000"))) _, errs[1] = fout.Write(rsEncode(rs5, []byte("00000")))
flags := make([]byte, 5) flags := make([]byte, 5)
if *p { if *p {
@ -359,18 +355,10 @@ func work() int {
flags[4] = 1 flags[4] = 1
} }
_, errs[2] = fout.Write(rsEncode(rs5, flags)) _, errs[2] = fout.Write(rsEncode(rs5, flags))
if _, err := rand.Read(salt); err != nil { rand.Read(salt)
panic(err) rand.Read(hkdfSalt)
} rand.Read(serpentIV)
if _, err := rand.Read(hkdfSalt); err != nil { rand.Read(nonce)
panic(err)
}
if _, err := rand.Read(serpentIV); err != nil {
panic(err)
}
if _, err := rand.Read(nonce); err != nil {
panic(err)
}
_, errs[3] = fout.Write(rsEncode(rs16, salt)) _, errs[3] = fout.Write(rsEncode(rs16, salt))
_, errs[4] = fout.Write(rsEncode(rs32, hkdfSalt)) _, errs[4] = fout.Write(rsEncode(rs32, hkdfSalt))
_, errs[5] = fout.Write(rsEncode(rs16, serpentIV)) _, errs[5] = fout.Write(rsEncode(rs16, serpentIV))
@ -443,7 +431,6 @@ func work() int {
} else { } else {
key = argon2.IDKey(password, salt, 4, 1<<20, 4, 32) key = argon2.IDKey(password, salt, 4, 1<<20, 4, 32)
} }
debug.FreeOSMemory()
tmp := sha3.New512() tmp := sha3.New512()
tmp.Write(key) tmp.Write(key)
keyHash = tmp.Sum(nil) keyHash = tmp.Sum(nil)
@ -598,7 +585,6 @@ func work() int {
serpent = cipher.NewCTR(s, serpentIV) serpent = cipher.NewCTR(s, serpentIV)
counter = 0 counter = 0
} }
debug.FreeOSMemory()
} }
if mode == "encrypt" { if mode == "encrypt" {
@ -687,13 +673,4 @@ func main() {
} }
os.Exit(1) os.Exit(1)
} }
td := os.TempDir()
matches, err := filepath.Glob(filepath.Join(td, "picocrypt-cli-v2-*.zip.tmp"))
if err != nil {
panic(err)
}
for _, v := range matches {
os.Remove(v)
}
} }