7/7 Hacking the pin with monkey patching


#1



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()
   end
end
checking_account = Account.new('Test', 98_000_000_000)
checking_account.hack()

When I run it I get:
"1234
nil"

https://www.codecademy.com/en/courses/ruby-beginner-en-32cN3/0/7?curriculum_id=5059f8619189a5000201fbcb



#2

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


#3

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