Improve secret information and make Windows working

* posix_ functions are not working in Windows environment, so I changed for alternative working with Unix & Windows.
* I added $rightsecret variable to inform the user that he/she entered an incorrect secret.