Using hashes as passwords I have thought of a system for generating passwords which works as follows:

Take the following items:


A password, such as williamwallace.
A secret 1000 digit number which is stored on my computer.
The name of a website.


Create a password like this:

hex(sha512(site + password + number))


For example:

hex(sha512('google' + 'williamwallace' + '1456 … 3889'))


The generated hash can then be used as your password. How secure is this system?
I don't see any obvious security problems in your approach. You can look into key derivation functions, that can provide some additional security in case one of the following occurs:


Your password leaks
Your secret number leaks
A weakness is identified in the hash function


There is a few usability issues, that would have to be addressed as well:


Different sites have different password policies (minimum password length, maximum password length, required characters, forbidden characters). There is no single function mapping from binary hash value to password string, which can be used with every password policy. Your current approach of using a hexadecimal string will run into two issues: Maximum length of password being 8 or 20 characters is not unusual. Requiring at least one non-alphanumerical character is also not unusual. Solution I propose for this is that you have different functions mapping from binary hash to password string, such you can choose one suitable for each site's particular policy. I think base64 is a better default than hexadecimal.
You may sometimes need to change the password on individual sites more frequently than others. Along with the site name you could include information about when the password was generated. A granularity of one month seems like a good balance between these two factors:

How often you may need to be able to change the password.
How easy you can remember the correct time as well as the possibility to brute force this single field, in case you forgot when the password was created, but remember everything else.

You may need to change your master password and keyfile because one of the two has leaked. But changing passwords for every site right away may not be feasible. To address this purpose, I would do the following:

Create a new secret number and associated password
Create a file containing the old password and secret number both encrypted using the new secret number and password.
Before starting to use the new password check a couple of times a day for a couple of days, that you can remember the new password. Verify this by decrypting the encrypted data and compare the secret number.
Once you have proven enough times that you can remember the new password, destroy the old clear text secret such that old passwords can only be accessed by decrypting using the new password.
From this point use the new data for all new passwords and only use the decryption for passwords, that have not been updated yet.
Record when the date on which the switch over was made.