The password hack in terminal is for the system admin password and really is just a method of resetting it in Unix. I just did it the other day to my son's computer.
What you are asking for is the encryption key for a Pges document and that is an entirely different matter.
Life is not like the Hollywood version of hackers who stare at the screen twiddle their pencil with an evil conceited smile then go type type type type, fist punch in the air "Yeah!!! Take that!".
If you are after those, I suggest you look through the film credits and see if can spot the actor's name and get them to come around your place and reprise their role.
You can then give them a round of applause for the show and go back to try and cracking back into your document, because I believe Apple uses a pretty strong encryption.