Jump to content
  • Advertisement
Sign in to follow this  
null;

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

This topic is 762 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
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?

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!