Sign in to follow this  

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

This topic is 479 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Edited by Josh Petrie

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

 

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.

Edited by Debz

Share this post


Link to post
Share on other sites

This topic is 479 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this