Add-on Generate random code on each login


I'm looking for a simple plugin that will allow a third party software to work with xenForo. All this plugin needs to do is generate a random unique string and insert in into the database where the usernames and passwords are stored in its own column. It needs to be changed in the database each time the user logs (preferably when they register also) into xenForo. Also it would be great if some how the string can be removed (set to NULL) when the user closes their browser or leaves the site entirely (if possible, idk).