feat: add CountEntries to skip decryption for list --detail (#562)

* feat: add CountEntries to skip decryption for list --detail (#549)
* test: add CountEntries and countCategory tests at browser level
* fix: address review feedback on CountRows and countLocalStorage
* test: add CountRows unit tests
This commit is contained in:
Roger
2026-04-07 22:28:39 +08:00
committed by GitHub
parent 5f42d4fe5f
commit b3bbc0dadf
40 changed files with 1009 additions and 101 deletions
+8
View File
@@ -13,6 +13,14 @@ import (
"github.com/moond4rk/hackbrowserdata/types"
)
func countPasswords(path string) (int, error) {
data, err := os.ReadFile(path)
if err != nil {
return 0, err
}
return len(gjson.GetBytes(data, "logins").Array()), nil
}
// decryptPBE combines base64 decode + ASN1 PBE parse + decrypt into one call.
func decryptPBE(encoded string, masterKey []byte) ([]byte, error) {
raw, err := base64.StdEncoding.DecodeString(encoded)