Set an open password to require a password before anyone can view the document. The permissions password (also called the owner password) controls the restrictions: printing, copying text, editing, commenting, filling forms and assembling pages. If you leave it empty, a random one is generated and shown once after saving.

You can also leave the open password empty and set only permissions. That file opens for anyone, but compliant viewers enforce the restrictions. Keep in mind that permission flags are a request to the viewer rather than real protection; only the open password actually encrypts the content against people who do not have it.

Encryption uses AES-256 by default (AES-128 is available for very old readers) and runs locally with pdf-lib in your browser. The password is never sent anywhere, and there is no way to recover it for you, so store it somewhere safe.