Compare commits

..

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

6 changed files with 38 additions and 65 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

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.03

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/HACKERALERT/infectious v0.0.0-20240424200929-b9ce72346a19
github.com/Picocrypt/serpent v0.0.0-20240830233833-9ad6ab254fd7 github.com/HACKERALERT/serpent v0.0.0-20210716182301-293b29869c66
github.com/schollz/progressbar/v3 v3.18.0 github.com/schollz/progressbar/v3 v3.14.4
golang.org/x/crypto v0.40.0 golang.org/x/crypto v0.25.0
golang.org/x/term v0.33.0 golang.org/x/term v0.22.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.22.0 // indirect
) )

View file

@ -1,28 +1,29 @@
github.com/Picocrypt/infectious v0.0.0-20250412183341-9f88c6307b39 h1:czHyPoiNrILv9xjfQ87UFllJgak8W6gVcYkmfOay/BE= github.com/HACKERALERT/infectious v0.0.0-20240424200929-b9ce72346a19 h1:C5t561XXXRJvdiluejbka36n+YaOB4XJuQIo+25hL1k=
github.com/Picocrypt/infectious v0.0.0-20250412183341-9f88c6307b39/go.mod h1:2ZVEanURxuWmxYZ6W6xMMy4ZR6xmQr16Vq/XPTLIspQ= github.com/HACKERALERT/infectious v0.0.0-20240424200929-b9ce72346a19/go.mod h1:bTnpEk9zNS1sVKg5TRvLkuSEGVqH0+LRfcMurPtcJvY=
github.com/Picocrypt/serpent v0.0.0-20240830233833-9ad6ab254fd7 h1:G36G2vmQAS7CVoHQrHDGAoCWll/0kPCI8Dk7mgwcJFE= github.com/HACKERALERT/serpent v0.0.0-20210716182301-293b29869c66 h1:YDpFq+y6mRcu97rn/rhYg8u8FdeO0wzTuLgM2gVkA+c=
github.com/Picocrypt/serpent v0.0.0-20240830233833-9ad6ab254fd7/go.mod h1:BxsgRYwUVd92aEwXnXsfXfHw8aHlD/PUyExC/wwk9oI= github.com/HACKERALERT/serpent v0.0.0-20210716182301-293b29869c66/go.mod h1:d/+9q3sIxtIyOgHNgFGr3yGBKKVn5h3vL4hV1qlmoLs=
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.4 h1:W9ZrDSJk7eqmQhd3uxFNNcTr0QL+xuGNI9dEMrw0r74=
github.com/schollz/progressbar/v3 v3.18.0/go.mod h1:IsO3lpbaGuzh8zIMzgY3+J8l4C8GjO0Y9S69eFvNsec= github.com/schollz/progressbar/v3 v3.14.4/go.mod h1:aT3UQ7yGm+2ZjeXPqsjTenwL3ddUiuZ0kfQ/2tHlyNI=
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.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
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.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= golang.org/x/sys v0.22.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.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk=
golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=

View file

@ -14,13 +14,12 @@ import (
"os" "os"
"os/signal" "os/signal"
"path/filepath" "path/filepath"
"runtime/debug"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/Picocrypt/infectious" "github.com/HACKERALERT/infectious"
"github.com/Picocrypt/serpent" "github.com/HACKERALERT/serpent"
"github.com/schollz/progressbar/v3" "github.com/schollz/progressbar/v3"
"golang.org/x/crypto/argon2" "golang.org/x/crypto/argon2"
"golang.org/x/crypto/blake2b" "golang.org/x/crypto/blake2b"
@ -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)
}
} }