Java - Image Difference Check [deleted - error on my part)

Started by
1 comment, last by null; 7 years, 8 months ago

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!

Advertisement

Apparently, this is called a 'difference check'. Is there a way to replicate this in Java?
Yes, sure, it can be done, and doesn't look very hard.

The code is doing a byte-by-byte comparison of both files, and if not the same it does some special stuff I don't understand.

Sorry if this is a dumb/obvious question
To be honest I don't understand your question. Was "yes" the answer you were looking for?

Apparently, this is called a 'difference check'. Is there a way to replicate this in Java?
Yes, sure, it can be done, and doesn't look very hard.

The code is doing a byte-by-byte comparison of both files, and if not the same it does some special stuff I don't understand.

Sorry if this is a dumb/obvious question
To be honest I don't understand your question. Was "yes" the answer you were looking for?

>and if not the same it does some special stuff I don't understand.

Yeah, I just wanted an explanation of the 'special stuff you don't understand', and if it could be done in Java.

Thanks.

EDIT: It was a *really* easy thing which anybody could do. I made an error. Disregard.

This topic is closed to new replies.

Advertisement