encryption – How are passwords stored in the database of a decentralized peer to peer system?

I want to use username and password instead of public key cryptography for a decentralized peer-to-peer application, but since the passwords are stored on users’ computers, there is a possibility of being stolen. How do I store the passwords securely?

And how do I give permission safely? How can I prevent someone else from gaining permission unfairly?