Hi! Recently, I've been participating in this online 'game' - which just includes all kinds of cryptography challenges.
One of these challenges included a regular image, and its duplicate data moshed image. You were supposed to compare both of the image's bytes, and extract the modified ones from the data moshed image.
I've tried looking for answers online, and the only thing I could find was code belonging the same person who did the challenge.
This is the python2 code:
------
import sys orig = open('screenshot.jpg', 'rb') new = open('otherscreenshot.jpg', 'rb') replaced_bytes = '' for o, n in zip(orig.read(), new.read()): if o != n: replaced_bytes += o hint, skull = replaced_bytes.split('\n') print(hint) for i, c in enumerate(skull): sys.stdout.write( c ) if not i % 59: sys.stdout.write('\n') sys.stdout.write('\n')
------
Apparently, this produced a hidden message and is called a 'difference check'. Is there a way to replicate this in Java?
Sorry if this is a dumb/obvious question.
Thanks to whoever answers!