Fixed encryption
Moved generateRandomString() function over from gnewpg