Firebase keys give you access to the database, which can be public. You just have to setup rules for the database, usually so users have to be authenticated to view anything and can only read their own private info.
edit: just realized you may have just been asking about hiding keys in general. Sorry if this wasn't what you were asking about!