I'm writing a level for a game in which the player has an advantage if they know a password. I want it to be infeasible to find the password from looking at the level's source code.
The problem is that the language's levels are written in an ad-hoc scripting language without any crypto libraries, so I have to implement everything myself.
Also, inputting passwords within the game is a little awkward, so I'd like the password to be no larger than a random 64-bit integer, which should provide enough entropy to avoid a brute-force attack.
One possibility I've considered is to store a large semiprime and have the password be one of its factors. Validation is very easy to implement, but semiprimes need to have factors much larger than 64 bits to be secure. I've considered storing the first 448 bits of a 512-bit factor and have the password be the remaining 64 bits, but I have no idea if this is secure.
Another possibility is to implement SHA-256 and store the password's hash. This would of course be much harder to implement.
So my questions are:
If a 1024-bit semiprime is stored along with the first 448 bits of one of its factors, can the remaining 64 bits of that factor be feasibly found?
Is there another easy-to-implement but hard-to-crack password validation scheme I could use?