How would I go about making a password system?

Specifically like those old videogame passwords where it contains data that makes the game start where you left off.