7/7 Hacking the pin with monkey patching


I am trying to wrap my head around the use of private methods, since it seems too easy to compromise un-encrypted information from private methods. I know the challenge was to access the pin from outside the class, but what is to keep someone from just monkey patching to get at the private methods? If not for banking, what would be a good real-world use for private methods? Or am I missing something?

I added the following underneath my class declaration:

class Account
   def hack()
      puts pin()
checking_account = Account.new('Test', 98_000_000_000)

When I run it I get:



It's pretty hard to hack a program that is on the server-side.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.