1515 validate_attribution ,
1616)
1717from memslicer .acquirer .region_filter import RegionFilter , SKIP_REASON_LABELS
18- from memslicer .msl .constants import CompAlgo , OSType
18+ from memslicer .msl .constants import CompAlgo , HashAlgo , OSType
1919from memslicer .utils .protection import parse_protection
2020
2121
@@ -161,6 +161,7 @@ def _create_acquirer(
161161 investigation : bool = False ,
162162 passphrase : str | None = None ,
163163 attribution = None ,
164+ hash_algo : HashAlgo = HashAlgo .BLAKE3 ,
164165):
165166 """Factory to create the appropriate acquirer for the selected backend."""
166167 from memslicer .acquirer .engine import AcquisitionEngine
@@ -246,6 +247,7 @@ def _create_acquirer(
246247 passphrase = passphrase ,
247248 collector = collector ,
248249 attribution = attribution ,
250+ hash_algo = hash_algo ,
249251 )
250252
251253
@@ -267,10 +269,11 @@ def _create_acquirer(
267269@click .option ("--encrypt" , "-E" , is_flag = True , default = False , help = "Enable AEAD encryption" )
268270@click .option ("--no-encrypt" , is_flag = True , default = False , help = "Disable encryption (overrides investigation default)" )
269271@click .option ("--passphrase" , default = None , help = "Encryption passphrase (prompted if --encrypt and not provided)" )
272+ @click .option ("--hash-algo" , "hash_algo_str" , type = click .Choice (["blake3" , "sha256" , "sha512-256" ]), default = "blake3" , help = "Integrity hash algorithm (default: blake3)" )
270273@attribution_options
271274def cli (target , backend , output_path , comp , usb , remote_addr , os_override , filter_prot , filter_addr ,
272275 verbose , read_timeout , include_unreadable , max_region_size , investigation ,
273- encrypt , no_encrypt , passphrase ,
276+ encrypt , no_encrypt , passphrase , hash_algo_str ,
274277 examiner , case_ref , hostname_override , domain_override ,
275278 include_serials , include_network_identity , include_fingerprint ,
276279 include_kernel_symbols , include_kernel_modules ,
@@ -340,6 +343,10 @@ def cli(target, backend, output_path, comp, usb, remote_addr, os_override, filte
340343 comp_map = {"none" : CompAlgo .NONE , "zstd" : CompAlgo .ZSTD , "lz4" : CompAlgo .LZ4 }
341344 comp_algo = comp_map [comp ]
342345
346+ # Parse hash algorithm
347+ hash_algo_map = {"blake3" : HashAlgo .BLAKE3 , "sha256" : HashAlgo .SHA256 , "sha512-256" : HashAlgo .SHA512_256 }
348+ hash_algo = hash_algo_map [hash_algo_str ]
349+
343350 # Parse OS override
344351 os_map = {"windows" : OSType .Windows , "linux" : OSType .Linux , "macos" : OSType .macOS , "android" : OSType .Android , "ios" : OSType .iOS }
345352 os_ovr = os_map .get (os_override ) if os_override else None
@@ -414,6 +421,7 @@ def progress(regions_captured, total_ranges, bytes_cap, modules, regions_process
414421 investigation = investigation ,
415422 passphrase = passphrase if use_encryption else None ,
416423 attribution = attribution ,
424+ hash_algo = hash_algo ,
417425 )
418426 acquirer .set_progress_callback (progress )
419427
0 commit comments