dimanche 14 janvier 2018

Java interview - Get secret message from Jar

This is an interview question which i am trying to find out the answer. A Jar contain a class file, it has two methods. (open(String) & getMessage()). Only if you pass the password to open(String) method, you can get secret message from getMessage() method. How to find the password to unlock it?

EX: If the password is "abacus", then open("abacus") --> will return box is unlocked

getMessage()--> Return the secret message.

But how to find the password which is hardcoded inside Jar through coding.





Aucun commentaire:

Enregistrer un commentaire