adding random key gen in crypto.cpp