怎么用python写一个基于bmp图片的隐写术?

Python016

怎么用python写一个基于bmp图片的隐写术?,第1张

#!/usr/bin/env python

import Image

MAX = 25

pic = Image.new("RGB",(MAX, MAX))

str = "1111111000100001101111111100000101110010110100000110111010100000000010111011011101001000000001011101101110101110110100101110110000010101011011010000011111111010101010101111111000000001011101110000000011010011000001010011101101111010101001000011100000000000101000000001001001101000100111001111011100111100001110111110001100101000110011100001010100011010001111010110000010100010110000011011101100100001110011100100001011111110100000000110101001000111101111111011100001101011011100000100001100110001111010111010001101001111100001011101011000111010011100101110100100111011011000110000010110001101000110001111111011010110111011011"

i=0

for y in range (0,MAX):

    for x in range (0,MAX):

        if(str[i] == '1'):

            pic.putpixel([x,y],(0, 0, 0))

        else:

            pic.putpixel([x,y],(255,255,255))

        i = i+1

pic.show()

pic.save("flag.png")

看这个

github地址: https://github.com/solusipse/spectrology

工具可以将图像转换为具有相应光谱图编码的音频文件,这允许您通过音频文件中的图像隐藏隐藏的消息。

使用此工具可以选择要使用的频率范围,并支持所有流行的图像编解码器。

Usage

usage: spectrology.py [-h] [-o OUTPUT] [-b BOTTOM] [-t TOP] [-p PIXELS]

[-s SAMPLING]

INPUT

positional arguments:

INPUT Name of the image to be convected.

optional arguments:

-h, --helpshow this help message and exit

-o OUTPUT, --output OUTPUT

Name of the output wav file. Default value: out.wav).

-b BOTTOM, --bottom BOTTOM

Bottom frequency range. Default value: 200.

-t TOP, --top TOP Top frequency range. Default value: 20000.

-p PIXELS, --pixels PIXELS

Pixels per second. Default value: 30.

-s SAMPLING, --sampling SAMPLING

Sampling rate. Default value: 44100.

例如:

python spectrology.py test.bmp -b 13000 -t 19000