Finished generate key function, added uniform format for storing keys