(algo: str, bits: int, password: str,
compress: bool, encrypt: bool)
| 31 | |
| 32 | |
| 33 | def _make_lsb_plugin(algo: str, bits: int, password: str, |
| 34 | compress: bool, encrypt: bool): |
| 35 | from StegaPy.plugin.lsb.lsb_config import LSBConfig |
| 36 | cfg = LSBConfig( |
| 37 | max_bits_used_per_channel=bits, |
| 38 | use_compression=compress, |
| 39 | use_encryption=encrypt, |
| 40 | password=password, |
| 41 | encryption_algorithm='AES128' if encrypt else None, |
| 42 | ) |
| 43 | if algo == 'randlsb': |
| 44 | from StegaPy.plugin.randlsb import RandomLSBPlugin |
| 45 | plugin = RandomLSBPlugin() |
| 46 | else: |
| 47 | from StegaPy.plugin.lsb import LSBPlugin |
| 48 | plugin = LSBPlugin() |
| 49 | plugin.config = cfg |
| 50 | return plugin, cfg |
| 51 | |
| 52 | |
| 53 | # ── 子命令处理 ───────────────────────────────────────────────────────── |
no test coverage detected