mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
410bffe643
* refactor: naming cleanup across all packages
24 lines
559 B
Go
24 lines
559 B
Go
//go:build darwin || linux
|
|
|
|
package keyretriever
|
|
|
|
import (
|
|
"hash"
|
|
|
|
"github.com/moond4rk/hackbrowserdata/crypto"
|
|
)
|
|
|
|
// pbkdf2Params holds platform-specific PBKDF2 key derivation parameters.
|
|
// Each platform file defines its own params variable.
|
|
type pbkdf2Params struct {
|
|
salt []byte
|
|
iterations int
|
|
keySize int
|
|
hashFunc func() hash.Hash
|
|
}
|
|
|
|
// deriveKey derives an encryption key from a secret using PBKDF2.
|
|
func (p pbkdf2Params) deriveKey(secret []byte) []byte {
|
|
return crypto.PBKDF2Key(secret, p.salt, p.iterations, p.keySize, p.hashFunc)
|
|
}
|