I’ll give you some more advice. Don’t write security software unless you know what you are doing. Using a non-CSPRNG for keys is a complete fail. It is dangerous for your users and shows you do not know what you are doing.
My suggestion is you delete the codebase until you know what you are doing.
Maybe take a look at a book like https://www.manning.com/books/real-world-cryptography or https://nostarch.com/seriouscrypto