MCPcopy Create free account
hub / github.com/MearaY/StegaPy / cmd_embed

Function cmd_embed

cli.py:55–73  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

53# ── 子命令处理 ─────────────────────────────────────────────────────────
54
55def cmd_embed(args):
56 from StegaPy import StegaPy
57 encrypt = bool(args.password)
58 plugin, cfg = _make_lsb_plugin(
59 algo=args.algo,
60 bits=args.bits,
61 password=args.password,
62 compress=not args.no_compress,
63 encrypt=encrypt,
64 )
65 sp = StegaPy(plugin, cfg)
66
67 cover = _read(args.input)
68 msg = _read(args.message)
69 stego = sp.embed_data(msg, os.path.basename(args.message),
70 cover, os.path.basename(args.input),
71 os.path.basename(args.output))
72 _write(args.output, stego)
73 print(f"嵌入完成 → {args.output} ({len(msg)/1024:.1f} KB → {len(stego)/1024:.0f} KB)")
74
75
76def cmd_extract(args):

Callers 2

mainFunction · 0.85
run_interactiveFunction · 0.85

Calls 5

embed_dataMethod · 0.95
_make_lsb_pluginFunction · 0.85
StegaPyClass · 0.85
_readFunction · 0.85
_writeFunction · 0.85

Tested by

no test coverage detected