This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3' | |
| services: | |
| graph-node: | |
| image: graphprotocol/graph-node | |
| ports: | |
| - '8000:8000' | |
| - '8001:8001' | |
| - '8020:8020' | |
| - '8030:8030' | |
| - '8040:8040' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| specVersion: 0.0.3 | |
| description: >- | |
| A secure & decentralized way to address resources on and off the blockchain | |
| using simple, human-readable names. Access domains and transfer history. | |
| repository: 'https://github.com/ensdomains/ens-subgraph' | |
| schema: | |
| file: ./schema.graphql | |
| dataSources: | |
| - kind: ethereum/contract | |
| name: ENSRegistry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trailer = 'ffd9' # trailer for JPEG | |
| # Get trailer offset | |
| with open("cover.jpg", "rb") as cover_secret: | |
| file = cover_secret.read() | |
| offset = file.index(bytes.fromhex(trailer)) | |
| # Write cover bytes to output file from offset + trailer length | |
| with open("cover.jpg", "rb") as cover_secret, open("secret.txt", "wb") as secret: | |
| cover_secret.seek(offset + len(trailer)//2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with open("cover.jpg", "ab") as cover, open("secret.txt", "rb") as secret: | |
| cover.write(secret.read()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with open("cover.jpg", "rb") as f: | |
| for chunk in iter(lambda: f.read(8), b''): | |
| print(chunk.decode('utf-8', errors="ignore"), end="") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| message = "Hello World!" | |
| with open("cover.jpg", "ab") as f: | |
| f.write(message.encode('utf8')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| import piexif | |
| im = Image.open("cover-secret.jpg") | |
| piexif.load(im.info["exif"])["0th"]\ | |
| [piexif.ImageIFD.ImageDescription].decode("utf-8") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| import piexif | |
| message = "Hello World!" | |
| im = Image.open("cover.jpg") | |
| if "exif" in im.info: | |
| exif_dict = piexif.load(im.info["exif"]) | |
| exif_dict["0th"][piexif.ImageIFD.ImageDescription] = message | |
| exif_bytes = piexif.dump(exif_dict) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| import numpy as np | |
| secret = Image.open("cover-secret.png") | |
| data_s = np.array(secret) | |
| bit = np.bitwise_and(np.right_shift(data_s, 1), 1) | |
| data_s = bit ^ data_s & 1 | |
| new_img = Image.fromarray(data_s * np.uint(255)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| import numpy as np | |
| cover = Image.open("cover.png") | |
| data_c = np.array(cover) | |
| # Convert image to full black and white and resize to cover image | |
| secret = Image.open("qr-secret.png").convert('1') | |
| secret = secret.resize(cover.size) | |
| data_s = np.array(secret, dtype=np.uint8) |
NewerOlder