refactor: Optimize traversal browser data logic (#311)

* refactor: Refactor package names and imports for better code organization.
* refactor: Package imports and variable types for consistency
* chore: Disable unused-parameter rule in revive.
* refactor: Refactor and organize data extraction and browserdata parse.
* fix: rename wrong error message info
This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2024-04-12 19:10:41 +08:00
parent c31cf602ed
commit 536f2082f9
35 changed files with 449 additions and 353 deletions
+3 -5
View File
@@ -9,9 +9,7 @@ import (
"fmt"
)
var (
ErrCiphertextLengthIsInvalid = errors.New("ciphertext length is invalid")
)
var ErrCiphertextLengthIsInvalid = errors.New("ciphertext length is invalid")
func AES128CBCDecrypt(key, iv, ciphertext []byte) ([]byte, error) {
block, err := aes.NewCipher(key)
@@ -57,7 +55,7 @@ func AES128CBCEncrypt(key, iv, plaintext []byte) ([]byte, error) {
return encryptedData, nil
}
func DES3Decrypt(key, iv []byte, ciphertext []byte) ([]byte, error) {
func DES3Decrypt(key, iv, ciphertext []byte) ([]byte, error) {
block, err := des.NewTripleDESCipher(key)
if err != nil {
return nil, err
@@ -76,7 +74,7 @@ func DES3Decrypt(key, iv []byte, ciphertext []byte) ([]byte, error) {
return pkcs5UnPadding(sq)
}
func DES3Encrypt(key, iv []byte, plaintext []byte) ([]byte, error) {
func DES3Encrypt(key, iv, plaintext []byte) ([]byte, error) {
block, err := des.NewTripleDESCipher(key)
if err != nil {
return nil, err