COSTFACTOR implementation #166
pete4abw
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A more intelligent method for determing costfactor value in the key derivation function (KDF),
lrz_stretch
. Generally, costfactor is determined by available RAM on encryption. However, as @AlleyPally reported in #165 , sometimes encryption and/or decryption may fail.Now, instead of relying on the
nloops
function to determine hash loops to be applied (which is redundant, since the KDF function does this anyway), the costfactor is heuristically computed as follows:RAM / 2 / 1024 rounded down to the nearest power of 2.
The default may be overridden by applying a value
--costfactor=N
whereN
is an integer between 10 and 40. This would represent costfactor values of 2^10 (1Kb) to 2^40 (1Tb). This is useful if there is a possibility that a smaller system may try and decrypt an lrz file. Or, conversely, if there is a desire to apply a higher costfactor to prevent decryption attempts on a smaller system. A default value for costfactor may also be stored in the lrzip.conf file.The costfactor value is stored as a single byte in the Magic Header.
Currently, this is being tested in the whats-next branch and will be merged after some comment.
Beta Was this translation helpful? Give feedback.
All reactions