mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-13 14:53:28 +00:00
Use random salt and make the number of iterations configurable for storage key derivation
This commit is contained in:
@@ -159,8 +159,8 @@ func RateLimitedCopy(writer io.Writer, reader io.Reader, rate int) (written int6
|
||||
}
|
||||
|
||||
// GenerateKeyFromPassword generates a key from the password.
|
||||
func GenerateKeyFromPassword(password string) []byte {
|
||||
return pbkdf2.Key([]byte(password), DEFAULT_KEY, 16384, 32, sha256.New)
|
||||
func GenerateKeyFromPassword(password string, salt []byte, iteartions int) []byte {
|
||||
return pbkdf2.Key([]byte(password), salt, iteartions, 32, sha256.New)
|
||||
}
|
||||
|
||||
// Get password from preference, env, but don't start any keyring request
|
||||
|
||||
Reference in New Issue
Block a user