I was thinking of writing a little program to generate passwords for me. What I want to do is encrypt the url of the login page with my master password, and take the first ~20 characters as my password for that login page (or however many characters any password length restrictions allow).
What I want to know is, is this secure, even if someone were to find my code (or this question)? By secure, I mean, as secure as the master password itself. For instance, if a site is compromised and an attacker gets one or more of my encryptions + url, can he extract my master password from that? If it's not secure, can I make it secure by adding something?
PS. I realize that this will also screw me if the login page ever changes url, but I can just reset my password then.