There are two ways to approach this. The membership system you use on your site can be sent buyer details with each purchase and it can generate a random password and we will send it to the buyer. Please see "generated codes" in our help page for this
Other system will be to pre-generate a list of username and password in your membership system and simply use E-junkie to send them. This will not require you to write a code generator.
As for a simple membership system, you can use an HTTP authentication system (.htaccess and .htpasswd) and if you are using stored codes, you can use any free utility to add username password pairs to it. If you use "generated codes", you can use a PHP script to create entries in .htpasswd when we call it for each sale.