TXTStegano
stegobox.codec.TXTStegano
Bases: BaseCodec
Program to hide a word in a text file. Convert the word into a binary string. At the end of each line of text in txt, decide whether to add a space according to the 0 and 1 of the binary string.
- Created by: QiuYu
- Created time: 2022/12/14
Originally implemented in avdvnk/Steganography-Lab1
Source code in stegobox/codec/txt_stegano/txt_stegano.py
encode(carrier, payload)
Encoder requires carrier txt and payload to be a word.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
carrier |
list
|
Carrier text in format TXT. Read with
|
required |
payload |
str
|
Payload (secret message) to be encoded. Payload is a word. |
required |
Returns:
Type | Description |
---|---|
list
|
Encoded text in format txt with the payload embedded. |
Source code in stegobox/codec/txt_stegano/txt_stegano.py
decode(carrier)
Decode the secret payload from the carrier txt.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
carrier |
tuple[int, list]
|
Encoded carrier txt. |
required |
Returns:
Type | Description |
---|---|
str
|
The decoded payload (secret message). |