verify PoC(proof-of-concept) by chatgpt

zhou yangbo
3 min readDec 21, 2022

--

  1. Q2chatgpt: proof-of-concept of stegano image to IPFS

2.chatgpt2A:

Steganography is the practice of hiding information within other, seemingly harmless information. One way to implement a proof-of-concept for a steganographic image on IPFS (InterPlanetary File System) would be to use a library or tool that allows you to embed a message or file within an image file and then upload the resulting image to IPFS.

Here is an example of how you might go about creating a proof-of-concept for a steganographic image on IPFS using the Python programming language and the PySteg library:

Install the PySteg library by running pip install pysteg in your terminal. Import the necessary modules in your Python script:

from pysteg.lsb import LSB
from pysteg.common import *

Load the image file that you want to use as the cover image for your steganographic image. You can do this using the imread function from the skimage library:

from skimage.io import imread
cover_image = imread("cover_image.png")

4.Encode the message or file that you want to hide within the cover image using the encode function from the LSB class:

lsb = LSB(cover_image)
encoded_image = lsb.encode("secret message")

5.Save the encoded image to a file using the imsave function from the skimage library:

from skimage.io import imsave
imsave("encoded_image.png", encoded_image)

6.Upload the encoded image to IPFS using the ipfsapi library:

import ipfsapi
api = ipfsapi.connect()
result = api.add("encoded_image.png")
print(result)

This should give you the hash of the encoded image on IPFS, which you can use to retrieve the image and decode the hidden message or file. Note that this is just one way to implement a proof-of-concept for a steganographic image on IPFS, and there are many other tools and libraries that you can use to achieve the same result.

all of sounds great . now let’s prepare the python env , we can use differ env solution , for example virtualenv or conda and poetry , or just pip ,

according to code snippet,I collect the pysteg,skimage,ipfsapi..

then pip install errors happen

Using cached https://mirrors.cloud.tencent.com/pypi/packages/f0/63/c863636becd17a8863d2ad71be9a1a39c9f25901e66c2ae1614fbaa83770/encrypt-0.0.1.tar.gz (2.5 kB)
Preparing metadata (setup.py) ... done
ERROR: Cannot install encrypt==0.0.1, encrypt==0.0.10, encrypt==0.0.11, encrypt==0.0.12, encrypt==0.0.2, encrypt==0.0.3, encrypt==0.0.4, encrypt==0.0.5, encrypt==0.0.6, encrypt==0.0.7, encrypt==0.0.8 and encrypt==0.0.9 because these package versions have conflicting dependencies.

The conflict is caused by:
encrypt 0.0.12 depends on python>=2.7
encrypt 0.0.11 depends on python>=2.7
encrypt 0.0.10 depends on python>=2.7
encrypt 0.0.9 depends on python>=2.7
encrypt 0.0.8 depends on python>=2.7
encrypt 0.0.7 depends on python>=2.7
encrypt 0.0.6 depends on python>=2.7
encrypt 0.0.5 depends on python>=2.7
encrypt 0.0.4 depends on python>=2.7
encrypt 0.0.3 depends on python>=2.7
encrypt 0.0.2 depends on python>=2.7
encrypt 0.0.1 depends on python>=2.7

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

now, those errors how to fix it ? Ask chatgpt too ?

final thoughts:

the python code snippet in PoC is great! with itsgenerated codebase saved a lot time , but env setup must prepared by human , and eat chatgpt’s dog food also is human. or human to adapt to chatgpt finetune engineer?

--

--

zhou yangbo

Full Experienced(14 years+) Software Full Stack Developer,PMP,MBA,Lifelong learner.